From 2cd0d5ede34e2c46b3bcd1f1907cd0526ef42b9d Mon Sep 17 00:00:00 2001 From: FIN-IT_AndriFP Date: Fri, 17 Oct 2025 15:45:48 +0700 Subject: (andri) butuh approval pimpinan bila ada perubahan unit price pada PO PJ + matches SO margin header <=15% --- indoteknik_custom/models/purchase_order_line.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indoteknik_custom/models/purchase_order_line.py') diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index a3c3a33b..8c72887d 100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py @@ -51,6 +51,12 @@ class PurchaseOrderLine(models.Model): contribution_cost_service = fields.Float(string='Contribution Cost Service', compute='_compute_doc_delivery_amt') ending_price = fields.Float(string='Ending Price', compute='_compute_doc_delivery_amt') show_description = fields.Boolean(string='Show Description', help="Show Description when print po", default=True) + price_unit_before = fields.Float(string='Unit Price Before', help="Harga awal yang sebelumnya telah diinputkan") + + @api.onchange('price_unit') + def _onchange_price_unit_before(self): + if self._origin: + self.price_unit_before = self._origin.price_unit def _compute_doc_delivery_amt(self): for line in self: -- cgit v1.2.3