Skip to Content
Menu
This question has been flagged
3660 Zobrazenia

Hi,

I'm trying to create a wizard that is called with a button called "Add Multiple Rows" which is added to the view. 

The wizard is used for populating rows inside a one2many field on parent form. So i tried to achieve this with python / xml but when i call the actual model's method for e.g. "update_lines" from the wizard's button function and set the values to the desired one2many field on parent form everything is ok until this point but if the user clicks DISCARD instead of SAVE the one2many fields lines are still added. The extra lines added from the wizard are not removed.

The reason for that when i set the values on "update_lines" function like;

self.desired_field = [(6, 0 , [old ids and new created ids])] 

or like

self.desired_field = [(0, 0, {'name' : 'test'})]

They both work and add lines to one2many but as i tried to explain before the lines are not removed when user clicks DISCARD.

Any information or trick is much appreciated.

Thanks

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
4
aug 20
18003
1
jún 24
442
0
júl 22
3699
1
feb 16
4867
1
mar 15
4727