From 90ee21e0c1b2179b53d1dbadd6232bf22a3eea5a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 27 Sep 2022 11:36:23 +0700 Subject: Update purchase_order.py and sale_order.py --- indoteknik_custom/models/purchase_order.py | 2 +- indoteknik_custom/models/sale_order.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index a9d9cc6b..406b17fc 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -9,7 +9,7 @@ class PurchaseOrder(models.Model): procurement_status = fields.Char(string='Procurement Status', compute='get_procurement_status', readonly=True) approval_status = fields.Selection([ ('pengajuan1', 'Approval Manager'), #siapa? darren - 11 - ('pengajuan2', 'Approval Pimpinan'), #akbar - 7 + ('pengajuan2', 'Approval Pimpinan'), #akbar - 7 temporary not used ('approved', 'Approved'), ], string='Approval Status', readonly=True, copy=False, index=True, tracking=3) count_line_product = fields.Float('Count Line Product', compute='compute_count_line_product') diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 1fb88495..73047171 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -39,6 +39,8 @@ class SaleOrder(models.Model): raise UserError("Status harus draft atau sent") approval1 = approval2 = 0 for line in order.order_line: + if line.product_id.id == 232383: + raise UserError(_('Tidak bisa Confirm menggunakan Produk Sementara')) if not line.product_id or line.product_id.type == 'service': continue if (line.item_percent_margin <= 15) and ( -- cgit v1.2.3