openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #22126
[Bug 1095561] Re: Clicking on create in Human Resources => Timetracking => My Current Timesheet traceback
Dear all,
I've found the problem.
Please check file..
addons/mail/static/src/js/mail_follower.js
see method:
display_subtypes:function (data) {
var self = this;
var subtype_list_ul = this.$('.oe_subtype_list');
subtype_list_ul.empty();
var records = data[this.view.datarecord.id || this.view.dataset.ids[0]].message_subtype_data;
var nb_subtype = 0;
_(records).each(function (record) {nb_subtype++;});
if (nb_subtype > 1) {
_(records).each(function (record, record_name) {
record.name = record_name;
record.followed = record.followed || undefined;
$(session.web.qweb.render('mail.followers.subtype', {'record': record})).appendTo( self.$('.oe_subtype_list') );
});
}
},
The problem happened each time we want to create a new record after see a record.
The main caused is because system can not get id from new record (because its a new one, right?)
then, I replace the code by adding an if clause like this.
display_subtypes:function (data) {
var self = this;
var subtype_list_ul = this.$('.oe_subtype_list');
subtype_list_ul.empty();
if (this.view.datarecord.id>0) {
var records = data[this.view.datarecord.id || this.view.dataset.ids[0]].message_subtype_data;
var nb_subtype = 0;
_(records).each(function (record) {nb_subtype++;});
if (nb_subtype > 1) {
_(records).each(function (record, record_name) {
record.name = record_name;
record.followed = record.followed || undefined;
$(session.web.qweb.render('mail.followers.subtype', {'record': record})).appendTo( self.$('.oe_subtype_list') );
});
}
}
},
logout and relogin..
It solve this problem...
Please correct me .
Thank you
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1095561
Title:
Clicking on create in Human Resources => Timetracking => My Current
Timesheet traceback
Status in OpenERP Addons (modules):
Confirmed
Bug description:
1. Clicking on create in Human Resources => Timetracking => My Current
Timesheet traceback
Uncaught TypeError: Cannot read property 'message_subtype_data' of
undefined
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1095561/+subscriptions
References