diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-02 15:04:29 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-02 15:04:29 +0700 |
| commit | b559bcdf167ba24cbbcf978461fb774e8eda2f07 (patch) | |
| tree | 7d7cf06f9192bb1a940ebd48f8a3b6679ef3fb15 /indoteknik_custom/models/purchasing_job.py | |
| parent | 020f545e8214ce8a32f004f1b35e03a16cec1dfb (diff) | |
add note on purchasing job
Diffstat (limited to 'indoteknik_custom/models/purchasing_job.py')
| -rw-r--r-- | indoteknik_custom/models/purchasing_job.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchasing_job.py b/indoteknik_custom/models/purchasing_job.py index a4cb3893..1bbf68e3 100644 --- a/indoteknik_custom/models/purchasing_job.py +++ b/indoteknik_custom/models/purchasing_job.py @@ -24,6 +24,21 @@ class PurchasingJob(models.Model): ('apo', 'APO') ], string='APO?') purchase_representative_id = fields.Many2one('res.users', string="Purchase Representative", readonly=True, compute='compute_purchase_representative') + note = fields.Char(string="Note Detail") + + def redirect_to_pjs(self): + states = self.env['purchasing.job.state'].search([ + ('purchasing_job_id', '=', self.id), + ],limit=1, order='id desc') + + return { + 'name': _('Purchasing Job State'), + 'view_mode': 'form', + 'res_model': 'purchasing.job.state', + 'target': 'new', + 'type': 'ir.actions.act_window', + 'res_id': states.id, + } def compute_purchase_representative(self): for rec in self: @@ -54,7 +69,8 @@ class PurchasingJob(models.Model): MAX(pmp.incoming) AS incoming, MAX(pmp.outgoing) AS outgoing, pmp.action, - MAX(pjs.status_apo) AS status_apo + MAX(pjs.status_apo) AS status_apo, + MAX(pjs.note) AS note FROM v_procurement_monitoring_by_product pmp LEFT JOIN purchasing_job_state pjs ON pjs.purchasing_job_id = pmp.product_id LEFT JOIN ( |
