Permalink
Browse files

[IMP]improve the code

  • Loading branch information...
mba-odoo committed Feb 11, 2019
1 parent b6dd8c2 commit 37956ff2a42a340b0f652cba26bed0e4984c2d4f
@@ -506,10 +506,11 @@ def get_activity_data(self, res_model, domain):
res_id = group['res_id']
activity_type_id = group['activity_type_id'][0]
res_id_to_deadline[res_id] = group['date_deadline'] if (res_id not in res_id_to_deadline or group['date_deadline'] < res_id_to_deadline[res_id]) else res_id_to_deadline[res_id]
state = self._compute_state_from_date(group['date_deadline'], self.user_id.sudo().tz)
activity_data[res_id][activity_type_id] = {
'count': group['__count'],
'ids': group['ids'],
'state': self._compute_state_from_date(group['date_deadline'], self.user_id.sudo().tz),
'state': state,
'o_closest_deadline': group['date_deadline'],
}
activity_type_infos = []
@@ -19,11 +19,11 @@ var ActivityModel = BasicModel.extend({
* @returns {Object}
*/
get: function () {
var list = this._super.apply(this, arguments);
if (list && list.model === this.modelName && list.type === 'list') {
return _.extend(list, this.additionalData);
var result = this._super.apply(this, arguments);
if (result && result.model === this.modelName && result.type === 'list') {
return _.extend(result, this.additionalData);
}
return list;
return result;
},
/**
* @override

0 comments on commit 37956ff

Please sign in to comment.