Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I created an onchange function that link some object lines to the current one
mo_lines_g1 = fields.One2many(comodel_name='object.order', inverse_name='mo_id1', copy=False )
@api.onchange('date') def change_date(self): if self.date:
g1=self.env['object.order'].search(['&'('date_order','>=',self.date),('date_order','<=',self.date)]) self.mo_lines_g1 = [(6,0, g1.ids )]
here everything is ok, but when I save the view, Odoo try to delete the linked lines from the object.order
so I tried to see what the write function send I found it send the old records :
vals[ 'mo_lines_g1'] = [[2, 61, False], [2, 62, False], [2, 63, False]]
normaly it must be :
vals['mo_lines_g1']= # or [(6,0,)]
any ideas ?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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
|Asked: 9/17/16, 7:03 AM|
|Seen: 243 times|
|Last updated: 9/20/16, 4:18 AM|