From 46f806de2c9699073cec86a007732cc6418e7cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 27 Apr 2016 23:05:20 +0200 Subject: [PATCH] [FIX] mis_builder: use =like instead of like to search on account codes --- mis_builder/CHANGES.rst | 6 ++++-- mis_builder/models/aep.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mis_builder/CHANGES.rst b/mis_builder/CHANGES.rst index fbfa6c42..376275f0 100644 --- a/mis_builder/CHANGES.rst +++ b/mis_builder/CHANGES.rst @@ -9,9 +9,11 @@ Changelog 9.0.1.0.0 (2016-??-??) ~~~~~~~~~~~~~~~~~~~~~~ -* Correctly compute the initial balance of income and expense account +* [FIX] use =like instead of like to search for accounts, because + the % are added by the user in the expressions +* [FIX] Correctly compute the initial balance of income and expense account based on the start of the fiscal year -* Support date ranges (from OCA/server-tools/date_range) as a more +* [IMP] Support date ranges (from OCA/server-tools/date_range) as a more flexible alternative to fiscal periods * v9 migration: fiscal periods are removed, account charts are removed, consolidation accounts have been removed diff --git a/mis_builder/models/aep.py b/mis_builder/models/aep.py index 7b53d372..547df449 100644 --- a/mis_builder/models/aep.py +++ b/mis_builder/models/aep.py @@ -86,7 +86,7 @@ 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), + search([('code', '=like', account_code), ('company_id', '=', company.id)]).ids self._account_ids_by_code[account_code].update(account_ids) else: