[FIX]Accounting: filter on fiscal year in CoA tree
This commit is contained in:
parent
088eead3a3
commit
788404cd92
|
@ -741,6 +741,8 @@ class account_move_line(osv.osv):
|
||||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
|
if context.get('fiscalyear'):
|
||||||
|
args.append(('period_id.fiscalyear_id', '=', context.get('fiscalyear', False)))
|
||||||
if context and context.get('next_partner_only', False):
|
if context and context.get('next_partner_only', False):
|
||||||
if not context.get('partner_id', False):
|
if not context.get('partner_id', False):
|
||||||
partner = self.list_partners_to_reconcile(cr, uid, context=context)
|
partner = self.list_partners_to_reconcile(cr, uid, context=context)
|
||||||
|
|
|
@ -351,7 +351,7 @@
|
||||||
<act_window
|
<act_window
|
||||||
id="action_account_items"
|
id="action_account_items"
|
||||||
name="Journal Items"
|
name="Journal Items"
|
||||||
context="{'search_default_account_id': [active_id]}"
|
context="{'search_default_account_id': [active_id], 'fiscalyear': context.get('fiscalyear')}"
|
||||||
res_model="account.move.line"
|
res_model="account.move.line"
|
||||||
src_model="account.account"
|
src_model="account.account"
|
||||||
key2="tree_but_open"/>
|
key2="tree_but_open"/>
|
||||||
|
|
|
@ -62,9 +62,10 @@ class account_chart(osv.osv_memory):
|
||||||
ORDER BY p.date_stop DESC
|
ORDER BY p.date_stop DESC
|
||||||
LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id))
|
LIMIT 1) AS period_stop''', (fiscalyear_id, fiscalyear_id))
|
||||||
periods = [i[0] for i in cr.fetchall()]
|
periods = [i[0] for i in cr.fetchall()]
|
||||||
if periods and len(periods) > 1:
|
if periods:
|
||||||
start_period = periods[0]
|
start_period = periods[0]
|
||||||
end_period = periods[1]
|
if len(periods) > 1:
|
||||||
|
end_period = periods[1]
|
||||||
res['value'] = {'period_from': start_period, 'period_to': end_period}
|
res['value'] = {'period_from': start_period, 'period_to': end_period}
|
||||||
else:
|
else:
|
||||||
res['value'] = {'period_from': False, 'period_to': False}
|
res['value'] = {'period_from': False, 'period_to': False}
|
||||||
|
|
Loading…
Reference in New Issue