From a66265d40e7c64d35c279c361584ec700d4c8c81 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Thu, 12 Oct 2023 16:50:13 -0500 Subject: [PATCH] add field base price for create_sale --- sale.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sale.py b/sale.py index b7bfe9c..6af0872 100644 --- a/sale.py +++ b/sale.py @@ -62,6 +62,7 @@ class Sale(metaclass=PoolMeta): if field_status_order: line['status_order'] = 'requested' line['unit'] = template.default_uom.id + line['base_price'] = line['unit_price'] line['description'] = template.name taxes = list(template.account_category.customer_taxes_used) taxes_ids = [t.id for t in taxes] @@ -105,12 +106,13 @@ class Sale(metaclass=PoolMeta): del v['total_amount'] v['type'] = 'line' v['unit_price'] = round(Decimal(v['unit_price']), 4) + v['base_price'] = round(Decimal(v['unit_price']), 4) product = Product(v['product']) - if v.get('discount') and v['discount'] != '': - v['discount'] = Decimal(v['discount']) / 100 - elif v.get('discount'): - del v['discount'] + # if v.get('discount') and v['discount'] != '': + # v['discount'] = Decimal(v['discount']) / 100 + # elif v.get('discount'): + # del v['discount'] template = product.template cls._add_values(template, v, field_status_order)