From 183bba3752c9928c87467650b1d5f1a1c8b76243 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 2 Feb 2021 09:59:26 +0100 Subject: [PATCH] product_usability: make seller_id a stored field, for those who want to display in tree view Add tracking on some fields --- product_usability/models/product_template.py | 33 +++++++------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/product_usability/models/product_template.py b/product_usability/models/product_template.py index 3b0c9b1..01d3458 100644 --- a/product_usability/models/product_template.py +++ b/product_usability/models/product_template.py @@ -14,25 +14,16 @@ class ProductTemplate(models.Model): # in v10, that field was defined in procurement_suggest, but we will # probably not port procurement_suggest because it is native in v14 seller_id = fields.Many2one( - 'res.partner', related='seller_ids.name', string='Main Supplier') + 'res.partner', related='seller_ids.name', store=True, + string='Main Supplier') -# name = fields.Char( -# track_visibility='onchange') - -# type = fields.Selection( -# track_visibility='onchange') - -# categ_id = fields.Many2one( -# track_visibility='onchange') - -# list_price = fields.Float( -# track_visibility='onchange') - -# sale_ok = fields.Boolean( -# track_visibility='onchange') - -# purchase_ok = fields.Boolean( -# track_visibility='onchange') - -# active = fields.Boolean( -# track_visibility='onchange') + # in v14, I noticed that the tracking of the fields of product.template + # are only shown in the form view of product.template, not in the form + # view of product.product + name = fields.Char(tracking=10) + categ_id = fields.Many2one(tracking=20) + type = fields.Selection(tracking=30) + list_price = fields.Float(tracking=40) + sale_ok = fields.Boolean(tracking=50) + purchase_ok = fields.Boolean(tracking=60) + active = fields.Boolean(tracking=70)