[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.
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user