From 031a79f52e3f587ec3b52d2526d07a0e9ce865d3 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Mon, 30 Aug 2010 11:58:31 +0530 Subject: [PATCH] [REF] Account bzr revid: jvo@tinyerp.com-20100830062831-ogdbungx8wavf0v7 --- addons/account/account_bank_statement.py | 3 +-- addons/account/installer.py | 2 +- addons/account/invoice.py | 28 ++++++++++++------------ addons/account/partner.py | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 32403f658fc..6d5a6ac470b 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -104,8 +104,7 @@ class account_bank_statement(osv.osv): periods = self.pool.get('account.period').find(cr, uid) if periods: return periods[0] - else: - return False + return False def _currency(self, cursor, user, ids, name, args, context=None): res = {} diff --git a/addons/account/installer.py b/addons/account/installer.py index a9872925321..54ef92b8fb9 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -84,7 +84,7 @@ class account_installer(osv.osv_memory): } def on_change_tax(self, cr, uid, id, tax): - return{'value':{'purchase_tax':tax}} + return {'value':{'purchase_tax':tax}} def on_change_start_date(self, cr, uid, id, start_date): if start_date: diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 4e1a5a052ec..601b856b5dd 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -455,9 +455,9 @@ class account_invoice(osv.osv): def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice): if not payment_term_id: return {} - res={} - pt_obj= self.pool.get('account.payment.term') - if not date_invoice : + res = {} + pt_obj = self.pool.get('account.payment.term') + if not date_invoice: date_invoice = time.strftime('%Y-%m-%d') pterm_list = pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice) @@ -465,7 +465,7 @@ class account_invoice(osv.osv): if pterm_list: pterm_list = [line[0] for line in pterm_list] pterm_list.sort() - res= {'value':{'date_due': pterm_list[-1]}} + res = {'value':{'date_due': pterm_list[-1]}} else: raise osv.except_osv(_('Data Insufficient !'), _('The Payment Term of Supplier does not have Payment Term Lines(Computation) defined !')) @@ -523,7 +523,7 @@ class account_invoice(osv.osv): obj_l = account_obj.browse(cr, uid, inv_line[2]['account_id']) if obj_l.company_id.id != company_id: raise osv.except_osv(_('Configuration Error !'), - _('invoice line account company is not match with invoice company.')) + _('Invoice line account company does not match with invoice company.')) else: continue if company_id and type: @@ -630,7 +630,7 @@ class account_invoice(osv.osv): context.update({'lang': partner.lang}) for taxe in ait_obj.compute(cr, uid, id, context=context).values(): ait_obj.create(cr, uid, taxe) - # Update the stored value (fields.function), so we write to trigger recompute + # Update the stored value (fields.function), so we write to trigger recompute self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=context) return True @@ -801,7 +801,7 @@ class account_invoice(osv.osv): # one move line per tax line iml += ait_obj.move_line_get(cr, uid, inv.id) - entry_type='' + entry_type = '' if inv.type in ('in_invoice', 'in_refund'): ref = inv.reference entry_type = 'journal_pur_voucher' @@ -890,11 +890,11 @@ class account_invoice(osv.osv): 'type': entry_type, 'narration':inv.comment } - period_id=inv.period_id and inv.period_id.id or False + period_id = inv.period_id and inv.period_id.id or False if not period_id: - period_ids= self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))]) + period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))]) if len(period_ids): - period_id=period_ids[0] + period_id = period_ids[0] if period_id: move['period_id'] = period_id for i in line: @@ -1017,9 +1017,9 @@ class account_invoice(osv.osv): def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: - args=[] + args = [] if context is None: - context={} + context = {} ids = [] if name: ids = self.search(cr, user, [('number','=',name)]+ args, limit=limit, context=context) @@ -1486,7 +1486,7 @@ class account_invoice_tax(osv.osv): def base_change(self, cr, uid, ids, base, currency_id=False, company_id=False, date_invoice=False): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') - company_currency=False + company_currency = False if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: @@ -1498,7 +1498,7 @@ class account_invoice_tax(osv.osv): company_obj = self.pool.get('res.company') company_currency = False tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] - tax_sign=1 + tax_sign = 1 if tax_amount < 0: tax_sign = -1 elif tax_amount == 0: diff --git a/addons/account/partner.py b/addons/account/partner.py index 04c97c32c9d..469b8f47652 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -55,7 +55,7 @@ class account_fiscal_position(osv.osv): if not fposition_id : return account_id for pos in fposition_id.account_ids: - if pos.account_src_id.id==account_id: + if pos.account_src_id.id == account_id: account_id = pos.account_dest_id.id break return account_id