diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2025-03-26 11:11:48 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2025-03-26 11:11:48 +0700 |
| commit | 4d2041d834a05692a17954a8968acde866379801 (patch) | |
| tree | ef4be6c5faea725fa488c19b35e64a5e61a11867 /indoteknik_custom/models/mrp_production.py | |
| parent | e4256fb981175c456c2033cde443f4f98d72747e (diff) | |
| parent | 659387826b7d4a8db4afac158065ca125d6d98a6 (diff) | |
Merge branch 'odoo-backup' into feature/feedback_bitehisp
Diffstat (limited to 'indoteknik_custom/models/mrp_production.py')
| -rw-r--r-- | indoteknik_custom/models/mrp_production.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indoteknik_custom/models/mrp_production.py b/indoteknik_custom/models/mrp_production.py index 54d90256..0bf98702 100644 --- a/indoteknik_custom/models/mrp_production.py +++ b/indoteknik_custom/models/mrp_production.py @@ -6,5 +6,18 @@ class MrpProduction(models.Model): _inherit = 'mrp.production' desc = fields.Text(string='Description') - -
\ No newline at end of file + sale_order = fields.Many2one('sale.order', string='Sale Order', required=True, copy=False) + + def action_confirm(self): + """Override action_confirm untuk mengirim pesan ke Sale Order jika state berubah menjadi 'confirmed'.""" + if self._name != 'mrp.production': + return super(MrpProduction, self).action_confirm() + + result = super(MrpProduction, self).action_confirm() + + for record in self: + if record.sale_order and record.state == 'confirmed': + message = _("Manufacturing order telah dibuat dengan nomor %s") % (record.name) + record.sale_order.message_post(body=message) + + return result
\ No newline at end of file |
