Skip to Content
Menu
This question has been flagged
1 Reply
1539 Views

I  want to make a standard product/s naming system. Odoo takes input creates name.
Item name would be Product name + Description + field + field 

example : 

Apple 11 inch MacBook Air , 4GB ram , 128GB hard drive


Avatar
Discard
Best Answer

You need to override the create method and concatenate the value of the fields to generate the product name.

@api.model
def create(self, vals):
name = vals.get('name') + ', ' + vals.get('field1', '') + ', ' + vals.get('field2', '')
vals.update({'name': name})
return super(myclass, self).create(vals)


Avatar
Discard
Author

Thanks!