From a1a8fd7033c3f7991767bec9c82a600afe07426d Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Mon, 29 Jul 2024 09:39:57 +0700 Subject: activate edit on purchase order sales match --- .../models/purchase_order_sales_match.py | 8 +++++++- indoteknik_custom/views/purchase_order.xml | 24 +++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/indoteknik_custom/models/purchase_order_sales_match.py b/indoteknik_custom/models/purchase_order_sales_match.py index d8b11481..78581409 100644 --- a/indoteknik_custom/models/purchase_order_sales_match.py +++ b/indoteknik_custom/models/purchase_order_sales_match.py @@ -20,4 +20,10 @@ class PurchaseOrderSalesMatch(models.Model): product_id = fields.Many2one('product.product', string='Product') qty_so = fields.Float(string='Qty SO') qty_po = fields.Float(string='Qty PO') - margin_so = fields.Float(string='Margin SO') \ No newline at end of file + margin_so = fields.Float(string='Margin SO') + + @api.onchange('sale_id') + def onchange_sale_id(self): + self.salesperson_id = self.sale_id.user_id.id + self.partner_id = self.sale_id.partner_id.id + self.partner_invoice_id = self.sale_id.partner_invoice_id.id \ No newline at end of file diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index 142c13d8..25b7787b 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -218,18 +218,18 @@ purchase.order.sales.matches.tree purchase.order.sales.match - - - - - - - - - - - - + + + + + + + + + + + + -- cgit v1.2.3