[FIX] account : fix domain of accounts in the automatic entry wizard

Two account.account M2O where authorizing off-balance accounts while
they should not be selectable. This change aim to fix that.

closes odoo/odoo#57345

X-original-commit: cd25dba354b9d2a83e6b7ab45434bb2879984e33
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Nicolas Viseur <vin-odoo@users.noreply.github.com>
This commit is contained in:
Nicolas (vin)
2020-09-09 10:16:12 +00:00
parent eeaeaa7214
commit 88bae9969c
@@ -29,10 +29,14 @@ class AutomaticEntryWizard(models.TransientModel):
# change period
account_type = fields.Selection([('income', 'Revenue'), ('expense', 'Expense')], compute='_compute_account_type', store=True)
expense_accrual_account = fields.Many2one('account.account', readonly=False,
domain="[('company_id', '=', company_id), ('internal_type', 'not in', ('receivable', 'payable'))]",
domain="[('company_id', '=', company_id),"
"('internal_type', 'not in', ('receivable', 'payable')),"
"('is_off_balance', '=', False)]",
related="company_id.expense_accrual_account_id")
revenue_accrual_account = fields.Many2one('account.account', readonly=False,
domain="[('company_id', '=', company_id), ('internal_type', 'not in', ('receivable', 'payable'))]",
domain="[('company_id', '=', company_id),"
"('internal_type', 'not in', ('receivable', 'payable')),"
"('is_off_balance', '=', False)]",
related="company_id.revenue_accrual_account_id")
# change account