summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-09-16 09:11:18 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-09-16 09:11:18 +0700
commitaf7fc5db50d7c3f78b70a2b75186db4b4c1f3674 (patch)
treea373827d750fcc0035c0b91a909b4d8b271c485e /indoteknik_custom/models/purchase_order.py
parentee9dab9b220b63e4c018a63aeea37a47895704ae (diff)
parent78a4f924fa9ba38c58954b5840632806b04fff19 (diff)
<Miqdad> merge
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 50913a80..98cf6ff1 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -66,7 +66,7 @@ class PurchaseOrder(models.Model):
sale_order = fields.Char(string='Sale Order')
matches_so = fields.Many2many('sale.order', string='Matches SO', compute='_compute_matches_so')
is_create_uangmuka = fields.Boolean(string='Uang Muka?')
- move_id = fields.Many2one('account.move', string='Journal Entries Uang Muka', domain=[('move_type', '=', 'entry')])
+ move_id = fields.Many2one('account.move', string='Journal Entries Uang Muka', domain=[('move_type', '=', 'entry')], copy=False)
logbook_bill_id = fields.Many2one('report.logbook.bill', string='Logbook Bill')
status_printed = fields.Selection([
('not_printed', 'Belum Print'),
@@ -1066,8 +1066,11 @@ class PurchaseOrder(models.Model):
# sticky=True
# )
+ has_bom = self.product_bom_id.id
+ has_manufacturing = self.manufacturing_id.id
+
if not self.from_apo:
- if not self.matches_so and not self.env.user.is_purchasing_manager and not self.env.user.is_leader:
+ if not self.matches_so and not self.env.user.is_purchasing_manager and not self.env.user.is_leader and not has_bom and not has_manufacturing:
raise UserError("Tidak ada link dengan SO, harus di confirm oleh Purchasing Manager")
send_email = False