Skip to Content
Menu
This question has been flagged
1 Reply
7031 Views

I want to click on a contact and open that record in the current window, rather than a popup.


I've gone through the code and it seems that the current window will be changed if two "variables" are found in the javascript that handles the kanban:

- oe_kanban_global_click_edit (this is a class in the XML) - OK

- routing - this is a value (with the URL to be loaded).


My question is, how can you define the "routing" in the kanban xml or... - much, much better -, is there any other way of telling the kanban view not to open a popup?

Avatar
Discard
Best Answer

There may be a better way but I've done this by creating a button that is invisible and the size of the kanban card.

Kanban View Definition - important items to note is the use of pointer-events: none (this disables the normal click) on the main div and then pointer-events:auto (this re-enables click events) on the button.

<templates> 
    <t t-name="kanban-box">
    <div class="o_kanban_record" style="pointer-events: none;">
        <button style="pointer-events:auto; position:absolute; width:100%; height:100%; background:none; border:none;" title="open" type="object" name="open_record"/>


Kanban Record Model Definition - as per normal kanban object buttons:

@api.multi 
def open_record(self):
    return {
        'type': 'ir.actions.act_window',
        'res_model': 'res.model',
        'name': 'Record name',
        'view_type': 'form',
        'view_mode': 'form',
        'res_id': self.id,
        'target': 'current',
    }



Avatar
Discard
Related Posts Replies Views Activity
1
Jul 17
6888
0
Mar 15
3342
0
Nov 24
68
2
Apr 24
2392
0
Nov 23
377