diff --git a/plm/models/ir_attachment.py b/plm/models/ir_attachment.py index 3c7f3ca0..6e93fec2 100755 --- a/plm/models/ir_attachment.py +++ b/plm/models/ir_attachment.py @@ -3253,7 +3253,11 @@ def GetCloneDocumentValues(self, args): new_product_attrs) else: # - out_attachment_value['engineering_code'] = f"{new_product_attrs['engineering_code']}-{self.env['ir.sequence'].next_by_code('ir.attachment.progress')}" + engineering_code = new_product_attrs.get('engineering_code','') + if engineering_code: + out_attachment_value['engineering_code'] = f"{engineering_code}-{self.env['ir.sequence'].next_by_code('ir.attachment.progress')}" + else: + out_attachment_value['engineering_code'] = f"{self.env['ir.sequence'].next_by_code('ir.attachment.progress')}" out_attachment_value['engineering_revision']=0 # _, exte = os.path.splitext(out_attachment_value['name']) diff --git a/plm/models/product_product.py b/plm/models/product_product.py index 75925725..8feaeae3 100755 --- a/plm/models/product_product.py +++ b/plm/models/product_product.py @@ -1754,6 +1754,11 @@ def open_template(self): 'domain': [('id', '=', self.product_tmpl_id.id)], 'context': {}} + @api.model + def getUuid(self): + param = self.env['ir.config_parameter'].sudo() + return param.get_param('database.uuid') + @api.model def createFromProps(self, productAttribute): out_product_produc_id = self.env['product.product']