From 5b5ad2f7dd3cfacde60ec57d46be45a309506784 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 28 Feb 2024 17:05:38 +0700 Subject: Add related field product category --- indoteknik_custom/models/purchase_pricelist.py | 1 + indoteknik_custom/views/purchase_pricelist.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py index d9c9a51d..e7a04927 100755 --- a/indoteknik_custom/models/purchase_pricelist.py +++ b/indoteknik_custom/models/purchase_pricelist.py @@ -9,6 +9,7 @@ class PurchasePricelist(models.Model): name = fields.Char(string='Name', compute="_compute_name") product_id = fields.Many2one('product.product', string="Product", required=True) + product_categ_ids = fields.Many2many('product.public.category', related="product_id.public_categ_ids") vendor_id = fields.Many2one('res.partner', string="Vendor", required=True) product_price = fields.Float(string='Human Price', required=True) system_price = fields.Float(string='System Price', readonly=True) diff --git a/indoteknik_custom/views/purchase_pricelist.xml b/indoteknik_custom/views/purchase_pricelist.xml index df379804..889fe2e0 100755 --- a/indoteknik_custom/views/purchase_pricelist.xml +++ b/indoteknik_custom/views/purchase_pricelist.xml @@ -6,6 +6,7 @@ + @@ -29,6 +30,7 @@ + -- cgit v1.2.3