Skip to Content
मेन्यू
This question has been flagged
2 Replies
4575 Views

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
Discard

have you tried using name_get function?

Author

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 Replies Views Activity
2
अक्तू॰ 18
6174
0
नव॰ 17
3592
2
दिस॰ 17
12902
1
अक्तू॰ 17
2768
0
फ़र॰ 25
1029