start_datetime = fields.Datetime('Start time', default=lambda self: fields.Datetime.now())
@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)
unidecode
from odoo import models, fields, api
'version': '0.2',
'version': '0.3',
$ git add requirements.txt
$ git add my_module
$ git commit -m "[IMP] my_module: automatically remove special chars in my_module.my_module name field"
$ git push https HEAD:feature-1
$ git push