Skip to content

Commit e78431b

Browse files
committed
[MIG] product_variant_sale_price: Migration to 16.0
1 parent bd120c9 commit e78431b

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

product_variant_sale_price/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "Product Variant Sale Price",
77
"summary": "Allows to write fixed prices in product variants",
8-
"version": "15.0.1.0.0",
8+
"version": "16.0.1.0.0",
99
"category": "Product Management",
1010
"website": "https://github.com/OCA/product-variant",
1111
"author": "Tecnativa, " "Odoo Community Association (OCA)",

product_variant_sale_price/models/product_product.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,18 @@ def _compute_lst_price(self):
3434
uom_model = self.env["uom.uom"]
3535
for product in self:
3636
price = product.fix_price or product.list_price
37-
if "uom" in self.env.context:
38-
price = product.uom_id._compute_price(
39-
price, uom_model.browse(self.env.context["uom"])
40-
)
37+
if self.env.context.get("uom"):
38+
context_uom = uom_model.browse(self.env.context.get("uom"))
39+
price = product.uom_id._compute_price(price, context_uom)
4140
product.lst_price = price
4241

4342
def _compute_list_price(self):
4443
uom_model = self.env["uom.uom"]
4544
for product in self:
4645
price = product.fix_price or product.product_tmpl_id.list_price
47-
if "uom" in self.env.context:
48-
price = product.uom_id._compute_price(
49-
price, uom_model.browse(self.env.context["uom"])
50-
)
46+
if self.env.context.get("uom"):
47+
context_uom = uom_model.browse(self.env.context.get("uom"))
48+
price = product.uom_id._compute_price(price, context_uom)
5149
product.list_price = price
5250

5351
def _inverse_product_lst_price(self):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../product_variant_sale_price
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)