Skip to Content
Menú
This question has been flagged
2 Respostes
4608 Vistes

I want to concatenate multiple character fields in a single many2one field and access this in other module. How can we do this?

For example:- I have 5 character fields with different classes in a module and want to concatenate these 5 character fields in a single many2one field. Also I want access this many2one field in another module.

Can anyone help me out here?

Avatar
Descartar

have you tried using name_get function?

Autor

I have tried below code but it does not work for me:-

@api.depends()

def create(self, vals):

name = str(vals['field1'] or '') + ' ' +str(vals['field2'] or '') + ' ' +str(vals['field3'] or '') + ' ' +str(vals['field4'] or '')

vals['name'] = name

return super(sample_module, self).create(vals)

Related Posts Respostes Vistes Activitat
2
d’oct. 18
6241
0
de nov. 17
3614
2
de des. 17
12929
1
d’oct. 17
2771
0
de febr. 25
1116