Odoo Help

Welcome!

This community 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.

0

How to read one2many in on_change [Closed]

By
Felipe
on 8/9/13, 11:59 AM 1,111 views

The Question has been closed for reason: duplicate question

by
Felipe
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?

0

Felipe

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

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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