Skip to content

Commit

Permalink
IMP: fix some backport plm_box
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Dec 15, 2024
1 parent 0042165 commit 9aec29f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plm/models/ir_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
5 changes: 5 additions & 0 deletions plm/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 9aec29f

Please sign in to comment.