From 7afd1ef51e18f9dcb1c0e71ea1e512b52284d3d1 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 5 Nov 2024 11:09:46 +0700 Subject: add sticky note while ask approval --- indoteknik_custom/models/purchase_order.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 393fc562..6fc0c497 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -730,7 +730,20 @@ class PurchaseOrder(models.Model): elif self.total_percent_margin == self.total_so_percent_margin and self.sale_order_id: raise UserError("Bisa langsung Confirm") else: + reason = '' self.approval_status = 'pengajuan1' + if self.amount_untaxed >= 50000000: + reason = 'above 50jt, ' + if self.total_percent_margin < self.total_so_percent_margin: + reason += 'diff margin, ' + if not self.from_apo and not self.sale_order_id: + reason += 'not link with sales, ' + # Post a highlighted message to lognote + self.message_post( + body=f"
" + f"Note Return (Pinned):
{reason}
", + subtype_id=self.env.ref("mail.mt_note").id + ) def re_calculate(self): if self.from_apo: -- cgit v1.2.3