From bbc67ec4024369074aee8ceda2367a719a66fce2 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 26 Nov 2015 14:18:39 +0100 Subject: [PATCH] [FIX] web: export data according to domain Some accounting model (i.e. account.tax) are redefining the ORM search method, but with misordered arguments (placing count as fifth argument instead of context). For the export function, this lead to have the "context" variable associated to the "count" function variable. As "count" is then considered as True, the method returns the number of records instead of the list of record ids. This then exported the last record (the count'th one) instead of all the records that matched the domain. The solution here is to explicitly give the context variable by name. --- addons/web/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index f0f455be1e3..b2cb698a256 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1408,7 +1408,7 @@ class ExportFormat(object): Model = request.session.model(model) context = dict(request.context or {}, **params.get('context', {})) - ids = ids or Model.search(domain, 0, False, False, context) + ids = ids or Model.search(domain, 0, False, False, context=context) if not request.env[model]._is_an_ordinary_table(): fields = [field for field in fields if field['name'] != 'id']