diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-05-23 02:11:28 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-05-23 02:11:28 +0000 |
| commit | 957004adc73e524667800457f3db9fb6793edeac (patch) | |
| tree | 1824b9ee589f2b54657ab75f539b2f7d02224e7c /indoteknik_custom/models/purchasing_job.py | |
| parent | 92b6da28414fed56732f86e1f04ea2fac3464d7d (diff) | |
| parent | 558130bbf48c33ddfa6080450c80bc8801a570f0 (diff) | |
Merged in CR/form-merchant (pull request #310)odoo-production
odoo quotation view & merchant view
Diffstat (limited to 'indoteknik_custom/models/purchasing_job.py')
| -rw-r--r-- | indoteknik_custom/models/purchasing_job.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchasing_job.py b/indoteknik_custom/models/purchasing_job.py index 902bc34b..ea2f46cb 100644 --- a/indoteknik_custom/models/purchasing_job.py +++ b/indoteknik_custom/models/purchasing_job.py @@ -25,6 +25,15 @@ class PurchasingJob(models.Model): ], string='APO?') purchase_representative_id = fields.Many2one('res.users', string="Purchase Representative", readonly=True) note = fields.Char(string="Note Detail") + date_po = fields.Datetime(string='Date PO', copy=False) + + def unlink(self): + # Example: Delete related records from the underlying model + underlying_records = self.env['purchasing.job'].search([ + ('product_id', 'in', self.mapped('product_id').ids) + ]) + underlying_records.unlink() + return super(PurchasingJob, self).unlink() def redirect_to_pjs(self): states = self.env['purchasing.job.state'].search([ @@ -56,8 +65,9 @@ class PurchasingJob(models.Model): pmp.action, max(pjs.status_apo::text) AS status_apo, max(pjs.note::text) AS note, + max(pjs.date_po::text) AS date_po, CASE - WHEN pmp.brand IN ('Tekiro', 'RYU', 'Rexco') THEN 27 + WHEN pmp.brand IN ('Tekiro', 'RYU', 'Rexco', 'RYU (Sparepart)') THEN 27 WHEN sub.vendor_id = 9688 THEN 397 WHEN sub.vendor_id = 35475 THEN 397 WHEN sub.vendor_id = 29712 THEN 397 |
