How to show a One2many field values multiple time in same form in Odoo.
It require to show the same value in multiple tab in a form but with different domain.
Is it possible to achieve this ? If not what is the best alternative for achieving the same ?
Any thought on this is appreciated !
It's way simple than you are thinking. You just have to create multiple one2many fields with different field names and add the domain according to your need.
draft_lines = fields.One2many('my_obj.obj', 'my_obj_id', domain=[('state', '=', 'draft')], 'Draft Lines')
confirmed_lines = fields.One2many('my_obj.obj', 'my_obj_id', domain=[('state', '=', 'confirm')], 'Confirmed Lines')
cancelled_lines = fields.One2many('my_obj.obj', 'my_obj_id', domain=[('state', '=', 'cancel')], 'Cancelled Lines')
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
|Asked: 8/21/16, 1:30 AM|
|Seen: 393 times|
|Last updated: 8/22/16, 1:53 AM|