diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-06 11:20:22 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-06 11:20:22 +0700 |
| commit | 3a818abaab201a82bbba6736adb83c26958338d2 (patch) | |
| tree | 7040c23168f61184810d336f5b781ade42a45857 /indoteknik_custom/models/purchase_order.py | |
| parent | 7712141e5fa515eb6b966ae63956e7bbb3f384f3 (diff) | |
| parent | 9602db0d08b64f50e02d3e25ab3846221bf2cb08 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 13 |
1 files changed, 13 insertions, 0 deletions
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"<div style='background-color: #fdf2e9; border: 1px solid #f5c6cb; padding: 10px;'>" + f"<b>Note Return (Pinned):</b><br>{reason}</div>", + subtype_id=self.env.ref("mail.mt_note").id + ) def re_calculate(self): if self.from_apo: |
