Hi,
I have a model and a tree view defined for listing all the entrys. Now I want to have a button in this tree view and when I click on it a popup should be opened and show specific data from the entry that has been clicked on, similar to a tree view in a notebook page in the models form view.
This is my model:
class Paper(models.Model):
_name = 'paper_submission.paper'
_rec_name = "title"
title = fields.Char(string='Title', required='True')
review_ids = fields.One2many('paper_submission.review', 'paper_id', string='Reviews')
The tree view:
<record id="paper_submission_paper_tree" model="ir.ui.view">
<field name="name">Paper List View</field>
<field name="model">paper_submission.paper</field>
<field name="arch" type="xml">
<tree>
<field name="title"/>
<field name="state" invisible="1"/>
<button string="Assign Reviews" type="action" attrs="{'invisible': [('state','!=','submitted')]}"/>
</tree>
</field>
</record>
When I click on the button I want to have a popup tree view where I can create new reviews and list the currently available reviews like this:
<record id="paper_submission_assigned_review_tree" model="ir.ui.view">
<field name="name">Assigned Review Tree</field>
<field name="model">paper_submission.review</field>
<field name="arch" type="xml">
<tree create="true">
<field name="reviewer_id"/>
<field name="avg_grade"/>
</field>
</record>
How can I achieve this?