I want to select a few records in a tree view, then click a button
The click on the button should open a wizard and the selected records should be available into the wizard for a bit of editing
How can I acheve that ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to select a few records in a tree view, then click a button
The click on the button should open a wizard and the selected records should be available into the wizard for a bit of editing
How can I acheve that ?
Hi,
To get selected records in the button function, we can define the tree view as follows,
<record id="student_student_view_tree" model="ir.ui.view">
<field name="name">student.student.
<field name="model">student.student</
<field name="arch" type="xml">
<tree string="Student" edit="1">
<header>
<button type="object" string="Click me"
name="action_click_me"/>
</header>
<field name='roll_number'/>
<field name='number'/>
<field name="name" decoration-bf="1"/>
<field name="age"/>
<field name="email"/>
<field name='teacher'/>
<field name="grade"/>
<field name='state'/>
</tree>
</field>
</record>
Or we can inherit any treeview of the model and add the button in the header.
Here the button function action_click_me, we get the selected records in self.
We can get the selected records in tree view in (self._context.get('active_
Hope it helps,
Normally we do like this
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Agu 22
|
2237 | ||
|
2
Jul 25
|
25847 | ||
how to add values dynamically in selection fields?
Diselesaikan
|
|
4
Des 23
|
22239 | |
Dynamically change choices in selection fields
Diselesaikan
|
|
5
Jul 24
|
15590 | |
Load currnet record values when calling wizard
Diselesaikan
|
|
1
Des 22
|
3236 |