Skip to content

Commit

Permalink
[IMP] use correct tree_view_id if defined in the action_id ; [IMP] an…
Browse files Browse the repository at this point in the history
…d name and category_id in the tile search view
  • Loading branch information
legalsylvain committed Oct 21, 2021
1 parent 0240989 commit ac41778
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
30 changes: 16 additions & 14 deletions web_dashboard_tile/models/tile_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,23 +334,25 @@ def _onchange_function(self):
# Action methods
@api.multi
def open_link(self):
res = {
if self.action_id:
action = self.action_id.read()[0]
else:
action = {
"view_type": "form",
"view_mode": "tree",
"view_id": False,
"res_model": self.model_id.model,
"type": "ir.actions.act_window",
"target": "current",
"domain": self.domain,
}
action.update({
"name": self.name,
"view_type": "form",
"view_mode": "tree",
"view_id": [False],
"res_model": self.model_id.model,
"type": "ir.actions.act_window",
"display_name": self.name,
"context": dict(self.env.context, group_by=False),
"nodestroy": True,
"target": "current",
"domain": self.domain,
}
if self.action_id:
res.update(
self.action_id.read(["view_type", "view_mode", "type"])[0]
)
return res
})
return action

@api.model
def add(self, vals):
Expand Down
2 changes: 2 additions & 0 deletions web_dashboard_tile/views/tile_tile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<field name="model">tile.tile</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="category_id"/>
<field name="model_id"/>
</search>
</field>
</record>
Expand Down

0 comments on commit ac41778

Please sign in to comment.