From 93be8cdc2df43005e327f3347791051a750aba86 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Mon, 29 May 2017 11:31:57 +0200 Subject: [PATCH] [ADD] account: allow filtering moves on account_ids throught context The check register report is the same as the general ledger except it only displays account in type cash. On report, a "totals" line appears when only one journal is selected but it's value is computed based on the whole accounts without filtering. Then, we need a way to compute this totals only based on specific accounts task: https://www.odoo.com/web#id=28656&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720 --- addons/account/models/account_move.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 22b7452d601..a47f232f3f2 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1400,6 +1400,9 @@ class AccountMoveLine(models.Model): if context.get('account_tag_ids'): domain += [('account_id.tag_ids', 'in', context['account_tag_ids'].ids)] + if context.get('account_ids'): + domain += [('account_id', 'in', context['account_ids'].ids)] + if context.get('analytic_tag_ids'): domain += ['|', ('analytic_account_id.tag_ids', 'in', context['analytic_tag_ids'].ids), ('analytic_tag_ids', 'in', context['analytic_tag_ids'].ids)]