[FIX] select the current fiscal year in the financial reports wizards
lp bug: https://launchpad.net/bugs/1091171 fixed bzr revid: guewen.baconnier@camptocamp.com-20121217105552-s82nf3t5ttlrvkr0
This commit is contained in:
parent
54a4b12103
commit
e7a3b2638b
|
@ -122,9 +122,11 @@ class account_common_report(osv.osv_memory):
|
||||||
now = time.strftime('%Y-%m-%d')
|
now = time.strftime('%Y-%m-%d')
|
||||||
company_id = False
|
company_id = False
|
||||||
ids = context.get('active_ids', [])
|
ids = context.get('active_ids', [])
|
||||||
|
domain = [('date_start', '<', now), ('date_stop', '>', now)]
|
||||||
if ids and context.get('active_model') == 'account.account':
|
if ids and context.get('active_model') == 'account.account':
|
||||||
company_id = self.pool.get('account.account').browse(cr, uid, ids[0], context=context).company_id.id
|
company_id = self.pool.get('account.account').browse(cr, uid, ids[0], context=context).company_id.id
|
||||||
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now), ('company_id', '=', company_id)], limit=1)
|
domain += ('company_id', '=', company_id)
|
||||||
|
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, domain, limit=1)
|
||||||
return fiscalyears and fiscalyears[0] or False
|
return fiscalyears and fiscalyears[0] or False
|
||||||
|
|
||||||
def _get_all_journal(self, cr, uid, context=None):
|
def _get_all_journal(self, cr, uid, context=None):
|
||||||
|
|
Loading…
Reference in New Issue