I was unable to open the timesheet app. If user tries to enter the timesheet menu, below error occurs and the entire screen is unresponsive. I suspect that it might be due to me removing some custom fields last night... How can I fix this? Any help will be greatly appreciated!!
Traceback:
Error:
TypeError: this.fields[item.fieldName] is undefined
https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:1011
Traceback:
_prepareItem@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:1011:264
OdooClass.extend/</prototype[name]</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3538:488
_.forEach@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:12:566
init@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:1009:1283
OdooClass.extend/</prototype[name]</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3538:488
Class@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3539:65
_createGroupByMenu@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:926:221
start/<@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:899:448
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:681
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
add@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:797:471
then/</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:649
each@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:625:767
then/<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:560
Deferred@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:803:194
then@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:525
start@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:899:62
_widgetRenderAndInsert/<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3684:52
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:681
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
add@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:797:471
then/</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:649
each@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:625:767
then/<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:560
Deferred@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:803:194
then@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:525
_widgetRenderAndInsert@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3683:165
appendTo@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3674:97
_createSearchView@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:495:365
_executeWindowAction/<@https://packsmart.odoo.com/web/content/17726-dc6a184/web.assets_backend.js:502:49
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:681
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
fireWith@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:801:202
Deferred/</deferred[tuple[0]]@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:803:56
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:681
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
fireWith@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:801:202
Deferred/</deferred[tuple[0]]@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:803:56
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:681
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
fireWith@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:801:202
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:874
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
fireWith@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:801:202
Deferred/</deferred[tuple[0]]@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:803:56
genericJsonRpc/<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:3558:10
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:681
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
fireWith@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:801:202
then/</</<@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:802:874
fire@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:796:299
fireWith@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:801:202
done@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:1192:95
callback@https://packsmart.odoo.com/web/content/12313-a638e87/web.assets_common.js:1212:23
------------------------------------------------------------------------------------
I am not fluent in js,but I opened the web debuger and the error seems to happen here:
/* /web/static/src/js/views/search/groupby_menu.js defined in bundle 'web.assets_backend' */
odoo.define('web.GroupByMenu',function(require){"use strict";var config=require('web.config');var core=require('web.core');var DropdownMenu=require('web.DropdownMenu');var QWeb=core.qweb;var _t=core._t;var GROUPABLE_TYPES=['many2one','char','boolean','selection','date','datetime'];var DEFAULT_INTERVAL='month';var GroupByMenu=DropdownMenu.extend({events:_.extend({},DropdownMenu.prototype.events,{'click .o_add_custom_group':'_onAddCustomGroupClick','click button.o_apply_group':'_onButtonApplyClick','click .o_group_selector':'_onGroupSelectorClick',}),init:function(parent,groupbys,fields,options){var self=this;this.fields=fields;this.generatorMenuIsOpen=false;this.intervalOptions=[{description:_t('Day'),optionId:'day',groupId:1},{description:_t('Week'),optionId:'week',groupId:1},{description:_t('Month'),optionId:'month',groupId:1},{description:_t('Quarter'),optionId:'quarter',groupId:1},{description:_t('Year'),optionId:'year',groupId:1},];this.defaultOptionId=DEFAULT_INTERVAL;this.groupableFields=[];_.each(fields,function(field,name){if(field.sortable&&_.contains(GROUPABLE_TYPES,field.type)){self.groupableFields.push(_.extend({},field,{name:name,isDate:_.contains(['date','datetime'],field.type),}));}});this.groupableFields=_.sortBy(this.groupableFields,'string');_.each(groupbys,this._prepareItem.bind(this));this.presentedFields=_.filter(this.groupableFields,function(field){var groupByFields=_.pluck(groupbys,'fieldName');return!_.contains(groupByFields,field.name);});this.isMobile=config.device.isMobile;var style;if(options&&options.headerStyle==='primary'){style={el:{class:'btn-group o_graph_groupbys_menu o_dropdown',attrs:{'role':'group'}},mainButton:{class:'btn btn-primary dropdown-toggle'},};}
var dropdownHeader={category:'groupByCategory',title:_t('Group By'),icon:'fa fa-bars',symbol:this.isMobile?'fa fa-chevron-right float-right mt4':false,style:style,};this._super(parent,dropdownHeader,groupbys,options);},start:function(){this._super.apply(this,arguments);this.$menu.addClass('o_group_by_menu');var $generatorMenu=QWeb.render('GroupbyMenuGenerator',{widget:this});this.$menu.append($generatorMenu);this.$addCustomGroup=this.$menu.find('.o_add_custom_group');},_addGroupby:function(fieldName){var field=_.findWhere(this.groupableFields,{name:fieldName});var groupbyName=_.uniqueId('__groupby__');var groupby={itemId:groupbyName,description:field.string,fieldName:fieldName,groupId:_.uniqueId('__group__'),isActive:true,};var eventData=_.clone(groupby);this._prepareItem(groupby);if(groupby.hasOptions){groupby.defaultOptionId=DEFAULT_INTERVAL;groupby.currentOptionId=DEFAULT_INTERVAL;groupby.isDate=true;eventData.optionId=groupby.currentOptionId;eventData.isDate=true;}
this.items.push(groupby);var fieldIndex=this.presentedFields.indexOf(field);this.presentedFields.splice(fieldIndex,1);this._renderGeneratorMenu();this._renderMenuItems();this.trigger_up('new_groupby',eventData);},_prepareItem:function(item){if(_.contains(['date','datetime'],this.fields[item.fieldName].type)){item.options=this.intervalOptions;}
this._super.apply(this,arguments);},_renderGeneratorMenu:function(){this.$el.find('.o_generator_menu').remove();var $generatorMenu=QWeb.render('GroupbyMenuGenerator',{widget:this});this.$menu.append($generatorMenu);this.$addCustomGroup=this.$menu.find('.o_add_custom_group');this.$groupSelector=this.$menu.find('.o_group_selector');},_toggleCustomGroupMenu:function(){this.generatorMenuIsOpen=!this.generatorMenuIsOpen;this._renderGeneratorMenu();this.$addCustomGroup.attr('aria-expanded',this.generatorMenuIsOpen);if(this.generatorMenuIsOpen){this.$groupSelector.focus();}},_onAddCustomGroupClick:function(event){event.preventDefault();event.stopPropagation();this._toggleCustomGroupMenu();},_onBootstrapClose:function(){this._super.apply(this,arguments);this.generatorMenuIsOpen=false;this._renderGeneratorMenu();},_onButtonApplyClick:function(event){event.stopPropagation();var fieldName=this.$groupSelector.val();this._addGroupby(fieldName);this._toggleCustomGroupMenu();},_onGroupSelectorClick:function(event){event.stopPropagation();},});return GroupByMenu;});;