Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3853 Zobrazení

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
Zrušit
Nejlepší odpověď

hello  leon, 

please find code in Comment. 

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

Avatar
Zrušit

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

Related Posts Odpovědi Zobrazení Aktivita
1
kvě 20
3290
0
úno 21
3670
0
led 21
2939
1
úno 24
1359
0
pro 21
2598