diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-28 17:05:38 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-28 17:05:38 +0700 |
| commit | 5b5ad2f7dd3cfacde60ec57d46be45a309506784 (patch) | |
| tree | e56a6939251996162fb0dbaa760bc000cdbff972 | |
| parent | 8bbffd2729d003284ccef10bc00f246f14f4b23e (diff) | |
Add related field product category
| -rwxr-xr-x | indoteknik_custom/models/purchase_pricelist.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/views/purchase_pricelist.xml | 2 |
2 files changed, 3 insertions, 0 deletions
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 @@ <field name="arch" type="xml"> <tree> <field name="product_id"/> + <field name="product_categ_ids" string="Product Category"/> <field name="vendor_id"/> <field name="product_price"/> <field name="taxes_product_id"/> @@ -29,6 +30,7 @@ <group> <group> <field name="product_id"/> + <field name="product_categ_ids" string="Product Category" widget="many2many_tags"/> <field name="vendor_id" context="{'res_partner_search_mode': 'supplier'}"/> <field name="product_price"/> <field name="taxes_product_id"/> |
