diff options
| author | Damien Bouvy <dbo@odoo.com> | 2016-05-09 11:58:49 +0200 |
|---|---|---|
| committer | Damien Bouvy <dbo@odoo.com> | 2016-05-09 12:01:39 +0200 |
| commit | 3ce23eb464dff9f0b00dcee60ae1fcfc0e8e1f4a (patch) | |
| tree | 495a0b0dc803236b33f687c3654291c178d31991 | |
| parent | 313bc91cf509353e5bdf8bf684589475527df7be (diff) | |
[FIX] sale: uom conversion for invoiced quantities
When invoicing products from a SO, you may decide to change the uom
of the invoice (if you invoiced only a fraction of the product, for
example). In that case, conversion is necessary to ensure that the
"invoiced quantity" field on the SO line is correct.
| -rw-r--r-- | addons/sale/sale.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 02f6eb57188..6e6e44203b9 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -529,9 +529,9 @@ class SaleOrderLine(models.Model): for invoice_line in line.invoice_lines: if invoice_line.invoice_id.state != 'cancel': if invoice_line.invoice_id.type == 'out_invoice': - qty_invoiced += invoice_line.quantity + qty_invoiced += self.env['product.uom']._compute_qty_obj(invoice_line.uom_id, invoice_line.quantity, line.product_uom) elif invoice_line.invoice_id.type == 'out_refund': - qty_invoiced -= invoice_line.quantity + qty_invoiced -= self.env['product.uom']._compute_qty_obj(invoice_line.uom_id, invoice_line.quantity, line.product_uom) line.qty_invoiced = qty_invoiced @api.depends('price_subtotal', 'product_uom_qty') |
