Skip to Content

"Sold Below Cost" in Odoo 19? Check the Carton Before You Raise the Price

Your margin report says some products are sold at a loss, but the prices look fine. Very often the cost Odoo is using belongs to the whole carton, not to the piece you sell. Here is how to spot it in Odoo 19 and two clean ways to fix it.
November 19, 2026 by
"Sold Below Cost" in Odoo 19? Check the Carton Before You Raise the Price

Your margin report says some products are sold at a loss, but the prices look fine. Very often the cost Odoo is using belongs to the whole carton, not to the piece you sell. Here is how to spot it in Odoo 19 and two clean ways to fix it.

On a recent project, an online shop selling electronics and accessories saw a worrying number of sales lines with a negative margin. The first reaction was to raise prices. Before anyone touched a price, we compared what had been bought with what was being sold.

The answer was simple. Some items were bought as one unit and then repacked into several smaller pieces for sale. Odoo still held the cost of the whole unit, so every piece carried the full cost. The margin report was doing its job; the cost behind it was wrong.

If you import in cartons, bulk bags or rolls and sell smaller packs in Oman, this is worth a ten-minute check.

This note describes standard Odoo 19 Sales, Purchase, Inventory and Manufacturing behaviour. We checked it against the Odoo 19 source code. Custom modules or your own settings can change it, so try any fix on a copy of your database first. The figures below are example numbers only.

Where Odoo's "cost" on a sales line comes from

When you use the Margins option in Sales, each sales order line shows a Cost and a Margin, and the order shows its total margin.

  • The Cost on the line is the product's cost, converted to the unit on the line (and to the order currency if it differs). It is filled in when you pick the product or change the unit, and then stored on the line.
  • The Margin is simply the line subtotal minus Cost times quantity.

So the margin can only be as good as the product's cost. If the cost is for a carton and you sell a piece, every line looks like a loss.

An example of the repacking trap

Say you buy a carton of 24 phone cables for 12.000 OMR and sell each cable for 0.900 OMR.

  • The real cost per cable is 12.000 / 24 = 0.500 OMR, so each sale makes 0.400 OMR.
  • If the product "Phone cable" received the carton price of 12.000 as its cost, Odoo thinks each cable costs 12.000, and the line shows a loss of 11.100 OMR.

Nobody did anything strange. The goods came in as "1" and went out as "24", and Odoo was never told that one carton holds 24 pieces.

Quick check before you change any price

Open one of the "loss" sales lines and go through this list:

  1. Price: is the selling price on the line what you expected (no wrong discount or pricelist)?
  2. Cost: open the product. Does its cost look like the price of a piece or the price of a carton, bag or roll?
  3. Unit: what unit is on the purchase order line and the vendor bill, and what unit is on the sales line? "1 carton" and "1 unit" are not the same thing.
  4. Repacking: is this product bought in one form and sold in another (carton to pieces, bulk to small packs)?
  5. Currency: for imports, was the purchase in a foreign currency? Check that the cost was converted to OMR.
  6. Landed costs: if you add freight and customs as landed costs, remember they raise the cost. A margin that looks fine today can drop once the landed cost is posted.

If point 2 or 3 shows a carton price on a piece product, you have found the problem.

Fix 1: same product, buy in cartons, sell in pieces

If the carton and the piece are really the same item, keep one product and teach Odoo the carton size.

  1. Turn on Units of Measure & Packagings in the settings.
  2. Create a unit called, for example, "Carton of 24" with Reference Unit = Units and Contains = 24.
  3. Keep the product's own unit as Units (the piece you sell and count).
  4. On the purchase order, buy in "Carton of 24". You can also set this unit on the vendor line of the product, so it comes in by default.

When the receipt is validated, Odoo converts the carton price to the product's unit before it values the stock. In the example above, the cost per piece becomes 0.500 OMR, and new sales lines show the real margin.

Fix 2: different products, repack through Manufacturing

If the carton and the pieces are different products (for example, a bulk bag and small retail packs with their own barcodes), record the repacking as a small production step.

  1. Install Manufacturing if you don't have it.
  2. Create a Bill of Materials for the piece product: quantity 24, component 1 carton.
  3. Each time you repack, create a Manufacturing Order: Odoo takes the carton out of stock and puts the pieces in.

How the cost is split depends on the costing method on the product category:

  • Average Cost (AVCO) or FIFO: the pieces receive the value of the consumed carton (plus any operation cost you defined), divided by the quantity produced. This is the automatic, accurate option.
  • Standard Price: the pieces keep the product's standard cost; the manufacturing order does not split the carton for you. Use the Compute Price from BoM button on the product to set the cost from the bill of materials (component cost divided by the BoM quantity), and check it again when your purchase price changes.

What about orders already confirmed?

The Cost on a sales line is stored when the line is created, so fixing the product does not rewrite old lines. Your margin reports for past orders will still show the old figures. Note the period you corrected, so nobody draws conclusions from it.

Be careful with the product cost itself. If you edit the cost of a product you already hold in stock, it can change the value of that stock in your accounts. Agree the correction with your accountant and try it on a copy of the database first.

Before go-live: add this to your checklist

  • List every product you buy in one form and sell in another.
  • For each one, choose Fix 1 (purchase unit) or Fix 2 (manufacturing).
  • Test one purchase and one sale with real users, and check the margin on the sales line.
  • Review the margin report weekly for the first month. A sudden loss on a cheap item is usually a unit problem, not a pricing problem.

For more on costing and margins in Odoo, see landed costs and true margins for Oman importers, inventory management for Muscat traders, bills of materials and production cost control and sales workflows from quotation to invoice.

Want a second opinion?

If your margin report is telling a story you don't believe, I can review your products, units and costing method with you and show where the numbers go wrong. See how I work on Odoo implementation in Oman, or book a free 30-minute review.

Related guides

Book a Free 30-Minute Odoo Review

We can check your products, units of measure and costing method together.

Book your free review

Partial Delivery in Odoo 19: Why the Lines You Removed Never Come Back
Your warehouse shipped part of a sales order, and the rest simply disappeared. No backorder, nothing left to deliver, and the order even says "Fully Delivered". Here is why it happens in Odoo 19, how to find the affected orders and how to stop it.
WhatsApp Me