not require quantize cost_price because price_digits is from the configuration

This commit is contained in:
Raimon Esteve 2022-10-15 20:12:20 +02:00
parent 2e2213b514
commit 2a2c20398d
1 changed files with 1 additions and 3 deletions

View File

@ -113,9 +113,7 @@ class SaleLine(metaclass=PoolMeta):
def on_change_product(self):
super(SaleLine, self).on_change_product()
if self.product:
cost_price = self.product.cost_price
self.cost_price = cost_price.quantize(
Decimal(1) / 10 ** self.__class__.cost_price.digits[1])
self.cost_price = self.product.cost_price
@fields.depends('type', 'quantity', 'cost_price', '_parent_sale.currency',
'_parent_sale.lines', methods=['on_change_with_amount'])