4
4
class Pricelist (models .Model ):
5
5
_inherit = "product.pricelist"
6
6
7
- def _get_product_price (self , product , quantity , uom = None , date = False , ** kwargs ):
7
+ def _get_product_price (self , product , * args , ** kwargs ):
8
8
"""Compute the pricelist price for the specified pack product, qty & uom.
9
9
10
10
:returns: unit price of the pack product + components,
@@ -20,32 +20,24 @@ def _get_product_price(self, product, quantity, uom=None, date=False, **kwargs):
20
20
):
21
21
pack_price = 0
22
22
else :
23
- pack_price = self ._compute_price_rule (
24
- product , quantity , uom = uom , date = date , ** kwargs
25
- )[ product . id ][0 ]
23
+ pack_price = self ._compute_price_rule (product , * args , ** kwargs )[
24
+ product . id
25
+ ][0 ]
26
26
27
27
for line in product .sudo ().pack_line_ids :
28
- pack_price += line ._get_pack_line_price (
29
- self , quantity , uom = uom , date = date , ** kwargs
30
- )
28
+ pack_price += line ._get_pack_line_price (self , * args , ** kwargs )
31
29
return pack_price
32
30
else :
33
- return super ()._get_product_price (
34
- product = product , quantity = quantity , uom = uom , date = date , ** kwargs
35
- )
31
+ return super ()._get_product_price (product , * args , ** kwargs )
36
32
37
- def _get_products_price (self , products , quantity , uom = None , date = False , ** kwargs ):
33
+ def _get_products_price (self , products , * args , ** kwargs ):
38
34
"""Compute the pricelist price for the specified pack product, qty & uom.
39
35
40
36
:returns: unit price of the pack product + components,
41
37
considering pricelist rules
42
38
"""
43
39
packs , no_packs = products .split_pack_products ()
44
- res = super ()._get_products_price (
45
- no_packs , quantity = quantity , uom = uom , date = date , ** kwargs
46
- )
40
+ res = super ()._get_products_price (no_packs , * args , ** kwargs )
47
41
for pack in packs :
48
- res [pack .id ] = self ._get_product_price (
49
- product = pack , quantity = quantity , uom = uom , date = date , ** kwargs
50
- )
42
+ res [pack .id ] = self ._get_product_price (pack , * args , ** kwargs )
51
43
return res
0 commit comments