Round get_sale_price according to unit_price digits
issue2094 review129001
This commit is contained in:
1 parent
199341d9b0
commit
f6fb43f22b
1 file changed
+7
-1
@@ -1245,6 +1245,9 @@ class SaleLine(ModelSQL, ModelView):
|
||||
self._get_context_sale_price(product,vals)):
|
||||
res['unit_price'] = product_obj.get_sale_price([product.id],
|
||||
vals.get('quantity', 0))[product.id]
|
||||
if res['unit_price']:
|
||||
res['unit_price'] = res['unit_price'].quantize(
|
||||
Decimal(1) / 10 ** self.unit_price.digits[1])
|
||||
res['taxes'] = []
|
||||
pattern = self._get_tax_rule_pattern(party, vals)
|
||||
for tax in product.customer_taxes_used:
|
||||
@@ -1291,6 +1294,9 @@ class SaleLine(ModelSQL, ModelView):
|
||||
self._get_context_sale_price(product, vals)):
|
||||
res['unit_price'] = product_obj.get_sale_price([vals['product']],
|
||||
vals.get('quantity', 0))[vals['product']]
|
||||
if res['unit_price']:
|
||||
res['unit_price'] = res['unit_price'].quantize(
|
||||
Decimal(1) / 10 ** self.unit_price.digits[1])
|
||||
return res
|
||||
|
||||
def on_change_unit(self, vals):
|
||||
@@ -1615,7 +1621,7 @@ class Product(ModelSQL, ModelView):
|
||||
with Transaction().set_context(date=date):
|
||||
res[product.id] = currency_obj.compute(
|
||||
user2.company.currency.id, res[product.id],
|
||||
currency.id)
|
||||
currency.id, round=False)
|
||||
return res
|
||||
|
||||
def compute_delivery_date(self, product, date=None):
|
||||
|
||||
Reference in new issue
Block a user