Skip to Content
Menu
This question has been flagged
3129 Views

Hi, its possible to hide the "create/edit" option in timesheets widget dropdown list?? I know the modifiers 'no_create'; 'no_create_edit';... This modifiers works fine in xml but not works in js. 

The field is declarated in "addons/hr_timesheet_sheet/static/src/js/timesheet.js":

ORIGINAL CODE:

self.account_m2o = new instance.web.form.FieldMany2One(self.dfm, {

attrs: {

name: "account",

type: "many2one",

domain: [ ['type','in',['normal', 'contract']], ['state', '<>', 'close'], ['use_timesheets','=',1], ['id', 'not in', _.pluck(self.accounts, "account")], ],

context: { default_use_timesheets: 1, default_type: "contract", },

modifiers: '{"required": true},

});


I WANT THIS CODE:

self.account_m2o = new instance.web.form.FieldMany2One(self.dfm, {

attrs: { name: "account", type: "many2one",

domain: [ ['type','in',['normal', 'contract']], ['state', '<>', 'close'], ['use_timesheets','=',1], ['id', 'not in', _.pluck(self.accounts, "account")], ],

context: { default_use_timesheets: 1, default_type: "contract", },

modifiers: '{"required": true, "no_create_edit": true}',

}, });


Thanks regards!

Avatar
Discard