product_sale_price_from_pricelist: support uom_po_id != uom_id
This commit is contained in:
parent
38d1bdec3f
commit
d5342c73fb
1 changed files with 9 additions and 0 deletions
|
|
@ -46,6 +46,15 @@ class StockMove(models.Model):
|
|||
else:
|
||||
price_updated = move.purchase_line_id.price_unit
|
||||
|
||||
# Convert price to product's base UoM if purchase UoM is different
|
||||
if (
|
||||
move.purchase_line_id
|
||||
and move.purchase_line_id.product_uom != move.product_id.uom_id
|
||||
):
|
||||
price_updated = move.purchase_line_id.product_uom._compute_price(
|
||||
price_updated, move.product_id.uom_id
|
||||
)
|
||||
|
||||
if float_compare(
|
||||
move.product_id.last_purchase_price_received,
|
||||
price_updated,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue