Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3365 Tampilan

how can i change the default behaviour - that for a custom module a click inside the tree should open the Detailview of this custom-Module within a popup/popin instead of full screen.


thanks für help

Avatar
Buang
Jawaban Terbai

try this

<act_window id="launch_bankbook_wizard"
name="Name of View"
res_model="model.name"
view_mode="tree"
target="new"
key2="client_action_multi"/>
Or

res = {
'type': 'ir.actions.act_window',
'name': ('Dummy'),
'res_model': 'sale.order.line',
'view_type': 'form',
'view_mode': 'tree,form',
'view_id': False,
'target': 'new',
'views': [(tree_id, 'tree'), (form_id, 'form')],
'context': {
'default_product_ids': [self.id]
}
}

Or


In your XML you have to add some thing like this:

<button name="open_sale_order_lines" string="Open Form" type="object">

And in your python:

def open_sale_order_lines(self,cr,uid,ids,context=None):

if context is None:

context = {}

sale_ids = self.pool.get('sale.order').search(cr,uid,[('project_id','=',context.get('search_default_project_id',False)),('partner_id','in',context.get('search_default_partner_id',False))])

names = [record.name for record in self.browse(cr, uid, ids, context=context)]

name = _('Sales Order Lines of %s') % ','.join(names)

return {

'type': 'ir.actions.act_window',

'name': name,

'view_type': 'form',

'view_mode': 'tree,form',

'context': context,

'domain' : [('order_id','in',sale_ids)],

'res_model': 'sale.order.line',

'nodestroy': True,

}

Try to learn from those useful links:

http://codeimplementer.blogspot.com/2013/10/create-active-window-popup-in-openerp.html

https://answers.launchpad.net/openobject-server/+question/178972

Regards.
Avatar
Buang
Penulis

i think your sample is from very old Version of odoo. we are using V12

It will helps you in version V12 too logic are same

Not working in my case. Seems like above code belongs to version 7 or 8

Jawaban Terbai

thanks for the awesome information.

Avatar
Buang