Odoo Ayuda

0
2 Answers
0
Avatar
--Hilar AK--
  Blog:-
        https://hilarlive.wordpress.com/
  StackOverflow:
        http://stackoverflow.com/users/7561347/burmese-pythis

Quora:
    

            https://www.quora.com/profile/Hilar-Ak-1

Experienced Odoo developer, Functional Consultant.



Hilar AK
29/05/18 07:12

you have to update values of one2many B using some format.

Have a look here one2many flags

0
Samo Arko
04/06/18 03:42

First of all if you have 2 o2m relations with the same data you should re evaluate your data model. But filling o2m fields is done like in Hilar link, but this copy paste from the odoo documentation sux when you don't know what you're doing!

So if you you want so fill the model on the "many" side you need a dict of values that you just pass to the field that has the relation on the "one" side of the relation.

# field with the o2m relation
relation_ids = fields.One2Many()

# filling the many model
relation_ids = [(0, 0, dict_of_values)]

# OR
relation_ids = [(0, 0, {'field1': self.value1, 'field2': value2})]  
Realizar una pregunta
Writer
Keep Informed
1 seguidor(es)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now