From 68cb8eaa625b9c96de7aeb9fc45c1db81921661e Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Mon, 19 Sep 2022 09:10:47 +0700 Subject: create compute have_visit_service in sale order --- indoteknik_custom/models/sale_order.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 08349bd3..57a4921e 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -17,6 +17,13 @@ class SaleOrder(models.Model): ('pengajuan2', 'Approval Tyas'), ('approved', 'Approved'), ], string='Approval Status', readonly=True, copy=False, index=True, tracking=3) + have_visit_service = fields.Boolean(string='Have Visit Service', help='To compute is customer get visit service', compute='_compute_have_visit_service') + + def _compute_have_visit_service(self): + limit = 20000000 + self.have_visit_service = False + if self.amount_total > limit: + self.have_visit_service = True # def sale_order_approve(self): # for order in self: -- cgit v1.2.3