summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/sale_order_line.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py
index 7fb4a024..8fb34328 100644
--- a/indoteknik_custom/models/sale_order_line.py
+++ b/indoteknik_custom/models/sale_order_line.py
@@ -33,9 +33,11 @@ class SaleOrderLine(models.Model):
@api.onchange('product_uom', 'product_uom_qty')
def product_uom_change(self):
+ if not self.product_uom or not self.product_id:
+ self.price_unit = 0.0
+ return
- super(SaleOrderLine, self).product_uom_change()
- return False
+ self.price_unit = self.price_unit
def _compute_qty_reserved(self):
for line in self: