Wednesday, November 13, 2024
1 change · saas-17.2
Resolved issues and error corrections
Duplicating several Point of Sale payment methods at once no longer causes an error. This helps store administrators manage payment setup more reliably without interruptions.
Original PR description
Currently, a traceback occurs when the user tries to duplicate multiple pos payment methods. To reproduce this issue: 1) Install Point of Sale 2) Try to duplicate multiple payment methods from the POS configuration Error:- ``` ValueError: Expected singleton: account.journal(14, 18) ``` This is because of the changes from the recent commit https://github.com/odoo/odoo/pull/175530/commits/0fbd47bdd2fe06feda7df747e8560b810a666386 In `copy` method, when multiple records are duplicated it executed the method at multiple times. so `self` should have a single record at a time. From the `saas-17.2`, the `copy` method changes to `copy_data`, So it is executed at a time when the `self` having multiple recordsets. This leads to a traceback as `self.journal_id.type` is used. https://github.com/odoo/odoo/blob/88604332ae37d75c1435a298319a378841abf25a/addons/point_of_sale/models/pos_payment_method.py#L166-L168 sentry-5790593911