diff --git a/plm/__manifest__.py b/plm/__manifest__.py index 771b20ca..269fbce1 100644 --- a/plm/__manifest__.py +++ b/plm/__manifest__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "Product Lifecycle Management", - "version": "16.0.28", + "version": "16.0.29", "author": "OmniaSolutions", "website": "https://odooplm.omniasolutions.website", "category": "Manufacturing/Product Lifecycle Management (PLM)", diff --git a/plm/models/plm_mixin.py b/plm/models/plm_mixin.py index 3d78f201..b86fbba5 100644 --- a/plm/models/plm_mixin.py +++ b/plm/models/plm_mixin.py @@ -416,8 +416,9 @@ def write(self, vals): return super(RevisionBaseMixin, self).write(vals) def create(self, vals): - if 'engineering_code' in vals and vals['engineering_code'] not in [False, '-','']: - vals['engineering_code_editable']=False + for record_val in vals: + if 'engineering_code' in record_val and record_val['engineering_code'] not in [False, '-','']: + record_val['engineering_code_editable']=False return super(RevisionBaseMixin, self).create(vals) def get_display_notification(self, message): diff --git a/plm_auto_engcode/__manifest__.py b/plm_auto_engcode/__manifest__.py index 99283210..9f7ef70f 100644 --- a/plm_auto_engcode/__manifest__.py +++ b/plm_auto_engcode/__manifest__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "PLM Automatic Engineering Code", - "version": "16.0.1", + "version": "16.0.2", "author": "OmniaSolutions", "website": "https://odooplm.omniasolutions.website", "category": "Manufacturing/Product Lifecycle Management (PLM)", diff --git a/plm_auto_engcode/models/product_product.py b/plm_auto_engcode/models/product_product.py index 8d145c70..6467d68e 100755 --- a/plm_auto_engcode/models/product_product.py +++ b/plm_auto_engcode/models/product_product.py @@ -36,7 +36,7 @@ class pProductProduct(models.Model): @api.onchange("categ_id") def onchange_categ_id(self): - if self.engineering_code_editable: + if self.product_tmpl_id.engineering_code_editable: self.product_tmpl_id.engineering_code = self.product_tmpl_id._getNewCode() class ProductTemplate(models.Model):