diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-05-04 09:18:50 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-05-04 09:18:50 +0700 |
| commit | 39a5314e992cea3f8cf97127abcbd11cf27fa371 (patch) | |
| tree | 59e4b78c7d85c2579a4a864a4e24bf8a7e4ef05d | |
| parent | bfed92c6802a8683a715766640f77cd7b3c80fab (diff) | |
change request sale order line
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 6 |
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: |
