From c0bf28534ed688fd6173a9dcfe29d7be930bb092 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 23 Jul 2015 01:01:27 +0200 Subject: [PATCH 1/2] [FIX] crm_claim: wrong many2one on claims report The field used for the report was different than the field used on the model the report is based uppon. As analyzed by jle. opw-645582 --- addons/crm_claim/report/crm_claim_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm_claim/report/crm_claim_report.py b/addons/crm_claim/report/crm_claim_report.py index ad56fa5e34e..bfc63565572 100644 --- a/addons/crm_claim/report/crm_claim_report.py +++ b/addons/crm_claim/report/crm_claim_report.py @@ -62,7 +62,7 @@ class crm_claim_report(osv.osv): 'create_date': fields.datetime('Create Date', readonly=True, select=True), 'day': fields.char('Day', size=128, readonly=True), 'delay_close': fields.float('Delay to close', digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"), - 'stage_id': fields.many2one ('crm.case.stage', 'Stage', readonly=True,domain="[('section_ids','=',section_id)]"), + 'stage_id': fields.many2one ('crm.claim.stage', 'Stage', readonly=True,domain="[('section_ids','=',section_id)]"), 'categ_id': fields.many2one('crm.case.categ', 'Category',\ domain="[('section_id','=',section_id),\ ('object_id.model', '=', 'crm.claim')]", readonly=True), From 0e151f7f32d8965bcaadc661b7e091490762b903 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 22 Jul 2015 16:03:19 +0200 Subject: [PATCH 2/2] [FIX] web_view_editor: javascript errors A jquery selector $('td[id^=]') may have been valid once uppon a time, but it cause error on current jquery versions. Also in some case when we want to add a field on a view, there may be a mess to detect the parent. opw-645557 --- addons/web_view_editor/static/src/js/view_editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js index 524c415d34a..de17c29799f 100644 --- a/addons/web_view_editor/static/src/js/view_editor.js +++ b/addons/web_view_editor/static/src/js/view_editor.js @@ -534,6 +534,8 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ var tr = self.get_object_by_id(this.one_object.clicked_tr_id, this.one_object['main_object'], [])[0].att_list[0]; var parent_tr = ($(side).prevAll("tr[level=" + String(this.one_object.clicked_tr_level - 1) + "]"))[0]; var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null); + if(_.isUndefined(parent_tr)) + return; parent_tr = self.get_object_by_id(parseInt($(parent_tr).attr('id').replace(/[^0-9]+/g, '')), this.one_object['main_object'], [])[0].att_list[0]; _.each([tr, parent_tr],function(element) { var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false; @@ -998,7 +1000,7 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ type_widget.set_value(node.value); self.add_widget.push(type_widget); }); - table_selector.find("td[id^=]").attr("width","100px"); + table_selector.find("td[id^='']").attr("width","100px"); self.add_node_dialog.$el.find('#new_field').click(function() { model_data = new instance.web.DataSetSearch(self,'ir.model', null, null); model_data.read_slice([], {domain: [['model','=', self.model]]}).done(function(result) {