From 53cedfc92bdb66c897840323b7912f36e8d040a0 Mon Sep 17 00:00:00 2001 From: Ajay Javiya Date: Wed, 3 Jun 2020 15:09:38 +0530 Subject: [PATCH 1/2] [FIX] Wrong Total on pos order partial return --- pos_order_return/models/pos_order.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pos_order_return/models/pos_order.py b/pos_order_return/models/pos_order.py index 8d45c3cb..f8e42613 100644 --- a/pos_order_return/models/pos_order.py +++ b/pos_order_return/models/pos_order.py @@ -93,6 +93,8 @@ class PosOrder(models.Model): 'returned_line_id': wizard_line.pos_order_line_id.id, 'qty': qty, }) + copy_line._onchange_amount_line_all() + new_order._onchange_amount_all() return res def action_pos_order_paid(self): From bb7bac4b800781237ac7f7c1b64e8cad27ea7818 Mon Sep 17 00:00:00 2001 From: Ajay Javiya Date: Wed, 3 Jun 2020 16:24:45 +0530 Subject: [PATCH 2/2] [FIX] Partail return on pos order is not working when l10n_fr_pos_cert module is installed --- pos_order_return/models/pos_order.py | 26 +++++++++++++----------- pos_order_return/readme/CONTRIBUTORS.rst | 1 + 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pos_order_return/models/pos_order.py b/pos_order_return/models/pos_order.py index f8e42613..fa7e93c2 100644 --- a/pos_order_return/models/pos_order.py +++ b/pos_order_return/models/pos_order.py @@ -72,12 +72,13 @@ class PosOrder(models.Model): for line in self.lines: qty = - line.max_returnable_qty([]) if qty != 0: - copy_line = line.copy() - copy_line.write({ - 'order_id': new_order.id, - 'returned_line_id': line.id, - 'qty': qty, - }) + line.copy( + { + 'order_id': new_order.id, + 'returned_line_id': line.id, + 'qty': qty, + } + ) return res def partial_refund(self, partial_return_wizard): @@ -87,12 +88,13 @@ class PosOrder(models.Model): for wizard_line in partial_return_wizard.line_ids: qty = -wizard_line.qty if qty != 0: - copy_line = wizard_line.pos_order_line_id.copy() - copy_line.write({ - 'order_id': new_order.id, - 'returned_line_id': wizard_line.pos_order_line_id.id, - 'qty': qty, - }) + copy_line = wizard_line.pos_order_line_id.copy( + { + 'order_id': new_order.id, + 'returned_line_id': wizard_line.pos_order_line_id.id, + 'qty': qty, + } + ) copy_line._onchange_amount_line_all() new_order._onchange_amount_all() return res diff --git a/pos_order_return/readme/CONTRIBUTORS.rst b/pos_order_return/readme/CONTRIBUTORS.rst index 4e1bf63f..d3125401 100644 --- a/pos_order_return/readme/CONTRIBUTORS.rst +++ b/pos_order_return/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * Sylvain LE GAL * David Vidal * Kiril Vangelovski +* Druidoo