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

Hello,

How to pass values and create the record for all field names of model_a.py which is according to the selection field name line (via "Add a line" link) in one2many tree view in the form view of model_b.py via the wizard button?


Please help!

Thank you!

アバター
破棄
最善の回答

hello  leon, 

please find code in Comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

アバター
破棄

Try this,
*suppose line_ids is One2many fields in wizard
*order_line is One2many fields in model_b

def create_line(self):
vals = []
for line in self.line_ids
vals.append(
(0, 0, {'field_1': line.field_1.id, 'field_2': line.field_2})
)
model_b = self.env['model_b'].create({
'order_line': vals
})

関連投稿 返信 ビュー 活動
1
5月 20
3342
0
2月 21
3739
0
1月 21
3014
1
2月 24
1443
0
12月 21
2735