Hello,
I'm triying to set a default record name as a combination of 2 fields:
I have a table with 3 columns (just for the example):
- name
- start_date
- end_date
And I would want to have the name calculated with the following:
def _get_name(...):
element = self.browse(cr, uid, ids, context=context)
return '%s -> %s' % (element.start_date, element.end_date)_columns = {
'name': fields.function(_get_name, type='char'...)
...
}
How can I get that?
Thank you in advance
The problem here is I wasn't iterating on the element (which should be elements). A res list should also be declared as empty and append the custom name to this list with the record id.