summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/__manifest__.py1
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
-rw-r--r--indoteknik_custom/models/purchasing_job.py18
-rw-r--r--indoteknik_custom/models/purchasing_job_state.py2
-rw-r--r--indoteknik_custom/views/purchasing_job.xml8
-rw-r--r--indoteknik_custom/views/purchasing_job_state.xml17
6 files changed, 46 insertions, 4 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py
index 95c52fc9..1bfaa722 100755
--- a/indoteknik_custom/__manifest__.py
+++ b/indoteknik_custom/__manifest__.py
@@ -120,6 +120,7 @@
'views/role_permission/res_groups.xml',
'views/cust_commision.xml',
'views/stock_quant.xml',
+ 'views/purchasing_job_state.xml',
'report/report.xml',
'report/report_banner_banner.xml',
'report/report_banner_banner2.xml',
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")
diff --git a/indoteknik_custom/views/purchasing_job.xml b/indoteknik_custom/views/purchasing_job.xml
index bad4b938..8f9be1de 100644
--- a/indoteknik_custom/views/purchasing_job.xml
+++ b/indoteknik_custom/views/purchasing_job.xml
@@ -16,6 +16,7 @@
<field name="outgoing"/>
<field name="status_apo"/>
<field name="action"/>
+ <field name="note"/>
</tree>
</field>
</record>
@@ -25,6 +26,12 @@
<field name="model">v.purchasing.job</field>
<field name="arch" type="xml">
<form create="false" edit="false">
+ <header>
+ <button name="redirect_to_pjs"
+ string="Add Note!"
+ type="object"
+ />
+ </header>
<sheet>
<group>
<group>
@@ -39,6 +46,7 @@
<field name="incoming"/>
<field name="outgoing"/>
<field name="purchase_representative_id"/>
+ <field name="note"/>
</group>
</group>
</sheet>
diff --git a/indoteknik_custom/views/purchasing_job_state.xml b/indoteknik_custom/views/purchasing_job_state.xml
new file mode 100644
index 00000000..c7c40020
--- /dev/null
+++ b/indoteknik_custom/views/purchasing_job_state.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<odoo>
+ <record id="purchasing_job_state_form" model="ir.ui.view">
+ <field name="name">purchasing.job.state.form</field>
+ <field name="model">purchasing.job.state</field>
+ <field name="arch" type="xml">
+ <form>
+ <sheet>
+ <group>
+ <field name="status_apo" readonly="1"/>
+ <field name="note"/>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+</odoo> \ No newline at end of file