setup odoo server gitununut code example
Example 1: odoo.py odoo 14
@api.model
def create(self, values):
if 'name' in values:
values['name'] = unidecode(values['name'])
return super(my_module, self).create(values)
def write(self, values):
if 'name' in values:
values['name'] = unidecode(values['name'])
return super(my_module, self).write(values)
Example 2: odoo.py odoo 14
start_datetime = fields.Datetime('Start time', default=lambda self: fields.Datetime.now())