diff options
| -rwxr-xr-x | indoteknik_custom/models/sale_monitoring.py | 34 | ||||
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 8 | ||||
| -rwxr-xr-x | indoteknik_custom/views/purchase_order.xml | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_monitoring.xml | 8 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 1 |
5 files changed, 48 insertions, 5 deletions
diff --git a/indoteknik_custom/models/sale_monitoring.py b/indoteknik_custom/models/sale_monitoring.py index ad15e0c2..cac68b7c 100755 --- a/indoteknik_custom/models/sale_monitoring.py +++ b/indoteknik_custom/models/sale_monitoring.py @@ -21,12 +21,44 @@ class SaleMonitoring(models.Model): status = fields.Char(string="Status") po_number = fields.Char(string="PO Number") qty_reserved = fields.Integer(string="Qty Reserved") - note = fields.Char(string="Note", compute='compute_note') + note_so_line = fields.Selection([ + ('eta', 'ETA'), + ('info_sales', 'Info Sales'), + ('info_vendor', 'Info Vendor'), + ('penggabungan', 'Penggabungan'), + ], string="Note", compute='compute_note') + note = fields.Char(string="Note Detail", compute='compute_note_detail') + purchase_representative_id = fields.Many2one('res.users', string="Purchase Representative", readonly=True, compute='compute_purchase_representative') + + def compute_purchase_representative(self): + for sale in self: + po = self.env['purchase.order'].search([ + ('sale_order_id', '=', sale.sale_order_id.id), + ('user_id', '!=', False) + ]) + + user_id = False + + if po: + user_id = po[0].user_id + + sale.purchase_representative_id = user_id def compute_note(self): for sale in self: lines = self.env['sale.order.line'].search([ ('order_id', '=', sale.sale_order_id.id), + ('note', '!=', False) + ]) + + note = ', '.join(lines.mapped('note') or ['']) + + sale.note_so_line = note + + def compute_note_detail(self): + for sale in self: + lines = self.env['sale.order.line'].search([ + ('order_id', '=', sale.sale_order_id.id), ('note_procurement', '!=', False) ]) diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 69328325..d0985de5 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -18,7 +18,13 @@ class SaleOrderLine(models.Model): delivery_amt_line = fields.Float('DeliveryAmtLine', compute='compute_delivery_amt_line') fee_third_party_line = fields.Float('FeeThirdPartyLine', compute='compute_fee_third_party_line', default=0) line_no = fields.Integer('No', default=0, copy=False) - note_procurement = fields.Char(string='Note', help="Harap diisi jika ada keterangan tambahan dari Procurement, agar dapat dimonitoring") + note = fields.Selection([ + ('eta', 'ETA'), + ('info_sales', 'Info Sales'), + ('info_vendor', 'Info Vendor'), + ('penggabungan', 'Penggabungan'), + ], string='Note', help="Harap diisi jika ada keterangan tambahan dari Procurement, agar dapat dimonitoring") + note_procurement = fields.Char(string='Note Detail', help="Harap diisi jika ada keterangan tambahan dari Procurement, agar dapat dimonitoring") vendor_subtotal = fields.Float(string='Vendor Subtotal', compute="_compute_vendor_subtotal") amount_voucher_disc = fields.Float(string='Voucher Discount') diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index e0ec86f9..adcaaf43 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -37,7 +37,7 @@ <field name="currency_id" position="after"> <field name="summary_qty_po"/> <field name="count_line_product"/> - <field name="payment_term_id"/> + <field name="payment_term_id" required="1"/> </field> <field name="amount_total" position="after"> <field name="total_margin"/> diff --git a/indoteknik_custom/views/sale_monitoring.xml b/indoteknik_custom/views/sale_monitoring.xml index 5824af6a..207277af 100755 --- a/indoteknik_custom/views/sale_monitoring.xml +++ b/indoteknik_custom/views/sale_monitoring.xml @@ -18,6 +18,7 @@ <field name="qty_po_received"/> <field name="qty_so_delivered"/> <field name="qty_so_invoiced"/> + <field name="purchase_representative_id"/> <field name="status" widget="badge" decoration-danger="status == 'Belum/Kurang PO'" @@ -25,7 +26,8 @@ decoration-success="status == 'Siap kirim'" decoration-info="status == 'Delivered' or status == 'Invoiced'" /> - <field name="note"/> + <field name="note_so_line"/> + <field name="note" optional="hide"/> </tree> </field> </record> @@ -49,7 +51,8 @@ decoration-info="status == 'Delivered' or status == 'Invoiced'" /> <field name="po_number"/> - <field name="note"/> + <field name="note_so_line"/> + <field name="note" optional="hide"/> </group> <group> <field name="qty_so"/> @@ -58,6 +61,7 @@ <field name="qty_po_received"/> <field name="qty_so_delivered"/> <field name="qty_so_invoiced"/> + <field name="purchase_representative_id"/> </group> </group> </sheet> diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index e0e9ac54..a260c68a 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -92,6 +92,7 @@ "/> <field name="purchase_tax_id" attrs="{'readonly': [('parent.approval_status', '!=', False)]}" domain="[('type_tax_use','=','purchase')]"/> <field name="item_percent_margin"/> + <field name="note" optional="hide"/> <field name="note_procurement" optional="hide"/> <field name="vendor_subtotal" optional="hide"/> <field name="amount_voucher_disc" string="Voucher" readonly="1" optional="hide"/> |
