[FIX] point_of_sale: prevent assignment of payment method during copy

Befoer this commit, duplicating a POS payment method led to automatic
assignment to the source payment method's POS configs. This behavior
caused issues, particularly when the POS session was open.

opw-3635647

closes odoo/odoo#147238

X-original-commit: 0725850a9d2893ea80518575735ca407cc608968
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
Pedram (PEBR)
2023-12-26 11:03:19 +00:00
parent f2bee5d2a1
commit fb203ec2b4
@@ -93,3 +93,7 @@ class PosPaymentMethod(models.Model):
raise UserError(_('Please close and validate the following open PoS Sessions before modifying this payment method.\n'
'Open sessions: %s', (' '.join(self.open_session_ids.mapped('name')),)))
return super(PosPaymentMethod, self).write(vals)
def copy(self, default=None):
default = dict(default or {}, config_ids=[(5, 0, 0)])
return super().copy(default)