From e253d1ea0cf7e1ccff8290deb016abb16255be05 Mon Sep 17 00:00:00 2001 From: Martin Quinteros Date: Fri, 24 Nov 2023 14:18:04 +0000 Subject: [PATCH] [FIX] Fix method add_all in payment group to use command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes ingadhoc/account-payment#419 Signed-off-by: Juan José Scarafía --- account_payment_group/models/account_payment_group.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account_payment_group/models/account_payment_group.py b/account_payment_group/models/account_payment_group.py index e16f68c07..273755beb 100644 --- a/account_payment_group/models/account_payment_group.py +++ b/account_payment_group/models/account_payment_group.py @@ -1,7 +1,7 @@ # © 2016 ADHOC SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, api, fields, _ +from odoo import models, api, fields, _, Command from odoo.exceptions import ValidationError @@ -382,8 +382,7 @@ def _get_to_pay_move_lines_domain(self): def add_all(self): for rec in self: - rec.to_pay_move_line_ids = rec.env['account.move.line'].search( - rec._get_to_pay_move_lines_domain()) + rec.to_pay_move_line_ids = [Command.clear(), Command.set(self.env['account.move.line'].search(rec._get_to_pay_move_lines_domain()).ids)] def remove_all(self): self.to_pay_move_line_ids = False