Odoo Help


How to read one2many in on_change [Closed]

on 8/9/13, 11:59 AM 1,709 views

The Question has been closed for reason: duplicate question

on 08/12/2013 18:06:39

I have some issues when trying to read a one2many with an on_change method with previous saved lines

lets say we have

onchange_analytic_account_ids(self, cr, uid, ids, analytic_account_ids)

when is a new line you are writing it will throw me something like this

[[0, False, {'account_analytic_id': 33, 'amount': 80, 'name': False}]]

I can handle that, but if there are lines saved before it will throw me something like this

[[0, False, {'account_analytic_id': 33, 'amount': 80, 'name': False}],[4, 2, False], [4, 3, False]]

The main problem is that if the user delete a previous saved line in the tree/form, the on_change method will still return them so there is no way to know what is the actual data of the tree/form while being edited.

so there is a proper way to read a one2many field in a on_change?




| 5 5 8
Bogotá, Colombia
Informatics engineer Industrial engineer
On 8/12/13, 6:06 PM

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.


Odoo Training Center

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

Test it now

Question tools

0 follower(s)


Asked: 8/9/13, 11:59 AM
Seen: 1709 times
Last updated: 3/16/15, 8:10 AM