Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3995 Tampilan

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!

Avatar
Buang
Jawaban Terbai

hello  leon, 

please find code in Comment. 

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

Avatar
Buang

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
})

Post Terkait Replies Tampilan Aktivitas
1
Mei 20
3347
0
Feb 21
3745
0
Jan 21
3017
1
Feb 24
1463
0
Des 21
2755