Browse Source

[PEP8]

pull/7/merge
Nhomar Hernandez 12 years ago
parent
commit
114410091e
  1. 18
      account_financial_report/model/account_financial_report.py

18
account_financial_report/model/account_financial_report.py

@ -3,7 +3,7 @@
# Module Writen to OpenERP, Open Source Management Solution # Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
# All Rights Reserved # All Rights Reserved
###############Credits######################################################
# Credits######################################################
# Coded by: Humberto Arocha humberto@openerp.com.ve # Coded by: Humberto Arocha humberto@openerp.com.ve
# Angelica Barrios angelicaisabelb@gmail.com # Angelica Barrios angelicaisabelb@gmail.com
# Jordi Esteve <jesteve@zikzakmedia.com> # Jordi Esteve <jesteve@zikzakmedia.com>
@ -31,6 +31,7 @@ import pooler
import time import time
from tools.translate import _ from tools.translate import _
class account_financial_report(osv.osv): class account_financial_report(osv.osv):
_name = "afr" _name = "afr"
@ -75,7 +76,8 @@ class account_financial_report(osv.osv):
context = {} context = {}
previous_name = self.browse(cr, uid, id, context=context).name previous_name = self.browse(cr, uid, id, context=context).name
new_name = _('Copy of %s') % previous_name new_name = _('Copy of %s') % previous_name
lst = self.search(cr, uid, [('name','like',new_name)], context=context)
lst = self.search(cr, uid, [(
'name', 'like', new_name)], context=context)
if lst: if lst:
new_name = '%s (%s)' % (new_name, len(lst)+1) new_name = '%s (%s)' % (new_name, len(lst)+1)
defaults['name'] = new_name defaults['name'] = new_name
@ -101,7 +103,8 @@ class account_financial_report(osv.osv):
if columns in ('qtr', 'thirteen'): if columns in ('qtr', 'thirteen'):
p_obj = self.pool.get("account.period") p_obj = self.pool.get("account.period")
period_ids = p_obj.search(cr,uid,[('fiscalyear_id','=',fiscalyear_id),('special','=',False)],context=context)
period_ids = p_obj.search(cr, uid, [('fiscalyear_id', '=', fiscalyear_id), (
'special', '=', False)], context=context)
res['value'].update({'period_ids': period_ids}) res['value'].update({'period_ids': period_ids})
else: else:
res['value'].update({'period_ids': []}) res['value'].update({'period_ids': []})
@ -112,7 +115,8 @@ class account_financial_report(osv.osv):
context = {} context = {}
context['company_id'] = company_id context['company_id'] = company_id
res = {'value': {}} res = {'value': {}}
cur_id = self.pool.get('res.company').browse(cr,uid,company_id,context=context).currency_id.id
cur_id = self.pool.get('res.company').browse(
cr, uid, company_id, context=context).currency_id.id
res['value'].update({'currency_id': cur_id}) res['value'].update({'currency_id': cur_id})
return res return res
@ -125,8 +129,10 @@ class account_financial_report(osv.osv):
if not company_id: if not company_id:
return res return res
cur_id = self.pool.get('res.company').browse(cr,uid,company_id,context=context).currency_id.id
fy_id = self.pool.get('account.fiscalyear').find(cr, uid,context=context)
cur_id = self.pool.get('res.company').browse(
cr, uid, company_id, context=context).currency_id.id
fy_id = self.pool.get('account.fiscalyear').find(
cr, uid, context=context)
res['value'].update({'fiscalyear_id': fy_id}) res['value'].update({'fiscalyear_id': fy_id})
res['value'].update({'currency_id': cur_id}) res['value'].update({'currency_id': cur_id})
res['value'].update({'account_ids': []}) res['value'].update({'account_ids': []})

Loading…
Cancel
Save