diff --git a/addons/product_margin/models/product_product.py b/addons/product_margin/models/product_product.py index 8911e3bc716..dda0a0ef2dd 100644 --- a/addons/product_margin/models/product_product.py +++ b/addons/product_margin/models/product_product.py @@ -106,7 +106,7 @@ class ProductProduct(models.Model): select sum(l.price_unit * l.quantity)/nullif(sum(l.quantity),0) as avg_unit_price, sum(l.quantity) as num_qty, - sum(l.quantity * (l.price_subtotal/(nullif(l.quantity,0)))) as total, + sum(l.quantity * (l.price_subtotal_signed/(nullif(l.quantity,0)))) as total, sum(l.quantity * pt.list_price) as sale_expected from account_invoice_line l left join account_invoice i on (l.invoice_id = i.id) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index 0d78bdd2a80..3928f09a5ab 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -180,7 +180,8 @@ class SaleOrderLine(models.Model): qty = 0.0 for move in self.procurement_ids.mapped('move_ids').filtered(lambda r: r.state == 'done' and not r.scrapped): if move.location_dest_id.usage == "customer": - if not move.origin_returned_move_id: + # FORWARD-PORT NOTICE: "to_refund_so" to rename to "to_refund" in v11 + if not move.origin_returned_move_id or (move.origin_returned_move_id and move.to_refund_so): qty += move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom) elif move.location_dest_id.usage != "customer" and move.to_refund_so: qty -= move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 55ed4fae05b..91735993449 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -436,7 +436,7 @@
  • -
  • +