diff --git a/addons/account/__init__.py b/addons/account/__init__.py index 3a2273379da..c5a3a154740 100644 --- a/addons/account/__init__.py +++ b/addons/account/__init__.py @@ -38,6 +38,6 @@ import company import res_currency import edi import res_config -import account_move_line_extended +import account_move_reconciliation # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index e136c75f9c4..0542c9fa79e 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -66,7 +66,7 @@ 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_move_line_extended.xml', + 'account_move_reconciliation.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_reconciliation.py similarity index 86% rename from addons/account/account_move_line_extended.py rename to addons/account/account_move_reconciliation.py index 9820f33ef15..f30fe9cb040 100644 --- a/addons/account/account_move_line_extended.py +++ b/addons/account/account_move_reconciliation.py @@ -50,8 +50,8 @@ class account_move_line(osv.osv): account_move_line(); -class account_move_partner_info(osv.osv): - _name = "account.move.partner.info" +class account_move_reconciliation(osv.osv): + _name = "account.move.reconciliation" _description = "All partner info related account move line" _auto = False @@ -72,7 +72,7 @@ class account_move_partner_info(osv.osv): return res_all def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): - ids = super(account_move_partner_info, self).search(cr, uid, args, offset, limit, order, context, count) + 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): @@ -93,17 +93,17 @@ class account_move_partner_info(osv.osv): 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_partner_info') + tools.drop_view_if_exists(cr, 'account_move_reconciliation') cr.execute(""" - create or replace view account_move_partner_info as ( + 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(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 + GROUP by p.id ) """) -account_move_partner_info() +account_move_reconciliation() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/account_move_line_extended.xml b/addons/account/account_move_reconciliation.xml similarity index 84% rename from addons/account/account_move_line_extended.xml rename to addons/account/account_move_reconciliation.xml index 8fcf518fc4c..162ddb6ce32 100644 --- a/addons/account/account_move_line_extended.xml +++ b/addons/account/account_move_reconciliation.xml @@ -1,9 +1,9 @@ - - account.move.partner.info.form - account.move.partner.info + + account.move.reconciliation.form + account.move.reconciliation form diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index c1a966db8cb..2356dbf2ac5 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1087,7 +1087,7 @@ tree - + @@ -1589,7 +1589,7 @@ tree,form - + {'view_mode':True} @@ -1599,7 +1599,7 @@ form tree,form - + [('partner_id.customer','=',True)] {'view_mode':True} @@ -1610,7 +1610,7 @@ form tree,form - + [('partner_id.supplier','=',True)] {'view_mode':True} diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index 5a6245e395d..646f187914b 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -55,7 +55,7 @@ instance.account.extend_viewmanager = instance.web.ViewManagerAction.extend({ init: function(parent, action) { this._super.apply(this, arguments); //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); + this.dataset_form = new instance.web.DataSetSearch(this, 'account.move.reconciliation', action.context, action.domain); }, start : function(){ this._super() diff --git a/addons/account_followup/__init__.py b/addons/account_followup/__init__.py index 4bfe3186298..395ce5475c8 100644 --- a/addons/account_followup/__init__.py +++ b/addons/account_followup/__init__.py @@ -22,5 +22,6 @@ import account_followup import wizard import report +import account_move_reconciliation # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py index e8724b01b4e..cfc8c39908f 100644 --- a/addons/account_followup/__openerp__.py +++ b/addons/account_followup/__openerp__.py @@ -58,6 +58,7 @@ entry, you can do from in the menu: 'report/account_followup_report.xml', 'account_followup_demo.xml', # Defined by default 'account_followup_view.xml', + 'account_move_reconciliation.xml', 'account_followup_data.xml', ], 'demo_xml': [], diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 4497a254c50..ad419736c57 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -76,31 +76,6 @@ class account_move_line(osv.osv): account_move_line() -class account_move_partner_info(osv.osv): - _inherit = 'account.move.partner.info' - _columns = { - 'followup_date': fields.date('Latest Follow-up'), - 'max_followup_id':fields.many2one('account_followup.followup.line', - 'Max Follow Up Level' ) - } - - def init(self, cr): - tools.drop_view_if_exists(cr, 'account_move_partner_info') - 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, - 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 - ) - """) -account_move_partner_info() - class res_company(osv.osv): _inherit = "res.company" _columns = { diff --git a/addons/account_followup/account_followup_view.xml b/addons/account_followup/account_followup_view.xml index 315f1ea5c0a..3d1d4333bbb 100644 --- a/addons/account_followup/account_followup_view.xml +++ b/addons/account_followup/account_followup_view.xml @@ -132,19 +132,6 @@ - - - account.move.partner.info.followup - account.move.partner.info - - - - account.move.line.tree.followup