Skip to content

Commit

Permalink
[FIX] Fix method add_all in payment group to use command
Browse files Browse the repository at this point in the history
closes #419

Signed-off-by: Juan José Scarafía <[email protected]>
  • Loading branch information
maq-adhoc committed Nov 27, 2023
1 parent 2099428 commit e253d1e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions account_payment_group/models/account_payment_group.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e253d1e

Please sign in to comment.