From cf8581e99cdd711e48083f2c8806a8a548b4198a Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Mon, 11 Jun 2012 12:50:42 +0530 Subject: [PATCH 01/99] [ADD] directory structure for web addons bzr revid: rgaopenerp-20120611072042-r5lj4z6p3tqsonx8 --- addons/account/__openerp__.py | 6 ++++++ addons/account/static/src/js/account.js | 1 + addons/account/static/src/xml/account.xml | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 addons/account/static/src/js/account.js create mode 100644 addons/account/static/src/xml/account.xml diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index cd19c730a3f..6657ab7c7b5 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -128,6 +128,12 @@ module named account_voucher. "res_config_view.xml", "account_pre_install.yml" ], + 'js': [ + 'static/src/js/account.js', + ], + 'qweb' : [ + "static/src/xml/*", + ], 'demo_xml': [ 'demo/account_demo.xml', 'project/project_demo.xml', diff --git a/addons/account/static/src/js/account.js b/addons/account/static/src/js/account.js new file mode 100644 index 00000000000..a6f266b54e1 --- /dev/null +++ b/addons/account/static/src/js/account.js @@ -0,0 +1 @@ +console.log('loading account.....') diff --git a/addons/account/static/src/xml/account.xml b/addons/account/static/src/xml/account.xml new file mode 100644 index 00000000000..2e7dbc48ff6 --- /dev/null +++ b/addons/account/static/src/xml/account.xml @@ -0,0 +1,11 @@ + + + + + + + + + + From 2b229fa7aa43f01d957c56bc60f48a6ec8cbdc57 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Mon, 11 Jun 2012 14:56:19 +0530 Subject: [PATCH 02/99] [IMP] Extend ViewManagerAction to add fromview bzr revid: rgaopenerp-20120611092619-6l8h7atm43fimeg6 --- addons/account/static/src/xml/account.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/account/static/src/xml/account.xml b/addons/account/static/src/xml/account.xml index 2e7dbc48ff6..082e875239f 100644 --- a/addons/account/static/src/xml/account.xml +++ b/addons/account/static/src/xml/account.xml @@ -3,8 +3,9 @@ --> - - + + +
From 8b2beb7975a8fae12423a88e90dc62323daa8cfe Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Mon, 11 Jun 2012 15:14:44 +0530 Subject: [PATCH 03/99] [FIX] typo bzr revid: rgaopenerp-20120611094444-vhr01bggrza11hhe --- addons/account/static/src/xml/account.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/static/src/xml/account.xml b/addons/account/static/src/xml/account.xml index 082e875239f..388cd96f49b 100644 --- a/addons/account/static/src/xml/account.xml +++ b/addons/account/static/src/xml/account.xml @@ -5,7 +5,7 @@ -
+
test
From fb41245f7843bdedfea2e621698927b83c079c6b Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Tue, 12 Jun 2012 12:49:58 +0530 Subject: [PATCH 04/99] [IMP] added form view at header on list view bzr revid: rgaopenerp-20120612071958-2wlk6b4gek0xjc8v --- addons/account/account_view.xml | 36 ++++++++++++++++++----- addons/account/static/src/js/account.js | 20 ++++++++++++- addons/account/static/src/xml/account.xml | 9 ++++-- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 274a8993dc4..0a29167fa7a 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1139,6 +1139,22 @@ + + + account.move.line.form + account.move.line + form + + +
+ + + +
+ + + + +
+
+ +
From 7ab3d9962170b7f85076b8ebf4f40a5390d4215f Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Fri, 22 Jun 2012 14:47:17 +0530 Subject: [PATCH 12/99] [IMP] wizard view bzr revid: rgaopenerp-20120622091717-ryzukodk5n2irhe2 --- addons/account/account_view.xml | 2 +- addons/account/wizard/account_reconcile_view.xml | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b02f3d211fb..8c754533024 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -982,7 +982,7 @@

- +

diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml index 959c4ceddcf..2a8494e5923 100644 --- a/addons/account/wizard/account_reconcile_view.xml +++ b/addons/account/wizard/account_reconcile_view.xml @@ -9,17 +9,13 @@
-
- - - + - From 4647ff5b8fc155b06af19c95b468bc2ca5be52f3 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Wed, 27 Jun 2012 18:35:29 +0530 Subject: [PATCH 13/99] [IMP] create sql view(model) to fecth appropriate data from various tables, improve view as per mock-up specification bzr revid: rgaopenerp-20120627130529-5jonfjm2fkoh61vu --- addons/account/__init__.py | 1 + addons/account/__openerp__.py | 1 + addons/account/account_move_line_extended.py | 69 +++++++++++++++++++ addons/account/account_move_line_extended.xml | 31 +++++++++ addons/account/account_view.xml | 5 +- addons/account/static/src/css/account.css | 38 ++++++++++ addons/account/static/src/js/account.js | 5 +- addons/account/static/src/xml/account.xml | 13 +++- 8 files changed, 155 insertions(+), 8 deletions(-) create mode 100644 addons/account/account_move_line_extended.py create mode 100644 addons/account/account_move_line_extended.xml create mode 100644 addons/account/static/src/css/account.css diff --git a/addons/account/__init__.py b/addons/account/__init__.py index 90fbdb83980..3a2273379da 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -38,5 +38,6 @@ import company import res_currency import edi import res_config +import account_move_line_extended # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index aecc326f39c..59abf719a3c 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -68,6 +68,7 @@ module named account_voucher. 'wizard/account_period_close_view.xml', 'wizard/account_reconcile_view.xml', 'wizard/account_unreconcile_view.xml', + 'account_move_line_extended.xml', 'account_view.xml', 'account_report.xml', 'account_financial_report_data.xml', diff --git a/addons/account/account_move_line_extended.py b/addons/account/account_move_line_extended.py new file mode 100644 index 00000000000..b04d86284b6 --- /dev/null +++ b/addons/account/account_move_line_extended.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import tools +from osv import fields,osv + + +class account_move_partner_info(osv.osv): + _name = "account.move.partner.info" + _description = "All partner info related account move line" + _auto = False + + def _rec_progress(self, cr, uid, ids, prop, unknow_none, context=None): + #ToDo + res = {} + for id in ids: + res[id] = 50 + return res + + _columns = { + 'partner_id':fields.many2one('res.partner', 'Partner'), + 'last_reconciliation_date':fields.datetime('Last Reconciliation'), + 'latest_date' :fields.date('Latest Entry'), + 'followup_date': fields.date('Latest Follow-up'), + 'reconciliation_progress': fields.function(_rec_progress, string='Progress (%)', type='float') + + } + def init(self, cr): + tools.drop_view_if_exists(cr, 'analytic_entries_report') + cr.execute(""" + create or replace view account_move_partner_info as ( + SELECT p.id, p.id as partner_id, + max(p.last_reconciliation_date) as last_reconciliation_date, + max(l.date) as latest_date, + max(l.followup_date) as followup_date + FROM account_move_line as l INNER JOIN res_partner AS p ON (l.partner_id = p.id) + group by p.id + ) + """) +account_move_partner_info() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + + + +#SELECT p.id as partner_id, +# max(p.last_reconciliation_date) as last_reconciliation_date, +# max(l.date) as latest_date, +# max(l.followup_date) as followup_date +#From account_move_line as l INNER JOIN res_partner AS p ON (l.partner_id = p.id) +#group by p.id \ No newline at end of file diff --git a/addons/account/account_move_line_extended.xml b/addons/account/account_move_line_extended.xml new file mode 100644 index 00000000000..911c0d43f81 --- /dev/null +++ b/addons/account/account_move_line_extended.xml @@ -0,0 +1,31 @@ + + + + + account.move.partner.info.form + account.move.partner.info + form + + +
+

+ +

+
+
+
+
+
+
+
+
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 8c754533024..686d0a51e40 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -974,7 +974,7 @@ - + account.move.line.tree account.move.line diff --git a/addons/account/static/src/css/account.css b/addons/account/static/src/css/account.css new file mode 100644 index 00000000000..963c4391595 --- /dev/null +++ b/addons/account/static/src/css/account.css @@ -0,0 +1,38 @@ + +.openerp .oe_extended_form_view .oe_formview { + background-color: #eeeeee; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + border:2px solid; + } + +.openerp .oe_pager_m2o li { + display: inline-block; + height: 24px; + line-height: 24px; + padding: 0; + float: left; +} + +.openerp .oe_pager_m2o a { + padding: 0 8px; +} + +.openerp .oe_extended_form_view .oe_form_field:empty { + display: inline-block ; +} + +.openerp .oe_extended_form_view button { + margin-right: 10px +} + +.openerp .oe_extended_form_view .oe_button_container .oe_form_field{ + width: auto; + margin: 0px 10px 0px 10px; +} +.openerp .oe_extended_form_view .oe_button_container{ + display: inline-block ; + width:100%; + margin: 10px; +} \ No newline at end of file diff --git a/addons/account/static/src/js/account.js b/addons/account/static/src/js/account.js index a08866613d9..e4ca9ada55f 100644 --- a/addons/account/static/src/js/account.js +++ b/addons/account/static/src/js/account.js @@ -48,7 +48,8 @@ instance.account.extend_actionmanager = instance.web.ActionManager.include({ instance.account.extend_viewmanager = instance.web.ViewManagerAction.extend({ init: function(parent, action) { this._super.apply(this,arguments); - this.dataset_form = new instance.web.DataSetSearch(this, action.res_model, action.context, action.domain); + //Fix me: pass hard coded model name, find the way to fetch it from server + this.dataset_form = new instance.web.DataSetSearch(this, 'account.move.partner.info', action.context, action.domain); }, start : function(){ this._super() @@ -66,9 +67,7 @@ instance.account.extend_viewmanager = instance.web.ViewManagerAction.extend({ obj_from_view; view_id = this.action.extended_form_view_id[0] from_view = this.registry.get_object('form_clone'); - this.dataset_form.context.extended_from = true this.dataset_loaded = this.dataset_form.read_slice() - this.dataset_form.context.extended_from = false obj_from_view = new from_view(self, this.dataset_form, view_id, options={}); obj_from_view.template = 'ExtendedFormView' view_promise = obj_from_view.appendTo(this.$element.find('.oe_extended_form_view')) diff --git a/addons/account/static/src/xml/account.xml b/addons/account/static/src/xml/account.xml index 506d2c862dc..dba545b219a 100644 --- a/addons/account/static/src/xml/account.xml +++ b/addons/account/static/src/xml/account.xml @@ -14,7 +14,8 @@ - + +
- + + -
- - - - -
- - - - + + diff --git a/addons/account_followup/account_move_reconciliation.xml b/addons/account_followup/account_move_reconciliation.xml index 9759acc0c47..f27bf9207eb 100644 --- a/addons/account_followup/account_move_reconciliation.xml +++ b/addons/account_followup/account_move_reconciliation.xml @@ -6,11 +6,11 @@ account.move.reconciliation - + From a567a1fc5cd67823928dbb5273ac1c74cc9dcbed Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Tue, 7 Aug 2012 17:04:19 +0530 Subject: [PATCH 42/99] [FIX/IMP] fix indetantion and add css for pager button bzr revid: rgaopenerp-20120807113419-v11tltq2k1kcw66o --- .../account/account_move_reconciliation.xml | 46 ++++++++----------- addons/account/account_view.xml | 2 - .../src/css/account_move_reconciliation.css | 17 +++++++ .../src/js/account_move_reconciliation.js | 1 - 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/addons/account/account_move_reconciliation.xml b/addons/account/account_move_reconciliation.xml index bc0f1145594..96054d0548d 100644 --- a/addons/account/account_move_reconciliation.xml +++ b/addons/account/account_move_reconciliation.xml @@ -9,32 +9,26 @@
-

- Previous - Next - - (0 / 0) - -

- -
-
-
-
-
- -
- - - +

+ Previous + Next + + (0 / 0) +

+
+
+
+
+
+
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 3e1f2ac01cd..b6880dab90d 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1589,7 +1589,6 @@ tree,form - {'view_mode':True} @@ -1599,7 +1598,6 @@ form tree,form - [('partner_id.customer','=',True)] diff --git a/addons/account/static/src/css/account_move_reconciliation.css b/addons/account/static/src/css/account_move_reconciliation.css index a60d7c24788..2757227ac2d 100644 --- a/addons/account/static/src/css/account_move_reconciliation.css +++ b/addons/account/static/src/css/account_move_reconciliation.css @@ -11,6 +11,23 @@ margin: 2px; } +.openerp .oe_pager_button{ + float: left; + height: 22px; + line-height: 24px; + display: inline-block; + border: 1px solid #ababab; + color: #4c4c4c; + cursor: pointer; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 0 5px 0 5px; + margin: 0 2px 0 2px; + float: left; + border-right: 1px solid #ababab; +} + .openerp .oe_pager_m2o li { display: inline-block; height: 24px; diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index f6204c2e0d2..53d1b27f820 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -4,7 +4,6 @@ var _t = instance.web._t, instance.web.views.add('form_clone', 'instance.account.extend_form_view'); instance.web.form.tags.add('list_button','instance.account.list_button') instance.web.form.tags.add('btn_extend','instance.account.btn_extend') -instance.web.form.widgets.add('many2one_pager','instance.account.many2one_pager') instance.account.extend_viewmanager = instance.web.ViewManagerAction.include({ start : function(){ From 512f5a1bc5aa945877772352675f33a56b8e6ce4 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Tue, 7 Aug 2012 19:04:27 +0530 Subject: [PATCH 43/99] [REM] remove button widget bzr revid: rgaopenerp-20120807133427-kskuv8gtf72fdlwe --- .../account/account_move_reconciliation.xml | 4 +- .../src/js/account_move_reconciliation.js | 78 ++++++------------- .../account/wizard/account_reconcile_view.xml | 6 +- 3 files changed, 30 insertions(+), 58 deletions(-) diff --git a/addons/account/account_move_reconciliation.xml b/addons/account/account_move_reconciliation.xml index 96054d0548d..d98f929d05b 100644 --- a/addons/account/account_move_reconciliation.xml +++ b/addons/account/account_move_reconciliation.xml @@ -22,8 +22,8 @@
-
diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 53d1b27f820..8e21bb6e84d 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -2,8 +2,6 @@ openerp.account = function(instance) { var _t = instance.web._t, _lt = instance.web._lt; instance.web.views.add('form_clone', 'instance.account.extend_form_view'); -instance.web.form.tags.add('list_button','instance.account.list_button') -instance.web.form.tags.add('btn_extend','instance.account.btn_extend') instance.account.extend_viewmanager = instance.web.ViewManagerAction.include({ start : function(){ @@ -11,13 +9,6 @@ instance.account.extend_viewmanager = instance.web.ViewManagerAction.include({ if(this.action.context && this.action.context.extended_form_view_id) this.setup_exended_form_view(this) }, - on_mode_switch: function (view_type, no_store, options) { - self = this - self.list_loaded = $.when(this._super.apply(this, arguments)).then(function () { - if(self.action.context && self.action.context.extended_form_view_id) - self.list_view = self.views['list'] - }) - }, setup_exended_form_view: function(parent){ var self = this, from_view, @@ -45,51 +36,15 @@ instance.account.extend_form_view = instance.web.FormView.extend({ on_loaded: function(data) { this._super.apply(this,arguments); var self = this + this.$element.find(".oe_reconcile").on('click', this.do_reconcilation) this.$element.on('click','a[data-pager-action]',function() { var action = $(this).data('pager-action'); self.on_pager_action(action); }); }, - do_update_pager: function(hide_index) { - var index = hide_index ? '-' : this.dataset.index + 1; - this.$element.find('span.oe_pager_index_extend').html(index).end() - .find('span.oe_pager_count_extend').html(this.dataset.ids.length); - }, - on_pager_action: function(action) { + do_reconcilation:function(event){ var self = this - var viewmanager = self.getParent(); - viewmanager.action.domain = this.original_domain - $.when(this._super(action)).then(function() { - var id = self.get_fields_values().partner_id; - // apply domain on list - viewmanager.action.domain = (viewmanager.action.domain || []).concat([["partner_id", "=", id]]) - viewmanager.searchview.do_search() - }) - }, - }) - -instance.account.btn_extend = instance.web.form.WidgetButton.extend({ - on_click: function() { - var self = this; - this.force_disabled = true; - this.check_disable(); - this.execute_action().always(function() { - self.force_disabled = false; - self.check_disable(); - self.reload_view(); - }); - - }, - reload_view :function(){ - viewmanager = this.view.getParent().getParent() - viewmanager.inner_widget.list_view.controller.reload_content(); - }, -}) - -instance.account.list_button = instance.web.form.WidgetButton.extend({ - on_click: function() { - var self = this - var list_view = this.view.getParent().list_view.controller + var list_view = this.getParent().views['list'].controller ids = list_view.get_selected_ids() if (ids.length == 0) { instance.web.dialog($("
").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); @@ -101,7 +56,7 @@ instance.account.list_button = instance.web.form.WidgetButton.extend({ active_model: list_view.dataset.model }); self.rpc("/web/action/load", { - action_id: py.eval(this.node.attrs.name), + action_id: py.eval(event.target.name), context: additional_context }, function(result) { result.result.context = _.extend(result.result.context || {}, @@ -111,10 +66,27 @@ instance.account.list_button = instance.web.form.WidgetButton.extend({ self.do_action(result.result, function () { // reload view list_view.reload(); - self.getParent().reload() }); }); - } -}) - + + }, + do_update_pager: function(hide_index) { + var index = hide_index ? '-' : this.dataset.index + 1; + this.$element.find('span.oe_pager_index_extend').html(index).end() + .find('span.oe_pager_count_extend').html(this.dataset.ids.length); + }, + + on_pager_action: function(action) { + var self = this + var viewmanager = self.getParent(); + viewmanager.action.domain = this.original_domain + $.when(this._super(action)).then(function() { + var id = self.get_fields_values().partner_id; + // apply domain on list + viewmanager.action.domain = (viewmanager.action.domain || []).concat([["partner_id", "=", id]]) + viewmanager.searchview.do_search(); + }) + }, + }) + } diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml index 426eeeb4514..1b36394a7e0 100644 --- a/addons/account/wizard/account_reconcile_view.xml +++ b/addons/account/wizard/account_reconcile_view.xml @@ -14,9 +14,9 @@
-
From 085e20a23d85f749a765767ff53531c72a4c2842 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Wed, 8 Aug 2012 11:04:42 +0530 Subject: [PATCH 44/99] [REM/IMP] remove button from form view and improve css bzr revid: rgaopenerp-20120808053442-ljzf2wy1lmxsdslt --- .../account/account_move_reconciliation.xml | 4 +- .../src/css/account_move_reconciliation.css | 51 ++++++++++--------- .../src/js/account_move_reconciliation.js | 12 ++++- 3 files changed, 39 insertions(+), 28 deletions(-) diff --git a/addons/account/account_move_reconciliation.xml b/addons/account/account_move_reconciliation.xml index d98f929d05b..62ae504ab89 100644 --- a/addons/account/account_move_reconciliation.xml +++ b/addons/account/account_move_reconciliation.xml @@ -22,8 +22,8 @@
diff --git a/addons/account/static/src/css/account_move_reconciliation.css b/addons/account/static/src/css/account_move_reconciliation.css index 2757227ac2d..c087cde296e 100644 --- a/addons/account/static/src/css/account_move_reconciliation.css +++ b/addons/account/static/src/css/account_move_reconciliation.css @@ -25,45 +25,46 @@ padding: 0 5px 0 5px; margin: 0 2px 0 2px; float: left; - border-right: 1px solid #ababab; +} + +.openerp .oe_reconcile_button { + float: left; + display: inline-block; + background-color: #EFEFEF; + background-image: -moz-linear-gradient(center top , #EFEFEF, #D8D8D8); + border: 1px solid #ABABAB; + border-radius: 3px 3px 3px 3px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; + color: #404040; + display: inline-block; + font-size: 13px; + margin: 0 3px 0 3px; + padding: 3px 12px; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); } -.openerp .oe_pager_m2o li { - display: inline-block; - height: 24px; - line-height: 24px; - padding: 0; - float: left; +.openerp .oe_reconcile_button:hover { + background-color: #E3E3E3; + background-image: -moz-linear-gradient(center top , #E3E3E3, #F6F6F6); + box-shadow: none; } -.openerp .oe_pager_m2o a { - padding: 0 8px; +.openerp .oe_reconcile_button a:hover { + text-decoration: none } - .openerp .oe_extended_form_view .oe_form_field:empty { display: inline-block !important; } .openerp .oe_extended_form_view .oe_datepicker_root { - display: inline-block; - min-width: 100px; + display: inline-block; + min-width: 100px; } .openerp .oe_extended_form_view .oe_form_field { - width: auto; -} -.openerp .oe_extended_form_view button { - margin-right: 10px -} - -.openerp .oe_extended_form_view .oe_button_container .oe_form_field{ width: auto; - margin: 0px 10px 0px 10px; } -.openerp .oe_extended_form_view .oe_button_container{ - display: inline-block ; - width:100%; - margin: 10px; -} + .openerp .oe_extended_form_view .oe_form_field_progressbar.ui-progressbar { width: 200px !important; } \ No newline at end of file diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 8e21bb6e84d..b8435da7c9b 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -37,6 +37,7 @@ instance.account.extend_form_view = instance.web.FormView.extend({ this._super.apply(this,arguments); var self = this this.$element.find(".oe_reconcile").on('click', this.do_reconcilation) + this.$element.find(".oe_nothing_to_reconcile").on('click', this.do_nothing_to_reconcile) this.$element.on('click','a[data-pager-action]',function() { var action = $(this).data('pager-action'); self.on_pager_action(action); @@ -68,8 +69,17 @@ instance.account.extend_form_view = instance.web.FormView.extend({ list_view.reload(); }); }); - }, + + do_nothing_to_reconcile:function(event){ + self = this + this.dataset.call(event.target.name, [[self.datarecord.id], self.dataset.context]).then(function() { + self.dataset.read_slice().done(function(){ + self.on_pager_action(); + }); + }) + }, + do_update_pager: function(hide_index) { var index = hide_index ? '-' : this.dataset.index + 1; this.$element.find('span.oe_pager_index_extend').html(index).end() From 7b26f82778944a5955129fefe80bd675c57cff5a Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Wed, 8 Aug 2012 11:36:47 +0530 Subject: [PATCH 45/99] [IMP] imporve view (CSS) bzr revid: rgaopenerp-20120808060647-9pgjic3obic4wwrg --- .../static/src/css/account_move_reconciliation.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/account/static/src/css/account_move_reconciliation.css b/addons/account/static/src/css/account_move_reconciliation.css index c087cde296e..59861a66b68 100644 --- a/addons/account/static/src/css/account_move_reconciliation.css +++ b/addons/account/static/src/css/account_move_reconciliation.css @@ -11,7 +11,7 @@ margin: 2px; } -.openerp .oe_pager_button{ +.openerp .oe_pager_button { float: left; height: 22px; line-height: 24px; @@ -26,6 +26,9 @@ margin: 0 2px 0 2px; float: left; } +.openerp .oe_pager_button:hover{ + text-decoration:none !important; +} .openerp .oe_reconcile_button { float: left; @@ -35,16 +38,18 @@ border: 1px solid #ABABAB; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - color: #404040; + color: #4C4C4C !important; display: inline-block; font-size: 13px; margin: 0 3px 0 3px; padding: 3px 12px; + cursor: pointer; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); } .openerp .oe_reconcile_button:hover { + text-decoration:none !important; background-color: #E3E3E3; background-image: -moz-linear-gradient(center top , #E3E3E3, #F6F6F6); box-shadow: none; From fbddeaa021aa4d43f9b0248d73cc8722bda22e9c Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Wed, 8 Aug 2012 19:27:47 +0530 Subject: [PATCH 46/99] [IMP] impromve sql view for model, remove method for nothing to reconcile button bzr revid: rgaopenerp-20120808135747-vdi2wztvi9qprsus --- addons/account/__openerp__.py | 2 +- addons/account/account_move_reconciliation.py | 57 +++++++------------ addons/account/account_view.xml | 14 +---- .../src/js/account_move_reconciliation.js | 11 ++-- 4 files changed, 27 insertions(+), 57 deletions(-) diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 950ee2da895..0542c9fa79e 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -66,8 +66,8 @@ financial year and for preparation of vouchers there is a module named account_v 'wizard/account_period_close_view.xml', 'wizard/account_reconcile_view.xml', 'wizard/account_unreconcile_view.xml', - 'account_view.xml', 'account_move_reconciliation.xml', + 'account_view.xml', 'account_report.xml', 'account_financial_report_data.xml', 'wizard/account_report_common_view.xml', diff --git a/addons/account/account_move_reconciliation.py b/addons/account/account_move_reconciliation.py index 8dee6e98b22..f885214ec65 100644 --- a/addons/account/account_move_reconciliation.py +++ b/addons/account/account_move_reconciliation.py @@ -22,12 +22,9 @@ import tools from osv import fields,osv -class res_partner(osv.osv): - _inherit = 'res.partner' - _columns = { - 'partner_move_count': fields.integer('Partner move line count') - } -res_partner() +#1. Remove field from res.partner + +#4 remove get_unreconcile_entry method mange it with domain class account_move_line(osv.osv): _inherit = "account.move.line" @@ -49,53 +46,37 @@ class account_move_reconciliation(osv.osv): _auto = False def _rec_progress(self, cr, uid, ids, prop, unknow_none, context=None): + active_ids = context.get('active_ids', []) res = 0 - cr.execute("""SELECT partner_id, reconcile_id - FROM account_move_line WHERE state <> 'draft' - GROUP BY partner_id, reconcile_id""") - result = cr.fetchall() - partner_total = len(result) - partner_reconcile = len([ (x,y) for x, y in result if y == None ]) - if partner_total: - res = float(partner_total- partner_reconcile)/partner_total * 100 - + if active_ids: + total_records = self.search(cr, uid, [('id','in',active_ids)]) + total_reconcile = 0 + for record in self.read(cr, uid, total_records, ['reconcile_count'], context=context): + if record['reconcile_count'] > 0: + total_reconcile += 1 + res = float(total_reconcile)/len(total_records) * 100 res_all = {} for id in ids: res_all[id] = res return res_all - def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): - ids = super(account_move_reconciliation, self).search(cr, uid, args, offset, limit, order, context, count) - res = [] - for l in self.browse(cr, uid, ids, context=context): - if (not l.partner_move_count) or (l.move_lines_count >l.partner_move_count): - res.append(l.id) - return res - + _columns = { 'partner_id':fields.many2one('res.partner', 'Partner'), - 'last_reconciliation_date':fields.datetime('Last Reconciliation'), + 'last_reconciliation_date':fields.related('partner_id', 'last_reconciliation_date' ,type='datetime', relation='res.partner', string='Last Reconciliation'), 'latest_date' :fields.date('Latest Entry'), 'reconciliation_progress': fields.function(_rec_progress, string='Progress (%)', type='float'), - 'move_lines_count':fields.integer('Move Count'), - 'partner_move_count':fields.integer('Partner move line count'), + 'reconcile_count':fields.integer('Reconcile Count'), } - def skip_partner(self, cr, uid, ids, context): - res_partner = self.pool.get('res.partner') - for line in self.browse(cr, uid, ids, context=context): - res_partner.write(cr, uid, [line.id] ,{'partner_move_count':line.move_lines_count}) - def init(self, cr): tools.drop_view_if_exists(cr, 'account_move_reconciliation') cr.execute(""" CREATE or REPLACE VIEW account_move_reconciliation as ( - SELECT p.id, p.id as partner_id, - MAX(p.last_reconciliation_date) as last_reconciliation_date, - MAX(l.date) as latest_date, - COUNT(l.id) as move_lines_count, - MAX(p.partner_move_count) as partner_move_count - FROM account_move_line as l INNER JOIN res_partner AS p ON (l.partner_id = p.id) - GROUP by p.id + SELECT move_line.partner_id as id, move_line.partner_id, + MAX(move_line.date) as latest_date, + (select count(reconcile.id) from account_move_line as reconcile where reconcile.reconcile_id is not null and reconcile.partner_id = move_line.partner_id) as reconcile_count + FROM account_move_line as move_line where move_line.state <> 'draft' + GROUP by move_line.partner_id ) """) account_move_reconciliation() diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b6880dab90d..8f4089e5e2c 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1582,16 +1582,6 @@ - - Entries To Reconcile - account.move.line - form - tree,form - - - {'view_mode':True} - - Entries To Reconcile account.move.line @@ -1599,7 +1589,7 @@ tree,form [('partner_id.customer','=',True)] - + @@ -1609,7 +1599,7 @@ tree,form [('partner_id.supplier','=',True)] - + Date: Thu, 9 Aug 2012 12:20:42 +0530 Subject: [PATCH 47/99] [IMP] progress bar and reload formon destroy of reconcile wizard bzr revid: rgaopenerp-20120809065042-bl8tyauxovr07r2v --- addons/account/account_move_reconciliation.py | 16 +++++++--------- .../static/src/js/account_move_reconciliation.js | 10 ++++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/account/account_move_reconciliation.py b/addons/account/account_move_reconciliation.py index f885214ec65..eaf9d31f976 100644 --- a/addons/account/account_move_reconciliation.py +++ b/addons/account/account_move_reconciliation.py @@ -22,8 +22,6 @@ import tools from osv import fields,osv -#1. Remove field from res.partner - #4 remove get_unreconcile_entry method mange it with domain class account_move_line(osv.osv): @@ -50,11 +48,11 @@ class account_move_reconciliation(osv.osv): res = 0 if active_ids: total_records = self.search(cr, uid, [('id','in',active_ids)]) - total_reconcile = 0 - for record in self.read(cr, uid, total_records, ['reconcile_count'], context=context): - if record['reconcile_count'] > 0: - total_reconcile += 1 - res = float(total_reconcile)/len(total_records) * 100 + total_unreconcile = 0 + for record in self.read(cr, uid, total_records, ['unreconcile_count'], context=context): + if record['unreconcile_count'] > 0: + total_unreconcile += 1 + res = float(len(total_records) - total_unreconcile)/len(total_records) * 100 res_all = {} for id in ids: res_all[id] = res @@ -66,7 +64,7 @@ class account_move_reconciliation(osv.osv): 'last_reconciliation_date':fields.related('partner_id', 'last_reconciliation_date' ,type='datetime', relation='res.partner', string='Last Reconciliation'), 'latest_date' :fields.date('Latest Entry'), 'reconciliation_progress': fields.function(_rec_progress, string='Progress (%)', type='float'), - 'reconcile_count':fields.integer('Reconcile Count'), + 'unreconcile_count':fields.integer('Unreconcile Count'), } def init(self, cr): tools.drop_view_if_exists(cr, 'account_move_reconciliation') @@ -74,7 +72,7 @@ class account_move_reconciliation(osv.osv): CREATE or REPLACE VIEW account_move_reconciliation as ( SELECT move_line.partner_id as id, move_line.partner_id, MAX(move_line.date) as latest_date, - (select count(reconcile.id) from account_move_line as reconcile where reconcile.reconcile_id is not null and reconcile.partner_id = move_line.partner_id) as reconcile_count + (select count(unreconcile.id) from account_move_line as unreconcile where unreconcile.reconcile_id is null and unreconcile.partner_id = move_line.partner_id) as unreconcile_count FROM account_move_line as move_line where move_line.state <> 'draft' GROUP by move_line.partner_id ) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 03a41fef8a3..765a48af13b 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -68,15 +68,17 @@ instance.account.extend_form_view = instance.web.FormView.extend({ self.do_action(result.result, function () { // reload view list_view.reload(); + self.reload(); }); }); }, - do_nothing_to_reconcile:function(event){ - viewmanager = this.getParent(); + do_nothing_to_reconcile:function(){ this.dataset.ids = _.without(this.dataset.ids, this.datarecord.id) - viewmanager.action.context.active_ids = viewmanager.dataset_form.ids; - this.on_pager_action(); + // viewmanager = this.getParent(); + // viewmanager.action.context.active_ids = viewmanager.dataset_form.ids; + if (!_.isEmpty(this.dataset.ids)) + this.on_pager_action('first'); }, do_update_pager: function(hide_index) { From bd79baf8b39073b73ac5b4f50a8ddb382313bb5d Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Thu, 9 Aug 2012 14:47:47 +0530 Subject: [PATCH 48/99] [fix] inheretied view of account followup bzr revid: rgaopenerp-20120809091747-46o45ssfkmoh9shf --- .../account_move_reconciliation.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/addons/account_followup/account_move_reconciliation.py b/addons/account_followup/account_move_reconciliation.py index b185b9a7347..6370a4bbdca 100644 --- a/addons/account_followup/account_move_reconciliation.py +++ b/addons/account_followup/account_move_reconciliation.py @@ -12,16 +12,14 @@ class account_move_reconciliation(osv.osv): def init(self, cr): tools.drop_view_if_exists(cr, 'account_move_reconciliation') cr.execute(""" - CREATE or REPLACE VIEW account_move_reconciliation as ( - SELECT p.id, p.id as partner_id, - MAX(p.last_reconciliation_date) as last_reconciliation_date, - MAX(l.date) as latest_date, - COUNT(l.id) as move_lines_count, - MAX(p.partner_move_count) as partner_move_count, - MAX(l.followup_date) as followup_date, - MAX(l.followup_line_id) as max_followup_id - FROM account_move_line as l INNER JOIN res_partner AS p ON (l.partner_id = p.id) - GROUP by p.id + CREATE or REPLACE VIEW account_move_reconciliation as ( + SELECT move_line.partner_id as id, move_line.partner_id, + MAX(move_line.date) as latest_date, + MAX(move_line.followup_date) as followup_date, + MAX(move_line.followup_line_id) as max_followup_id, + (select count(unreconcile.id) from account_move_line as unreconcile where unreconcile.reconcile_id is null and unreconcile.partner_id = move_line.partner_id) as unreconcile_count + FROM account_move_line as move_line where move_line.state <> 'draft' + GROUP by move_line.partner_id ) """) account_move_reconciliation() \ No newline at end of file From 7f38e9b7486071829535622fea8cf00e36a4036c Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Mon, 13 Aug 2012 14:16:28 +0530 Subject: [PATCH 49/99] [REVIEW] account_voucher: reconcile/unreconcile button in bank statment line bzr revid: hmo@tinyerp.com-20120813084628-ohvzyadke3knlbq0 --- addons/account_voucher/account_voucher.py | 20 +++++++++---------- .../account_voucher/account_voucher_view.xml | 8 ++++++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 3979796b4ed..0c5ba8cf7ce 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1494,19 +1494,18 @@ account_bank_statement() class account_bank_statement_line(osv.osv): _inherit = 'account.bank.statement.line' - def bank_st_payment(self, cr, uid, ids, context): - record = record_id = False - for rec in self.browse(cr, uid, ids, context=context): - record_id = rec.voucher_id and rec.voucher_id .id or False - record = rec + def action_payment_reconcile(self, cr, uid, ids, context=None): + statement_id = ids[0] + statement = self.browse(cr, uid, statement_id, context=context) + voucher = statement.voucher_id or False + if voucher and voucher.state == 'posted': + return voucher.cancel_voucher(context=context) mod_obj = self.pool.get('ir.model.data') - if record and record.type == 'customer': + if voucher and voucher.type == 'customer': res = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form') else: res = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form') view_id = res and res[1] or False - context.update({'partner_id':record.partner_id.id, 'amount':record.amount}) - return { 'name': _('Payment Entry'), 'res_model': 'account.voucher', @@ -1515,10 +1514,9 @@ class account_bank_statement_line(osv.osv): 'target':'new', 'view_id':view_id, 'context': context, - 'res_id':record_id, + 'res_id':voucher and voucher.id or False, 'type': 'ir.actions.act_window' - } - + } def _amount_reconciled(self, cursor, user, ids, name, args, context=None): if not ids: diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index be91624755e..6d0658218eb 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -219,8 +219,12 @@ - - --> -
-
+ -
+
diff --git a/addons/account/static/src/css/account_move_reconciliation.css b/addons/account/static/src/css/account_move_reconciliation.css index 0cedec95f09..f4136a79ef4 100644 --- a/addons/account/static/src/css/account_move_reconciliation.css +++ b/addons/account/static/src/css/account_move_reconciliation.css @@ -73,7 +73,9 @@ .openerp .oe_extended_form_view .oe_form_field_progressbar.ui-progressbar { width: 200px !important; } - +.openerp .oe_extended_form_view div.oe_reconcile_row{ + margin-top:7px; +} .openerp .oe_list_content > tbody > tr > td > button.reconcile_btn { color: white; background-color: #8a89ba; diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 9a3af14f665..d91c6158d18 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1499,8 +1499,6 @@ class account_bank_statement_line(osv.osv): statement_id = ids[0] statement = self.browse(cr, uid, statement_id, context=context) voucher = statement.voucher_id or False - if voucher and voucher.state == 'posted': - return voucher.cancel_voucher(context=context) mod_obj = self.pool.get('ir.model.data') if voucher and voucher.type == 'customer': res = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form') @@ -1529,7 +1527,16 @@ class account_bank_statement_line(osv.osv): else: res[line.id] = 0.0 return res - + + def _is_reconciled(self, cr, uid, ids, name, args, context=None): + res = {} + for line in self.browse(cr, uid, ids, context=context): + if line.voucher_id and line.voucher_id.state == 'posted': + res[line.id] = True + else: + res[line.id] = False + return res + def _check_amount(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): if obj.voucher_id: @@ -1543,6 +1550,8 @@ class account_bank_statement_line(osv.osv): ] _columns = { + 'is_reconciled': fields.function(_is_reconciled, + string='Statement is reconciled?', type='boolean'), 'amount_reconciled': fields.function(_amount_reconciled, string='Amount reconciled', type='float'), 'voucher_id': fields.many2one('account.voucher', 'Payment'), diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index ddeba22d905..30dfe527d3b 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -217,7 +217,8 @@ --> - --> -
-
+
diff --git a/addons/account_followup/account_move_reconciliation.py b/addons/account_followup/account_move_reconciliation.py index 4345c921954..00ae40f3aa8 100644 --- a/addons/account_followup/account_move_reconciliation.py +++ b/addons/account_followup/account_move_reconciliation.py @@ -23,17 +23,28 @@ import tools class account_move_reconciliation(osv.osv): _inherit = 'account.move.reconciliation' + + def _get_followup(self, cr, uid, ids, field_name, arg, context=None): + result = {} + move_obj = self.pool.get("account.move.line") + for rec in self.browse(cr, uid, ids, context=context): + move_line_ids = move_obj.search(cr, uid, [('partner_id','=',rec.partner_id.id),('followup_date','=',rec.followup_date)], context=context) + move_line = move_line_ids and move_obj.browse(cr, uid, move_line_ids[0], context=context) or False + result[rec.id] = move_line and move_line.followup_line_id or False + return result + _columns = { 'followup_date': fields.date('Latest Follow-up'), - #'followup_id':fields.many2one('account_followup.followup.line', - # 'Max Follow Up Level' ) + 'followup_id':fields.function(_get_followup, type='many2one', relation='account_followup.followup.line', string='Max Follow Up Level') } def init(self, cr): tools.drop_view_if_exists(cr, 'account_move_reconciliation') cr.execute(""" CREATE or REPLACE VIEW account_move_reconciliation as ( - SELECT move_line.partner_id AS id, a.type AS type, move_line.partner_id AS partner_id, SUM(move_line.debit) AS debit, SUM(move_line.credit) AS credit, + SELECT move_line.partner_id AS id, a.type AS type, move_line.partner_id AS partner_id, + SUM(move_line.debit) AS debit, + SUM(move_line.credit) AS credit, MAX(move_line.date) AS latest_date, MIN(partner.last_reconciliation_date) AS last_reconciliation_date, MAX(move_line.followup_date) as followup_date diff --git a/addons/account_followup/account_move_reconciliation.xml b/addons/account_followup/account_move_reconciliation.xml index a3b8fa0dfdb..6ec70fd18a5 100644 --- a/addons/account_followup/account_move_reconciliation.xml +++ b/addons/account_followup/account_move_reconciliation.xml @@ -6,10 +6,10 @@ account.move.reconciliation - + From 20eb0a5e882878e792c2b7f1f713d0415e740542 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 29 Aug 2012 18:13:03 +0530 Subject: [PATCH 63/99] [FIX] account: refactor js of account_reconciliation bzr revid: hmo@tinyerp.com-20120829124303-8kw2jz4x4p2jr64u --- .../account/account_move_reconciliation.xml | 4 +- .../src/js/account_move_reconciliation.js | 59 +++++++++---------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/addons/account/account_move_reconciliation.xml b/addons/account/account_move_reconciliation.xml index 20e3ba1486c..e5ccb090988 100644 --- a/addons/account/account_move_reconciliation.xml +++ b/addons/account/account_move_reconciliation.xml @@ -36,7 +36,7 @@ - Entries To Reconcile + Reconcile Customer Entries account.move.line form tree,form @@ -45,7 +45,7 @@ - Entries To Reconcile + Reconcile Supplier Entries account.move.line form tree,form diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 03e6529ae9b..8339d7e2768 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -10,29 +10,20 @@ instance.account.extend_viewmanager = instance.web.ViewManagerAction.include({ this.setup_exended_form_view(this.action.context.extended_model, this.action.context.extended_view_id); }, setup_exended_form_view: function(view_model, view_id){ - var self = this, - from_view, - obj_from_view; + var self = this; from_view = this.registry.get_object('form_clone'); this.dataset_form = new instance.web.DataSetSearch(this, view_model, this.action.context, this.action.domain); - this.dataset_loaded = this.dataset_form.read_slice() - obj_from_view = new from_view(self, this.dataset_form, view_id, options={}); - obj_from_view.template = 'ExtendedFormView' - view_promise = obj_from_view.appendTo(this.$el.find('.oe_extended_form_view')) - $.when(view_promise, this.dataset_loaded).then(function() { - self.action.context.active_ids = self.dataset_form.ids; - if (!_.isEmpty(self.dataset_form.ids)) { - obj_from_view.on_pager_action('first') - } - }) + this.dataset_loaded = this.dataset_form.read_slice(); + obj_from_view = new from_view(self, self.dataset_form, view_id, options={}); + obj_from_view.template = 'ExtendedFormView'; + view_form = obj_from_view.appendTo(self.$el.find('.oe_extended_form_view')); + $.when(view_form, this.dataset_loaded).then(function() { + obj_from_view.post_action(); + }); } }) instance.account.extend_form_view = instance.web.FormView.extend({ - init :function(){ - this._super.apply(this,arguments); - this.original_domain = this.getParent().action.domain; - }, on_loaded: function(data) { this._super.apply(this,arguments); var self = this @@ -65,23 +56,32 @@ instance.account.extend_form_view = instance.web.FormView.extend({ result.result.flags = result.result.flags || {}; result.result.flags.new_window = true; self.do_action(result.result, function () { - // reload view - list_view.reload(); - self.reload(); + self.post_action(); }); }); }, + + post_action: function(){ + // hide if not records otherwise go next record + var self = this; + var viewmanager = this.getParent(); + this.dataset.read_slice().done(function(){ + if (_.isEmpty(self.dataset.ids)){ + self.$el.hide(); + viewmanager.action.context.next_partner_only = false; + viewmanager.searchview.do_search(); + } + else{ + self.on_pager_action('next'); + } + }); + }, do_nothing_to_reconcile:function(){ - var self = this - if (!_.isEmpty(this.dataset.ids)){ + var self = this; this.dataset.call(event.target.name, [[self.datarecord.id], self.dataset.context]).then(function() { - self.dataset.read_slice().done(function(){ - if (!_.isEmpty(self.dataset.ids)) - self.on_pager_action('first'); - }); - }) - } + self.post_action(); + }); }, do_update_pager: function(hide_index) { @@ -93,13 +93,10 @@ instance.account.extend_form_view = instance.web.FormView.extend({ on_pager_action: function(action) { var self = this var viewmanager = self.getParent(); - viewmanager.action.domain = this.original_domain $.when(this._super(action)).then(function() { var id = self.get_fields_values().partner_id; viewmanager.action.context.next_partner_only = true; viewmanager.action.context.partner_id = [id]; - // apply domain on list - //viewmanager.action.domain = (viewmanager.action.domain || []).concat([["partner_id", "=", id]]) viewmanager.searchview.do_search(); }) }, From ca603482093bd42788c7ee97e62b43272ce7f088 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 30 Aug 2012 16:09:54 +0530 Subject: [PATCH 64/99] [FIX] account: reconciliation wizard, improve calculattion of pert. bzr revid: hmo@tinyerp.com-20120830103954-mueab873pcunqjod --- addons/account/account_move_reconciliation.py | 33 ++++++++++++++++--- .../src/js/account_move_reconciliation.js | 7 ++-- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/addons/account/account_move_reconciliation.py b/addons/account/account_move_reconciliation.py index eb3eaf31458..a3f171fae7c 100644 --- a/addons/account/account_move_reconciliation.py +++ b/addons/account/account_move_reconciliation.py @@ -50,14 +50,37 @@ class account_move_reconciliation(osv.osv): def _rec_progress(self, cr, uid, ids, prop, unknow_none, context=None): res = {} - to_reconcile_ids = self.search(cr, uid, [], context=context) - to_reconcile = to_reconcile_ids and len(to_reconcile_ids) or 0 - today_reconcile_ids = self.search(cr, uid, [('last_reconciliation_date','=',time.strftime('%Y-%m-%d'))], context=context) - today_reconcile = today_reconcile_ids and len(today_reconcile_ids) or 0 + if context is None: + context = {} + ctx = dict(context) + ctx['next_partner_only'] = False + move_line_obj = self.pool.get("account.move.line") + + to_reconcile_ids = move_line_obj.search(cr, uid, [ + ('reconcile_id','=',False), + ('account_id.reconcile','=',True), + ('state','!=', 'draft'), + ('partner_id','!=', False), + '|', ('partner_id.last_reconciliation_date', '=', False),('partner_id.last_reconciliation_date','<',time.strftime('%Y-%m-%d 00:00:00')), + '|', ('debit', '>' ,0), ('credit', '>' ,0) + ], + context=ctx) + partner_ids = [] + for move_line in move_line_obj.browse(cr, uid, to_reconcile_ids, context=ctx): + partner = move_line.partner_id + if move_line.date > partner.last_reconciliation_date and partner.id not in partner_ids: + partner_ids.append(move_line.partner_id.id) + + to_reconcile = len(partner_ids) + today_reconciled_ids = self.pool.get('res.partner').search(cr, uid, [ + ('last_reconciliation_date','>=',time.strftime('%Y-%m-%d 00:00:00')), + ('last_reconciliation_date','<=',time.strftime('%Y-%m-%d 23:59:59')) + ], context=ctx) + today_reconciled = today_reconciled_ids and len(today_reconciled_ids) or 0 # total partners which reconciled today if to_reconcile < 0: reconciliation_progress = 100 else: - reconciliation_progress = (100 / (float( to_reconcile + today_reconcile) or 1.0)) * today_reconcile + reconciliation_progress = (100 / (float( to_reconcile + today_reconciled) or 1.0)) * today_reconciled for id in ids: res[id] = reconciliation_progress return res diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 8339d7e2768..0af38246f0f 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -67,12 +67,13 @@ instance.account.extend_form_view = instance.web.FormView.extend({ var viewmanager = this.getParent(); this.dataset.read_slice().done(function(){ if (_.isEmpty(self.dataset.ids)){ - self.$el.hide(); + viewmanager.action.context.next_partner_only = true; + /*self.$el.hide(); viewmanager.action.context.next_partner_only = false; - viewmanager.searchview.do_search(); + viewmanager.searchview.do_search();*/ } else{ - self.on_pager_action('next'); + self.on_pager_action('first'); } }); }, From 08db03bfa247a12913231216cf2d49c70dd90b5a Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 30 Aug 2012 17:40:41 +0530 Subject: [PATCH 65/99] [IMP] account: split in small functions bzr revid: hmo@tinyerp.com-20120830121041-pruspkwkav090foc --- addons/account/account_move_reconciliation.py | 31 ++++++++++++++----- .../src/js/account_move_reconciliation.js | 5 ++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/addons/account/account_move_reconciliation.py b/addons/account/account_move_reconciliation.py index a3f171fae7c..b89dbacf623 100644 --- a/addons/account/account_move_reconciliation.py +++ b/addons/account/account_move_reconciliation.py @@ -48,14 +48,13 @@ class account_move_reconciliation(osv.osv): return super(account_move_reconciliation, self).search(cr, uid, args, offset, limit, order, context=context, count=count) - def _rec_progress(self, cr, uid, ids, prop, unknow_none, context=None): - res = {} + + def _get_to_reconcile_partners(self, cr, uid, context=None): if context is None: context = {} ctx = dict(context) ctx['next_partner_only'] = False move_line_obj = self.pool.get("account.move.line") - to_reconcile_ids = move_line_obj.search(cr, uid, [ ('reconcile_id','=',False), ('account_id.reconcile','=',True), @@ -69,14 +68,30 @@ class account_move_reconciliation(osv.osv): for move_line in move_line_obj.browse(cr, uid, to_reconcile_ids, context=ctx): partner = move_line.partner_id if move_line.date > partner.last_reconciliation_date and partner.id not in partner_ids: - partner_ids.append(move_line.partner_id.id) + partner_ids.append(partner.id) + return len(partner_ids) - to_reconcile = len(partner_ids) + def _get_today_reconciled_partners(self, cr, uid, context=None): + if context is None: + context = {} + account_type = context.get("account_type", False) + supplier = False + customer = False + if account_type == 'payable': + supplier = True + else: + customer = True today_reconciled_ids = self.pool.get('res.partner').search(cr, uid, [ ('last_reconciliation_date','>=',time.strftime('%Y-%m-%d 00:00:00')), - ('last_reconciliation_date','<=',time.strftime('%Y-%m-%d 23:59:59')) - ], context=ctx) - today_reconciled = today_reconciled_ids and len(today_reconciled_ids) or 0 # total partners which reconciled today + ('last_reconciliation_date','<=',time.strftime('%Y-%m-%d 23:59:59')), + '|', ('supplier','=',supplier), ('customer','=',customer) + ], context=context) + return today_reconciled_ids and len(today_reconciled_ids) or 0 + + def _rec_progress(self, cr, uid, ids, prop, unknow_none, context=None): + res = {} + to_reconcile = self._get_to_reconcile_partners(cr, uid, context=context) + today_reconciled = self._get_today_reconciled_partners(cr, uid, context=context) if to_reconcile < 0: reconciliation_progress = 100 else: diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 0af38246f0f..9b5aacf28bf 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -86,7 +86,10 @@ instance.account.extend_form_view = instance.web.FormView.extend({ }, do_update_pager: function(hide_index) { - var index = hide_index ? '-' : this.dataset.index + 1; + var index = this.dataset.index + 1 + if (this.dataset.ids.length == 0) + index = 0; + index = hide_index ? '-' : index; this.$el.find('span.oe_pager_index_extend').html(index).end() .find('span.oe_pager_count_extend').html(this.dataset.ids.length); }, From 6461c5e31f18fd1fa7352b95cb7bbf46567a94c8 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 30 Aug 2012 18:56:29 +0530 Subject: [PATCH 66/99] [FIX] account: rector js of account reconcilation bzr revid: hmo@tinyerp.com-20120830132629-72mnqvtwespvik0b --- .../src/js/account_move_reconciliation.js | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 9b5aacf28bf..8196779fa1d 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -18,7 +18,7 @@ instance.account.extend_viewmanager = instance.web.ViewManagerAction.include({ obj_from_view.template = 'ExtendedFormView'; view_form = obj_from_view.appendTo(self.$el.find('.oe_extended_form_view')); $.when(view_form, this.dataset_loaded).then(function() { - obj_from_view.post_action(); + obj_from_view.on_pager_action('first'); }); } @@ -56,32 +56,20 @@ instance.account.extend_form_view = instance.web.FormView.extend({ result.result.flags = result.result.flags || {}; result.result.flags.new_window = true; self.do_action(result.result, function () { - self.post_action(); + self.dataset.read_slice().done(function(){ + self.on_pager_action('next'); + }); }); }); }, - post_action: function(){ - // hide if not records otherwise go next record - var self = this; - var viewmanager = this.getParent(); - this.dataset.read_slice().done(function(){ - if (_.isEmpty(self.dataset.ids)){ - viewmanager.action.context.next_partner_only = true; - /*self.$el.hide(); - viewmanager.action.context.next_partner_only = false; - viewmanager.searchview.do_search();*/ - } - else{ - self.on_pager_action('first'); - } - }); - }, - + do_nothing_to_reconcile:function(){ var self = this; this.dataset.call(event.target.name, [[self.datarecord.id], self.dataset.context]).then(function() { - self.post_action(); + self.dataset.read_slice().done(function(){ + self.on_pager_action('next'); + }); }); }, @@ -97,12 +85,21 @@ instance.account.extend_form_view = instance.web.FormView.extend({ on_pager_action: function(action) { var self = this var viewmanager = self.getParent(); + viewmanager.action.context.next_partner_only = true; + //TODO: if no records, than it's not working, it giving error + if (this.dataset.ids.length == 0){ + self.dataset.index = null; + viewmanager.action.context.partner_id = []; + viewmanager.searchview.do_search(); + self.reload(); + return + } + $.when(this._super(action)).then(function() { var id = self.get_fields_values().partner_id; - viewmanager.action.context.next_partner_only = true; viewmanager.action.context.partner_id = [id]; viewmanager.searchview.do_search(); - }) + }); }, }) From f577f5b990622d6713cbbcc646f9245307402e53 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Fri, 31 Aug 2012 14:12:24 +0530 Subject: [PATCH 67/99] [FIX] account_followup: fix function of followup level bzr revid: hmo@tinyerp.com-20120831084224-y42jdzjf9arz54fh --- addons/account_followup/account_move_reconciliation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_followup/account_move_reconciliation.py b/addons/account_followup/account_move_reconciliation.py index 00ae40f3aa8..01338ddb6eb 100644 --- a/addons/account_followup/account_move_reconciliation.py +++ b/addons/account_followup/account_move_reconciliation.py @@ -30,7 +30,7 @@ class account_move_reconciliation(osv.osv): for rec in self.browse(cr, uid, ids, context=context): move_line_ids = move_obj.search(cr, uid, [('partner_id','=',rec.partner_id.id),('followup_date','=',rec.followup_date)], context=context) move_line = move_line_ids and move_obj.browse(cr, uid, move_line_ids[0], context=context) or False - result[rec.id] = move_line and move_line.followup_line_id or False + result[rec.id] = move_line and move_line.followup_line_id.id or False return result _columns = { From 432601cb7ec9f30629df0b290cccddf0a5a0c1ef Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 5 Sep 2012 13:21:20 +0530 Subject: [PATCH 68/99] [FIX] account: reconciliation form , set false if not data bzr revid: hmo@tinyerp.com-20120905075120-kcf31riknnaha8v0 --- .../src/js/account_move_reconciliation.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 8196779fa1d..3d046f99312 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -86,20 +86,22 @@ instance.account.extend_form_view = instance.web.FormView.extend({ var self = this var viewmanager = self.getParent(); viewmanager.action.context.next_partner_only = true; - //TODO: if no records, than it's not working, it giving error if (this.dataset.ids.length == 0){ - self.dataset.index = null; + self.datarecord = {} viewmanager.action.context.partner_id = []; viewmanager.searchview.do_search(); - self.reload(); - return + _(this.fields).each(function (field, f) { + field.set_value(self.datarecord[f] || false); + }); + self.do_update_pager(); + } + else{ + $.when(this._super(action)).then(function() { + var id = self.get_fields_values().partner_id; + viewmanager.action.context.partner_id = [id]; + viewmanager.searchview.do_search(); + }); } - - $.when(this._super(action)).then(function() { - var id = self.get_fields_values().partner_id; - viewmanager.action.context.partner_id = [id]; - viewmanager.searchview.do_search(); - }); }, }) From ef06a2d41a1e7a4c5e8c0269d60abacf69fb917d Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 5 Sep 2012 13:28:20 +0530 Subject: [PATCH 69/99] [REF] account: account reconciliation JS bzr revid: hmo@tinyerp.com-20120905075820-1uu55c972rmdhpjb --- .../static/src/js/account_move_reconciliation.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 3d046f99312..680eca18374 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -81,25 +81,28 @@ instance.account.extend_form_view = instance.web.FormView.extend({ this.$el.find('span.oe_pager_index_extend').html(index).end() .find('span.oe_pager_count_extend').html(this.dataset.ids.length); }, + + do_search_move_line: function(partner_ids){ + var viewmanager = this.getParent(); + viewmanager.action.context.next_partner_only = true; + viewmanager.action.context.partner_id = partner_ids; + viewmanager.searchview.do_search(); + }, on_pager_action: function(action) { var self = this - var viewmanager = self.getParent(); - viewmanager.action.context.next_partner_only = true; if (this.dataset.ids.length == 0){ self.datarecord = {} - viewmanager.action.context.partner_id = []; - viewmanager.searchview.do_search(); _(this.fields).each(function (field, f) { field.set_value(self.datarecord[f] || false); }); self.do_update_pager(); + self.do_search_move_line([]); } else{ $.when(this._super(action)).then(function() { var id = self.get_fields_values().partner_id; - viewmanager.action.context.partner_id = [id]; - viewmanager.searchview.do_search(); + self.do_search_move_line([id]); }); } }, From 031ccce1504e3d058a1855551543cfc6b724d2f9 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 5 Sep 2012 13:41:42 +0530 Subject: [PATCH 70/99] [FIX] account: account reconciliation JS, return false if not datarecord on click on reconciliation, nothing reconciliation buttons bzr revid: hmo@tinyerp.com-20120905081142-6zdw8cs919v0l0j8 --- .../account/static/src/js/account_move_reconciliation.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 680eca18374..88b263038b4 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -36,6 +36,9 @@ instance.account.extend_form_view = instance.web.FormView.extend({ }, do_reconcilation:function(event){ var self = this + if (!self.datarecord.id){ + return false; + } var list_view = this.getParent().views['list'].controller ids = list_view.get_selected_ids() if (ids.length == 0) { @@ -66,6 +69,9 @@ instance.account.extend_form_view = instance.web.FormView.extend({ do_nothing_to_reconcile:function(){ var self = this; + if (!self.datarecord.id){ + return false; + } this.dataset.call(event.target.name, [[self.datarecord.id], self.dataset.context]).then(function() { self.dataset.read_slice().done(function(){ self.on_pager_action('next'); @@ -91,6 +97,7 @@ instance.account.extend_form_view = instance.web.FormView.extend({ on_pager_action: function(action) { var self = this + if (this.dataset.ids.length == 0){ self.datarecord = {} _(this.fields).each(function (field, f) { From c1cbb42b0a917ccd565138f67c6f2fef3a15f8d1 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 5 Sep 2012 18:46:38 +0530 Subject: [PATCH 71/99] [FIX] account_voucher: open payment entry for bank statement bzr revid: hmo@tinyerp.com-20120905131638-6nwbwe3acaw0n1nn --- addons/account_voucher/account_voucher.py | 60 ++++++++----------- .../account_voucher/account_voucher_view.xml | 4 -- 2 files changed, 24 insertions(+), 40 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 91dfdfcf420..cb2e93705bb 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -334,9 +334,15 @@ class account_voucher(osv.osv): } def create(self, cr, uid, vals, context=None): - voucher = super(account_voucher, self).create(cr, uid, vals, context=context) - self.create_send_note(cr, uid, [voucher], context=context) - return voucher + if context is None: + context = {} + bank_line_id = context.get('bank_statement_line_id', False) + bank_line_obj = self.pool.get("account.bank.statement.line") + voucher_id = super(account_voucher, self).create(cr, uid, vals, context=context) + if bank_line_id: + bank_line_obj.write(cr, uid, bank_line_id, {'voucher_id': voucher_id}) + self.create_send_note(cr, uid, [voucher_id], context=context) + return voucher_id def compute_tax(self, cr, uid, ids, context=None): tax_pool = self.pool.get('account.tax') @@ -1496,49 +1502,31 @@ class account_bank_statement_line(osv.osv): _inherit = 'account.bank.statement.line' def action_payment_reconcile(self, cr, uid, ids, context=None): + if context is None: + context = {} + ctx = dict(context) statement_id = ids[0] statement = self.browse(cr, uid, statement_id, context=context) + ctx['bank_statement_line_id'] = statement.id + ctx.update({ + 'line_type': statement.type, + 'type': statement.amount > 0 and 'payment' or 'receipt', + 'partner_id': statement.partner_id and statement.partner_id.id or False, + 'journal_id': statement.statement_id.journal_id and statement.statement_id.journal_id.id or False, + 'amount': abs(statement.amount), + 'reference': statement.ref, + 'date': statement.date, + 'name': statement.name + }) voucher = statement.voucher_id or False voucher_id = voucher and voucher.id or False - if not voucher: - voucher_obj = self.pool.get('account.voucher') - sign = 1 - type = 'general' - ttype = statement.amount < 0 and 'payment' or 'receipt' - if statement.journal_id.type in ('sale', 'sale_refund'): - type = 'customer' - ttype = 'receipt' - elif statement.journal_id.type in ('purchase', 'purhcase_refund'): - type = 'supplier' - ttype = 'payment' - sign = -1 - - result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=statement.partner_id.id, journal_id=statement.journal_id.id, amount=sign*statement.amount, currency_id= False, ttype=ttype, date=statement.date, context=context) - voucher_res = { 'type': ttype, - 'name': statement.name, - 'partner_id': statement.partner_id.id, - 'journal_id': statement.journal_id.id, - 'account_id': result.get('account_id', statement.journal_id.default_credit_account_id.id), - 'company_id': statement.company_id.id, - 'date': statement.date, - 'amount': sign*statement.amount, - } - voucher_id = voucher_obj.create(cr, uid, voucher_res, context=context) - self.write(cr, uid, statement_id, {'voucher_id':voucher_id}, context=context) - mod_obj = self.pool.get('ir.model.data') - if voucher and voucher.type == 'customer': - res = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form') - else: - res = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form') - view_id = res and res[1] or False return { 'name': _('Payment Entry'), 'res_model': 'account.voucher', 'view_type': 'form', 'view_mode': 'form', 'target':'new', - 'view_id':view_id, - 'context': context, + 'context': ctx, 'res_id':voucher_id, 'type': 'ir.actions.act_window' } diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 47a326e4f96..5577dceec82 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -213,10 +213,6 @@ - - +
- + +
From c63ac8ca5af5ed406a015f10230c37288d8b6ef7 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 21 Sep 2012 12:11:22 +0200 Subject: [PATCH 95/99] wip bzr revid: nicolas.vanhoren@openerp.com-20120921101122-0jnxba0u5qtogcmm --- addons/account/account_view.xml | 2 +- .../account/static/src/js/account_move_reconciliation.js | 8 ++++++++ .../static/src/xml/account_move_reconciliation.xml | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 27000d8c671..7ca424e6d1e 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1532,7 +1532,7 @@
- - + +
From 3a435b8b9ac5ae7284a7115f61001a821cc93917 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 21 Sep 2012 14:59:17 +0200 Subject: [PATCH 96/99] Added last reconciliation date bzr revid: nicolas.vanhoren@openerp.com-20120921125917-40q92ja21osaixrx --- .../static/src/css/account_move_reconciliation.css | 13 +++++++++++-- .../static/src/js/account_move_reconciliation.js | 11 +++++++++-- .../static/src/xml/account_move_reconciliation.xml | 8 ++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/addons/account/static/src/css/account_move_reconciliation.css b/addons/account/static/src/css/account_move_reconciliation.css index 10ad4f594a8..2b407226905 100644 --- a/addons/account/static/src/css/account_move_reconciliation.css +++ b/addons/account/static/src/css/account_move_reconciliation.css @@ -5,6 +5,15 @@ } .openerp .oe_account_reconciliation button { - margin-top: 3px; - margin-bottom: 3px; + margin: 3px; +} + +.openerp .oe_account_reconciliation>div { + display: table; + width: 100%; +} + +.openerp .oe_account_reconciliation>div>div { + display: table-cell; + width: 50%: } \ No newline at end of file diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index da4493c5f7d..435de03d289 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -63,8 +63,15 @@ openerp.account = function (instance) { }); }, search_by_partner: function() { - return this.old_search(new instance.web.CompoundDomain(this.last_domain, [["partner_id", "in", this.current_partner === null ? [] : - [this.partners[this.current_partner][0]] ]]), this.last_context, this.last_group_by); + var self = this; + return new instance.web.Model("res.partner").call("read", + [self.partners[self.current_partner][0], ["last_reconciliation_date"]]).pipe(function(res) { + self.last_reconciliation_date = + instance.web.format_value(res.last_reconciliation_date, {"type": "datetime"}, _t("Never")); + return self.old_search(new instance.web.CompoundDomain(self.last_domain, + [["partner_id", "in", self.current_partner === null ? [] : + [self.partners[self.current_partner][0]] ]]), self.last_context, self.last_group_by); + }); }, reconcile: function() { var self = this; diff --git a/addons/account/static/src/xml/account_move_reconciliation.xml b/addons/account/static/src/xml/account_move_reconciliation.xml index 48951dbb81c..e1804581cf1 100644 --- a/addons/account/static/src/xml/account_move_reconciliation.xml +++ b/addons/account/static/src/xml/account_move_reconciliation.xml @@ -1,6 +1,5 @@ - + @@ -10,9 +9,14 @@
+
+
+
+ Last Reconciliation Date: +
- Last Reconciliation Date: + Last Reconciliation:
From 14accccc1ee5e07e65cbc483ae94dc30da9b2db5 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 21 Sep 2012 15:08:16 +0200 Subject: [PATCH 98/99] fixed bug when there is nothing to show bzr revid: nicolas.vanhoren@openerp.com-20120921130816-j7hdewsxp3za3itx --- .../src/js/account_move_reconciliation.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 435de03d289..6b007e2f097 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -64,14 +64,22 @@ openerp.account = function (instance) { }, search_by_partner: function() { var self = this; - return new instance.web.Model("res.partner").call("read", - [self.partners[self.current_partner][0], ["last_reconciliation_date"]]).pipe(function(res) { - self.last_reconciliation_date = - instance.web.format_value(res.last_reconciliation_date, {"type": "datetime"}, _t("Never")); + var fct = function() { return self.old_search(new instance.web.CompoundDomain(self.last_domain, [["partner_id", "in", self.current_partner === null ? [] : [self.partners[self.current_partner][0]] ]]), self.last_context, self.last_group_by); - }); + }; + if (self.current_partner === null) { + self.last_reconciliation_date = _t("Never"); + return fct(); + } else { + return new instance.web.Model("res.partner").call("read", + [self.partners[self.current_partner][0], ["last_reconciliation_date"]]).pipe(function(res) { + self.last_reconciliation_date = + instance.web.format_value(res.last_reconciliation_date, {"type": "datetime"}, _t("Never")); + return fct(); + }); + } }, reconcile: function() { var self = this; From 76d14d08fa7210f6a438214922794d07418593a9 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 21 Sep 2012 15:30:16 +0200 Subject: [PATCH 99/99] put back filter bzr revid: nicolas.vanhoren@openerp.com-20120921133016-v006os3ecx6zuzra --- addons/account/account_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 7ca424e6d1e..27000d8c671 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1532,7 +1532,7 @@