Odoo 도움말

0

0
1 응답
0
Adan Cortes Medina Mexico
16. 11. 29. 오후 2:36

If you want to create one or more new records, issue a 0 command like this:

other_table_record1 = { 'field1': value11, 'field2': value12}
other_table_record2 = { 'field1': value21, 'field2': value22}
record_to_update = { 'some_field': 'value', ...
    'other_table_ids': [(0,0,other_table_record1),(0,0,other_table_record2)] # Must be a list, so keep the square brackets
}

So, in short:

  • 0 commands must be given as a list of triplets

  • In each triplet, the 1st element is 0 and 3rd element must be a dictionary


Reference: BaseModel write method in models.py (around line 3438)

질문하기
Writer
Keep Informed
1 팔로워
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