コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4593 ビュー

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)

関連投稿 返信 ビュー 活動
2
10月 18
6209
0
11月 17
3602
2
12月 17
12916
1
10月 17
2769
0
2月 25
1077