当我从java脚本代码中调用do\u action方法时,我没有得到action id。因此,当我刷新或重新加载页面时,我的表单是空白的。我用的是奥多11。
action_timesheet_user: function(event) {
var self = this;
event.stopPropagation();
event.preventDefault();
alert(self.employee_data.timesheet_action);
if (self.employee_data.uid == 1){
this.do_action({
name: _t("Timesheets"),
type: 'ir.actions.act_window',
res_model: 'account.analytic.line',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
//'search_default_employee_id': [self.employee_data.id],
'search_default_month': true,
},
target: 'current'
})}
else {
this.do_action({
name: _t("Timesheets"),
type: 'ir.actions.act_window',
res_model: 'account.analytic.line',
view_mode: 'tree,form',
view_type: 'form',
views: [[false, 'list'],[false, 'form']],
context: {
//'search_default_employee_id': [self.employee_data.uid],
'search_default_month': true,
},
domain: ['|','|',['user_id', '=', self.employee_data.uid],
['employee_id.department_id.manager_id.user_id', '=', self.employee_data.uid],
['project_id.user_id','in',[self.employee_data.uid]]],
target: 'current'
},{on_reverse_breadcrumb: function(){ return self.reload();}})}
},
events: _.extend({}, Widget.prototype.events, {'click .custom_helpdesk_tickets': 'action_custom_helpdesk_tickets'}),
在模板按钮上调用此函数后,我得到:
http://localhost:8069/web?#view_type=list&model=account.analytic.line
要求:
http://localhost:8069/web?debug#view_type=list&model=account.analytic.line&menu_id=458&action=487
提前谢谢。