diff options
| author | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2026-03-13 17:32:26 +0700 |
|---|---|---|
| committer | HafidBuroiroh <hafidburoiroh09@gmail.com> | 2026-03-13 17:32:26 +0700 |
| commit | 4e1fc964db0efcacf3bc4bd5038da9c3ad313f89 (patch) | |
| tree | 873fdbf11de5124c45554b9b2661bc33f8fb1d62 /indoteknik_custom | |
| parent | f4d0b63e800b068011aa8c391ba601b3be878afc (diff) | |
<hafid> fix sjo request add field & bom logic
Diffstat (limited to 'indoteknik_custom')
| -rw-r--r-- | indoteknik_custom/models/sourcing_job_order.py | 4 | ||||
| -rw-r--r-- | 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 @@ <field name="vendor_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> <field name="tax_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> <field name="subtotal" readonly="1" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="uom_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> + <field name="web_tax_id" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> <field name="product_category" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> <field name="product_type" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> <field name="product_class" widget="many2many_tags" attrs="{'readonly': [('state', 'in', ['sent', 'cancel', 'approve'])]}"/> |
