diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-12-17 10:13:13 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-12-17 10:13:13 +0700 |
| commit | 97d9a59c82be9052815be6039327148f07d98514 (patch) | |
| tree | 447823de690c54e623e193bde82eef2b4d505f07 | |
| parent | 7adf192606f72f1efe2ad517df8b919902bf12a5 (diff) | |
add new condition on po
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 4 | ||||
| -rwxr-xr-x | indoteknik_custom/views/purchase_order.xml | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 9388ae4c..0e39d12a 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -74,6 +74,7 @@ class PurchaseOrder(models.Model): approve_by = fields.Many2one('res.users', string='Approve By') exclude_incoming = fields.Boolean(string='Exclude Incoming', default=False, help='Centang jika tidak mau masuk perhitungan Incoming Qty') + not_update_purchasepricelist = fields.Boolean(string='Not Update Purchase Pricelist?') def _compute_total_margin_match(self): for purchase in self: @@ -620,7 +621,8 @@ class PurchaseOrder(models.Model): raise UserError("Tidak ada link dengan SO, harus approval Merchandise") send_email = False - self.add_product_to_pricelist() + if not self.not_update_purchasepricelist: + self.add_product_to_pricelist() for line in self.order_line: if not line.product_id.purchase_ok: raise UserError("Terdapat barang yang tidak bisa diproses") diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index 0e6b6792..d22c3b5c 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -41,6 +41,7 @@ </field> <field name="approval_status" position="after"> <field name="revisi_po"/> + <field name="not_update_purchasepricelist"/> </field> <field name="incoterm_id" position="after"> <field name="amount_total_without_service"/> |
