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 | |
| parent | 020f545e8214ce8a32f004f1b35e03a16cec1dfb (diff) | |
add note on purchasing job
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/purchasing_job.py | 18 | ||||
| -rw-r--r-- | indoteknik_custom/models/purchasing_job_state.py | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index e572570e..8f107de1 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -53,8 +53,8 @@ class PurchaseOrder(models.Model): responsible_ids = fields.Many2many('res.users', string='Responsibles', compute='_compute_responsibles') status_paid_cbd = fields.Boolean(string='Paid Status', tracking=3, help='Field ini diisi secara manual oleh Finance AP dan hanya untuk status PO CBD') revisi_po = fields.Boolean(string='Revisi', tracking=3) - from_apo = fields.Boolean(string='From APO') - approval_edit_line = fields.Boolean(string='Approval Edit Line') + from_apo = fields.Boolean(string='From APO', tracking=3) + approval_edit_line = fields.Boolean(string='Approval Edit Line', tracking=3) def approve_edit_line(self): if self.env.user.is_purchasing_manager: 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 ( diff --git a/indoteknik_custom/models/purchasing_job_state.py b/indoteknik_custom/models/purchasing_job_state.py index 57fd3db2..1838a496 100644 --- a/indoteknik_custom/models/purchasing_job_state.py +++ b/indoteknik_custom/models/purchasing_job_state.py @@ -14,4 +14,4 @@ class PurchasingJobState(models.Model): ('not_apo', 'Belum APO'), ('apo', 'APO') ], string='APO?', copy=False) - + note = fields.Char(string="Note Detail") |
