From 92be65ef94249624c1d64156fea0668246d9d6de Mon Sep 17 00:00:00 2001 From: "luc.demeyer@noviat.com" Date: Sat, 17 Nov 2018 11:37:09 +0100 Subject: [PATCH] [10.0][FIX]readonly on hs_code products & categs --- product_harmonized_system/models/hs_code.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index 580c957..2efc7fc 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # © 2011-2016 Akretion (http://www.akretion.com) -# © 2009-2016 Noviat (http://www.noviat.com) +# © 2009-2018 Noviat (http://www.noviat.com) # @author Alexis de Lattre # @author Luc de Meyer # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -36,9 +36,15 @@ class HSCode(models.Model): default=lambda self: self.env['res.company']._company_default_get( 'hs.code')) product_categ_ids = fields.One2many( - 'product.category', 'hs_code_id', string='Product Categories') + comodel_name='product.category', + inverse_name='hs_code_id', + string='Product Categories', + readonly=True) product_tmpl_ids = fields.One2many( - 'product.template', 'hs_code_id', string='Products') + comodel_name='product.template', + inverse_name='hs_code_id', + string='Products', + readonly=True) @api.multi @api.depends('local_code')