当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - openerp editable form view popup

问题描述:

I am developing an OpenERP 7 addon. The module contains a custom product catalog which essentially consists of a OpenERP web custom widget with a bit of JavaScript.

From within my JavaScript code I would like to open the standard product.product form view in a popup window to let the user view - and also edit - the product data. The code that opens the form view popup is this:

var action = {

type: 'ir.actions.act_window',

res_model: 'product.product',

res_id: record.id,

view_mode: 'form',

view_type: 'form',

views: [[false, 'form']],

target: 'new',

context: {

},

};

instance.client.action_manager.do_action(action);

which works great except I get no action buttons anywhere in the dialog so users cannot click 'edit' to enter edit mode and later save their changes by clicking on 'done'. When I use

target: 'current',

instead everything works as expected, however this does disrupt the inteded way the addon is used (I would like users to be able to stay on the catalog view while checking out products).

Any way to have action buttons appear in popup views?

网友答案:

Add

flags : {
    action_buttons : true,
}

in your action definition, by doing so you`ll be able to see action buttons in dialog pop-up you want to show.

Enjoy !!!

分享给朋友:
您可能感兴趣的文章:
随机阅读: