Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4631 มุมมอง

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?

อวตาร
ละทิ้ง

have you tried using name_get function?

ผู้เขียน

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 ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 18
6249
0
พ.ย. 17
3625
multiple images with preview in products แก้ไขแล้ว
2
ธ.ค. 17
12944
1
ต.ค. 17
2783
0
ก.พ. 25
1124