Hi,
I have two one2many fields from the same model that display as two list views in separate notebook pages in the form view. I need to merge these two list views into one list view and display in one notebook page rather than two separate notebook pages. The code is given below.
The two one2many fields ->
classlinks = fields.One2many('class.link', 'classmodel', readonly=True)
# classlinks displays all the links of the particular class in regard of the
class domain whether it is a sub class or the primary class.sub_class_links = fields.One2many('class.link', 'classmodel', compute='_compute_classlinks')
# sub_class_links displays the links of all the subclasses of the relevant primary class
This below method computes the class links of all the sub classes that is relevant to the primary
class and assign them to 'sub_class_links'.
def _compute_classlinks(self):
for record in self:
if record.class_domain == 'primary':
record.sub_class_links = record.sub_class.classlinks
The two notebook pages that display the classlinks and sub_class_links list views.
Thank you.