Browse Source

[FIX] Flake8 issues

pull/189/head
Adrien Peiffer (ACSONE) 9 years ago
committed by Stéphane Bidoul
parent
commit
19fcf3b945
  1. 6
      mis_builder/models/aep.py
  2. 3
      mis_builder/models/mis_builder.py

6
mis_builder/models/aep.py

@ -85,13 +85,15 @@ class AccountingExpressionProcessor(object):
self._account_ids_by_code[account_code].update(account_ids)
elif '%' in account_code:
account_ids = account_model.\
search([('code', 'like', account_code), ('company_id', '=', company.id)]).mapped('id')
search([('code', 'like', account_code),
('company_id', '=', company.id)]).mapped('id')
self._account_ids_by_code[account_code].update(account_ids)
else:
# search exact codes after the loop to do less queries
exact_codes.add(account_code)
for account in account_model.\
search([('code', 'in', list(exact_codes)), ('company_id', '=', company.id)]):
search([('code', 'in', list(exact_codes)),
('company_id', '=', company.id)]):
self._account_ids_by_code[account.code].add(account.id)
def _parse_match_object(self, mo):

3
mis_builder/models/mis_builder.py

@ -535,7 +535,8 @@ class MisReportInstancePeriod(models.Model):
if current_periods:
all_periods = date_range_obj.search(
[('type_id', '=', self.date_range_type_id.id),
('company_id', '=', self.report_instance_id.company_id.id)],
('company_id', '=',
self.report_instance_id.company_id.id)],
order='date_start')
all_period_ids = [p.id for p in all_periods]
p = all_period_ids.index(current_periods[0].id) + self.offset

Loading…
Cancel
Save