Skip to content

Commit b64e747

Browse files
em230418Abranes
authored andcommitted
[FIX] pos_payment_change: add compatibility with pos_order_copy
1 parent f2e23e9 commit b64e747

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pos_payment_change/models/pos_order.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def change_payment(self, payment_lines):
6969

7070
# Resale order and mark it as paid
7171
# with the new payment
72-
resale_order = self.copy(default={"pos_reference": self.pos_reference})
72+
resale_order = self.copy(default=self._prepare_resale_order_vals())
7373
for line in payment_lines:
7474
line.update({"pos_order_id": resale_order.id})
7575
resale_order.add_payment(line)
@@ -99,3 +99,11 @@ def _check_payment_change_allowed(self):
9999
session=", ".join(closed_orders.mapped("session_id.name")),
100100
)
101101
)
102+
103+
def _prepare_resale_order_vals(self):
104+
self.ensure_one()
105+
106+
return {
107+
"pos_reference": self.pos_reference,
108+
"session_id": self.session_id.id,
109+
}

0 commit comments

Comments
 (0)