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 5c55738f62
commit 64c9788692
1 changed files with 1 additions and 3 deletions

View File

@ -117,9 +117,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'])