@@ -34,27 +34,25 @@ def _compute_lst_price(self):
34
34
uom_model = self .env ["uom.uom" ]
35
35
for product in self :
36
36
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 ["uom" ])
39
+ price = product .uom_id ._compute_price (price , context_uom )
41
40
product .lst_price = price
42
41
43
42
def _compute_list_price (self ):
44
43
uom_model = self .env ["uom.uom" ]
45
44
for product in self :
46
45
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 ["uom" ])
48
+ price = product .uom_id ._compute_price (price , context_uom )
51
49
product .list_price = price
52
50
53
51
def _inverse_product_lst_price (self ):
54
52
uom_model = self .env ["uom.uom" ]
55
53
for product in self :
56
54
vals = {}
57
- if "uom" in self .env .context :
55
+ if self .env .context . get ( "uom" ) :
58
56
vals ["fix_price" ] = product .uom_id ._compute_price (
59
57
product .lst_price , uom_model .browse (self .env .context ["uom" ])
60
58
)
0 commit comments