Skip to content

Commit

Permalink
FIX: problem on automatic coding rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Oct 12, 2024
1 parent 2439322 commit 2e5135f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plm/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
5 changes: 3 additions & 2 deletions plm/models/plm_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion plm_auto_engcode/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
2 changes: 1 addition & 1 deletion plm_auto_engcode/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2e5135f

Please sign in to comment.