summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2025-04-14 16:50:07 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2025-04-14 16:50:07 +0700
commitb3e915fa8d2f280d76ca1afb19e729804aeed6e6 (patch)
tree3f728dfafc5ebbc597d42714faa5fcfaff8781d7 /indoteknik_custom/models/purchase_order.py
parent6eb0b48ad5c418f565efdf1a60d221a10465b0b8 (diff)
parent3e22bea62b4c57268ce777d34ec6d19aede8b0c1 (diff)
Merge branch 'odoo-backup' into feature/feedback_bitehisp
# Conflicts: # indoteknik_custom/security/ir.model.access.csv
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index d90c4a8a..b107f389 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -74,6 +74,7 @@ class PurchaseOrder(models.Model):
date_done_picking = fields.Datetime(string='Date Done Picking', compute='get_date_done')
bills_dp_id = fields.Many2one('account.move', string='Bills DP')
bills_pelunasan_id = fields.Many2one('account.move', string='Bills Pelunasan')
+ product_bom_id = fields.Many2one('product.product', string='Product Bom')
grand_total = fields.Monetary(string='Grand Total', help='Amount total + amount delivery', compute='_compute_grand_total')
total_margin_match = fields.Float(string='Total Margin Match', compute='_compute_total_margin_match')
approve_by = fields.Many2one('res.users', string='Approve By')
@@ -726,9 +727,25 @@ class PurchaseOrder(models.Model):
self.unlink_purchasing_job_state()
self._check_qty_plafon_product()
+ if self.product_bom_id:
+ self._remove_product_bom()
return res
+ def _remove_product_bom(self):
+ pj = self.env['v.purchasing.job'].search([
+ ('product_id', '=', self.product_bom_id.id)
+ ])
+
+ if pj:
+ pj_state = self.env['purchasing.job.state'].search([
+ ('purchasing_job_id', '=', pj.id)
+ ])
+
+ if pj_state:
+ pj_state.note = 'Product BOM Sudah Di PO'
+ pj_state.date_po = datetime.utcnow()
+
def check_ppn_mix(self):
reference_taxes = self.order_line[0].taxes_id