Browse Source

[IMP] mis_builder: date and modes i/e are not compatibles

pull/86/head
Stéphane Bidoul 10 years ago
parent
commit
407945e331
  1. 9
      mis_builder/models/aep.py

9
mis_builder/models/aep.py

@ -1,9 +1,10 @@
import re import re
from collections import defaultdict from collections import defaultdict
from openerp.exceptions import Warning
from openerp.osv import expression from openerp.osv import expression
from openerp.tools.safe_eval import safe_eval from openerp.tools.safe_eval import safe_eval
from openerp.tools.translate import _
MODE_VARIATION = 'p' MODE_VARIATION = 'p'
MODE_INITIAL = 'i' MODE_INITIAL = 'i'
@ -291,7 +292,11 @@ class AccountingExpressionProcessor(object):
period_from, period_to, mode) period_from, period_to, mode)
domain = [('period_id', 'in', period_ids)] domain = [('period_id', 'in', period_ids)]
else: else:
domain = [('date', '>=', date_from), ('date', '<=', date_to)]
if mode == MODE_VARIATION:
domain = [('date', '>=', date_from), ('date', '<=', date_to)]
else:
raise Warning(_("Modes i and e are only applicable for "
"fiscal periods"))
if target_move == 'posted': if target_move == 'posted':
domain.append(('move_id.state', '=', 'posted')) domain.append(('move_id.state', '=', 'posted'))
return expression.normalize_domain(domain) return expression.normalize_domain(domain)

Loading…
Cancel
Save