From 57717ac6e948ed9a4a148a9ccaf9b3d3ca563fa3 Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 15 Jan 2009 13:50:37 +0100 Subject: [PATCH] merged two similar features to centralize the invoice lines if possible. Kept the one on account_journal, removed on account_account bzr revid: qdp@tinyerp.com-20090115125037-o39g57ixptr4y7bd --- addons/account/account.py | 2 -- addons/account/account_view.xml | 1 - addons/account/invoice.py | 35 --------------------------------- 3 files changed, 38 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 790d9adc15c..0b2aa125a0a 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -289,8 +289,6 @@ class account_account(osv.osv): 'check_history': fields.boolean('Display History', help="Check this box if you want to print all entries when printing the General Ledger, "\ "otherwise it will only print its balance."), - 'merge_invoice': fields.boolean('Merge Invoice Entries',help="Check this box if you want that all lines of "\ - "a customer or supplier invoice using this account are created in one line only"), } def _default_company(self, cr, uid, context={}): diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 600114e90bd..41fc73ca29d 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -130,7 +130,6 @@ - diff --git a/addons/account/invoice.py b/addons/account/invoice.py index f6cccdcf2f0..c80cda3fe6d 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -431,7 +431,6 @@ class account_invoice(osv.osv): def action_move_create(self, cr, uid, ids, *args): ait_obj = self.pool.get('account.invoice.tax') cur_obj = self.pool.get('res.currency') - acc_obj = self.pool.get('account.account') self.button_compute(cr, uid, ids, context={}, set_total=False) for inv in self.browse(cr, uid, ids): if inv.move_id: @@ -479,11 +478,7 @@ class account_invoice(osv.osv): # create one move line for the total and possibly adjust the other lines amount total = 0 total_currency = 0 - key_line=[] for i in iml: - if 'account_id' in i and 'taxes' in i: - if not (i['account_id'],i['taxes']) in key_line: - key_line.append((i['account_id'],i['taxes'])) if inv.currency_id.id != company_currency: i['currency_id'] = inv.currency_id.id i['amount_currency'] = i['price'] @@ -504,36 +499,6 @@ class account_invoice(osv.osv): acc_id = inv.account_id.id name = inv['name'] or '/' - iml_temp=[] - move_list=[] - - for item in key_line: - move_temp={} - if acc_obj.browse(cr,uid,item[0]).merge_invoice: - repeat=False - for move_line in iml: - if (move_line.has_key('account_id') and move_line['account_id']==item[0]) and ('taxes' in move_line and move_line['taxes']==item[1]): - move_list.append(move_line) - if repeat: - for key in move_line: - if key in ['name','amount_currency','price_unit','price','quantity']: - if key=='name': - move_temp[key]=move_temp[key] + "," +move_line[key] - else: - move_temp[key] +=move_line[key] - else: - for key in move_line: - move_temp[key]=move_line[key] - repeat=True - if move_temp: - iml_temp.append(move_temp) - - if len(iml_temp)