1start_datetime = fields.Datetime('Start time', default=lambda self: fields.Datetime.now())
2
1$ git add requirements.txt
2$ git add my_module
3$ git commit -m "[IMP] my_module: automatically remove special chars in my_module.my_module name field"
4
1@api.model
2def create(self, values):
3 if 'name' in values:
4 values['name'] = unidecode(values['name'])
5 return super(my_module, self).create(values)
6
7def write(self, values):
8 if 'name' in values:
9 values['name'] = unidecode(values['name'])
10 return super(my_module, self).write(values)
11