From 7153f047a6c9e98a1a016a6e08379f495071c9a1 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Thu, 10 Oct 2024 09:45:23 +0700 Subject: add approve_by po --- indoteknik_custom/models/purchase_order.py | 2 ++ indoteknik_custom/views/purchase_order.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 08408506..12eeb5c4 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -70,6 +70,7 @@ class PurchaseOrder(models.Model): bills_dp_id = fields.Many2one('account.move', string='Bills DP') grand_total = fields.Monetary(string='Grand Total', help='Amount total + amount delivery', compute='_compute_grand_total') total_margin_match = fields.Float(string='Total Margin Match', compute='_compute_total_margin_match') + approve_by = fields.Many2one('res.users', string='Approve By') def _compute_total_margin_match(self): for purchase in self: @@ -541,6 +542,7 @@ class PurchaseOrder(models.Model): self.po_status = 'menunggu' self.calculate_line_no() + self.approve_by = self.env.user.id # override date planned added with two days leadtime = self.partner_id.leadtime diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index 346100ae..1702db5d 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -41,6 +41,7 @@ + -- cgit v1.2.3