diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-14 17:01:18 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-14 17:01:18 +0700 |
| commit | 41a69ecfe8513a608c5a0accfb253ba6fb06f60a (patch) | |
| tree | 4f54154c2742927b7f2a21a7ff1192202a85fbbb | |
| parent | 14b8ea0d6a3c091d63c10768fe61a02eeb55d49d (diff) | |
lock validasi bu mo
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 366fcc6a..8aff6b3a 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -1213,13 +1213,13 @@ class SaleOrder(models.Model): if 'bom-it' in line.name.lower() or 'bom' in line.product_id.default_code.lower() if line.product_id.default_code else False: search_bom = self.env['mrp.production'].search([('product_id', '=', line.product_id.id)], order='name desc') - # if search_bom: - # confirmed_bom = search_bom.filtered(lambda x: x.state == 'confirmed') - # if not confirmed_bom: - # raise UserError( - # "Product BOM belum dikonfirmasi di Manufacturing Orders. Silakan hubungi MD.") - # else: - # raise UserError("Product BOM tidak di temukan di manufacturing orders, silahkan hubungi MD") + if search_bom: + confirmed_bom = search_bom.filtered(lambda x: x.state == 'confirmed') + if not confirmed_bom: + raise UserError( + "Product BOM belum dikonfirmasi di Manufacturing Orders. Silakan hubungi MD.") + else: + raise UserError("Product BOM tidak di temukan di manufacturing orders, silahkan hubungi MD") def check_duplicate_product(self): for order in self: @@ -1512,7 +1512,7 @@ class SaleOrder(models.Model): if not order.real_shipping_id: UserError('Real Delivery Address harus di isi') - + if self.env.context.get('due_approve', []) == False: if order.validate_partner_invoice_due(): return self._create_notification_action('Notification', |
