From 4e1fc964db0efcacf3bc4bd5038da9c3ad313f89 Mon Sep 17 00:00:00 2001 From: HafidBuroiroh Date: Fri, 13 Mar 2026 17:32:26 +0700 Subject: fix sjo request add field & bom logic --- indoteknik_custom/models/sourcing_job_order.py | 4 ++-- indoteknik_custom/views/sourcing.xml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/sourcing_job_order.py b/indoteknik_custom/models/sourcing_job_order.py index a107b5ae..7c3a095f 100644 --- a/indoteknik_custom/models/sourcing_job_order.py +++ b/indoteknik_custom/models/sourcing_job_order.py @@ -782,7 +782,7 @@ class SourcingJobOrderLine(models.Model): for rec in self: job = rec.order_id - if job.show_salesperson or job.show_salesperson.id != self.env.uid: + if not job.show_salesperson or job.show_salesperson.id != self.env.uid: raise UserError("❌ Hanya Salesperson Sale Order yang bisa approve.") rec.write({'state': 'approve'}) @@ -831,7 +831,7 @@ class SourcingJobOrderLine(models.Model): product.default_code = sku_auto rec.code = sku_auto - if product.categ_id or product.categ_id.id == 34: + if product.categ_id and product.categ_id.id == 34: product.unpublished = True rec.product_id = product.id diff --git a/indoteknik_custom/views/sourcing.xml b/indoteknik_custom/views/sourcing.xml index 5a78bbb3..9005e5b6 100644 --- a/indoteknik_custom/views/sourcing.xml +++ b/indoteknik_custom/views/sourcing.xml @@ -609,6 +609,8 @@ + + -- cgit v1.2.3