changeset 861fdb16ed8f in modules/sale:default
details: https://hg.tryton.org/modules/sale?cmd=changeset&node=861fdb16ed8f
description:
        Return existing unit price when compute for line without product

        issue10962
        review391151002
diffstat:

 sale.py |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 696862f0e72f -r 861fdb16ed8f sale.py
--- a/sale.py   Sat Oct 01 15:35:33 2022 +0200
+++ b/sale.py   Mon Oct 10 18:26:00 2022 +0200
@@ -1377,13 +1377,15 @@
                 taxes.update(tax_ids)
         return list(taxes)
 
-    @fields.depends('product', 'quantity', methods=['_get_context_sale_price'])
+    @fields.depends(
+        'product', 'quantity', 'unit_price',
+        methods=['_get_context_sale_price'])
     def compute_unit_price(self):
         pool = Pool()
         Product = pool.get('product.product')
 
         if not self.product:
-            return
+            return self.unit_price
 
         with Transaction().set_context(
                 self._get_context_sale_price()):

Reply via email to