From 112e96cc202bc46e7ec19e750316420a9a45f465 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 7 Sep 2012 18:52:42 +0530 Subject: [PATCH 001/168] [FIX]mrp_repair:set a proper attrs on button lp bug: https://launchpad.net/bugs/1047365 fixed bzr revid: mma@tinyerp.com-20120907132242-w9oabs4jecp3auo8 --- addons/mrp_repair/mrp_repair_view.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/mrp_repair_view.xml b/addons/mrp_repair/mrp_repair_view.xml index 55cbe49c75b..e343f5b25ce 100644 --- a/addons/mrp_repair/mrp_repair_view.xml +++ b/addons/mrp_repair/mrp_repair_view.xml @@ -34,8 +34,9 @@ From 4d9907ada9b65d52eb038efc0629e23260298b58 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 22 Oct 2012 19:03:54 +0530 Subject: [PATCH 073/168] [IMP] remove graph view mode in bank statement & coda statement bzr revid: fka@tinyerp.com-20121022133354-03g0z7se5tv4ngb1 --- .../account_bank_statement_view.xml | 2 +- addons/l10n_be_coda/l10n_be_coda_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_bank_statement_extensions/account_bank_statement_view.xml b/addons/account_bank_statement_extensions/account_bank_statement_view.xml index 9164c00373f..3d5560856a3 100644 --- a/addons/account_bank_statement_extensions/account_bank_statement_view.xml +++ b/addons/account_bank_statement_extensions/account_bank_statement_view.xml @@ -148,7 +148,7 @@ Bank Statement Lines account.bank.statement.line form - tree,graph,form + tree,form {'block_statement_line_delete' : 1} diff --git a/addons/l10n_be_coda/l10n_be_coda_view.xml b/addons/l10n_be_coda/l10n_be_coda_view.xml index 21db77466a0..d5067e7951a 100644 --- a/addons/l10n_be_coda/l10n_be_coda_view.xml +++ b/addons/l10n_be_coda/l10n_be_coda_view.xml @@ -473,7 +473,7 @@ CODA Statement Lines coda.bank.statement.line form - tree,graph,form + tree,form {'block_statement_line_delete' : 1} From 6239433a002dc17d72e2e9c9d0eae61507825027 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Tue, 23 Oct 2012 11:04:12 +0530 Subject: [PATCH 074/168] [IMP]improve code bzr revid: sgo@tinyerp.com-20121023053412-gpoxqj3jp55m65wu --- .../product_visible_discount/product_visible_discount.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index 48e3c4a8283..008c1f313a6 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -111,9 +111,11 @@ class account_invoice_line(osv.osv): if res_dict.get('item_id',False) and res_dict['item_id'].get(pricelist,False): item = res_dict['item_id'].get(pricelist,False) - item_base = item_obj.read(cr, uid, [item], ['base'])[0]['base'] - if item_base > 0: - field_name = price_type_obj.browse(cr, uid, item_base).field + item_read = item_obj.read(cr, uid, [item], ['base']) + if item_read: + item_base = item_read[0]['base'] + if item_base > 0: + field_name = price_type_obj.browse(cr, uid, item_base).field product = product_obj.browse(cr, uid, product_id, context) product_read = product_obj.read(cr, uid, product_id, [field_name], context=context) From 7f64cbd875e22d8feb1555cf886c00bb3163c072 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 23 Oct 2012 11:52:30 +0530 Subject: [PATCH 075/168] [IMP] remove date_start_date function field bzr revid: fka@tinyerp.com-20121023062230-l6941b0lt7qx4wzu --- addons/mrp_operations/mrp_operations.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 9f6671c3b2b..ffe0305d5f1 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -50,17 +50,6 @@ class stock_move(osv.osv): stock_move() class mrp_production_workcenter_line(osv.osv): - def _get_date_date(self, cr, uid, ids, field_name, arg, context=None): - """ Finds starting date. - @return: Dictionary of values. - """ - res={} - for op in self.browse(cr, uid, ids, context=context): - if op.date_start: - res[op.id] = op.date_start[:10] - else: - res[op.id]=False - return res def _get_date_end(self, cr, uid, ids, field_name, arg, context=None): """ Finds ending date. @@ -92,7 +81,6 @@ class mrp_production_workcenter_line(osv.osv): "* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pending' state.\n" \ "* When the user cancels the work order it will be set in 'Canceled' state.\n" \ "* When order is completely processed that time it is set in 'Finished' state."), - 'date_start_date': fields.function(_get_date_date, string='Start Date', type='date'), 'date_planned': fields.datetime('Scheduled Date', select=True), 'date_planned_end': fields.function(_get_date_end, string='End Date', type='datetime'), 'date_start': fields.datetime('Start Date'), From 1435e6faeb1fea4d5d973d5d06f4b78ec2622f0b Mon Sep 17 00:00:00 2001 From: Hardik Date: Tue, 23 Oct 2012 13:01:50 +0530 Subject: [PATCH 076/168] [IMP]Diagram view pager is working and display in header bzr revid: hsa@tinyerp.com-20121023073150-ozao4l0wca96cgmp --- addons/web_diagram/static/src/js/diagram.js | 75 ++++++++++++------- .../static/src/xml/base_diagram.xml | 13 ++-- 2 files changed, 55 insertions(+), 33 deletions(-) diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index d5a6e78f862..a85dff23032 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -22,6 +22,7 @@ instance.web.DiagramView = instance.web.View.extend({ this.context = {}; this.ids = this.dataset.ids; this.on('view_loaded', self, self.load_diagram); + this.on('pager_action_executed', self, self.pager_action_trigger); }, start: function() { var self = this; @@ -59,12 +60,7 @@ instance.web.DiagramView = instance.web.View.extend({ self.$el.find('.oe_diagram_header').append(html_label); }) - this.$el.find('div.oe_diagram_pager button[data-pager-action]').click(function() { - var action = $(this).data('pager-action'); - self.execute_pager_action(action); - }); - - this.do_update_pager(); + this.init_pager(); // New Node,Edge this.$el.find('#new_node.oe_diagram_button_new').click(function(){self.add_node();}); @@ -366,36 +362,61 @@ instance.web.DiagramView = instance.web.View.extend({ form_controller.fields[self.connectors.attrs.destination].dirty = true; }); }, - - execute_pager_action: function(action) { - switch (action) { - case 'first': - this.dataset.index = 0; - break; - case 'previous': - this.dataset.previous(); - break; - case 'next': - this.dataset.next(); - break; - case 'last': - this.dataset.index = this.dataset.ids.length - 1; - break; + do_hide: function () { + if (this.$pager) { + this.$pager.hide(); } + this._super(); + }, + init_pager: function() { + var self = this; + if (this.$pager) + this.$pager.remove(); + + this.$pager = $(QWeb.render("DiagramView.pager", {'widget':self})).hide(); + if (this.options.$pager) { + this.$pager.appendTo(this.options.$pager); + } else { + this.$el.find('.oe_diagram_pager').replaceWith(this.$pager); + } + this.$pager.on('click','a[data-pager-action]',function() { + var action = $(this).data('pager-action'); + self.execute_pager_action(action); + }); + this.do_update_pager(); + }, + pager_action_trigger: function(){ var loaded = this.dataset.read_index(_.keys(this.fields_view.fields)) .pipe(this.on_diagram_loaded); this.do_update_pager(); return loaded; }, + execute_pager_action: function(action) { + switch (action) { + case 'first': + this.dataset.index = 0; + break; + case 'previous': + this.dataset.previous(); + break; + case 'next': + this.dataset.next(); + break; + case 'last': + this.dataset.index = this.dataset.ids.length - 1; + break; + } + this.trigger('pager_action_executed'); + + }, do_update_pager: function(hide_index) { - var $pager = this.$el.find('div.oe_diagram_pager'); - var index = hide_index ? '-' : this.dataset.index + 1; - if(!this.dataset.count) { - this.dataset.count = this.dataset.ids.length; + this.$pager.toggle(this.dataset.ids.length > 1); + if (hide_index) { + $(".oe_diagram_pager_state", this.$pager).html(""); + } else { + $(".oe_diagram_pager_state", this.$pager).html(_.str.sprintf(_t("%d / %d"), this.dataset.index + 1, this.dataset.ids.length)); } - $pager.find('span.oe_pager_index').html(index); - $pager.find('span.oe_pager_count').html(this.dataset.count); }, do_show: function() { diff --git a/addons/web_diagram/static/src/xml/base_diagram.xml b/addons/web_diagram/static/src/xml/base_diagram.xml index 388092b3d23..54b06aafb27 100644 --- a/addons/web_diagram/static/src/xml/base_diagram.xml +++ b/addons/web_diagram/static/src/xml/base_diagram.xml @@ -1,18 +1,19 @@