[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user