Browse Source

[FIX] Partail return on pos order is not working when l10n_fr_pos_cert module is installed

pull/500/head
Ajay Javiya 5 years ago
parent
commit
bb7bac4b80
  1. 14
      pos_order_return/models/pos_order.py
  2. 1
      pos_order_return/readme/CONTRIBUTORS.rst

14
pos_order_return/models/pos_order.py

@ -72,12 +72,13 @@ class PosOrder(models.Model):
for line in self.lines: for line in self.lines:
qty = - line.max_returnable_qty([]) qty = - line.max_returnable_qty([])
if qty != 0: if qty != 0:
copy_line = line.copy()
copy_line.write({
line.copy(
{
'order_id': new_order.id, 'order_id': new_order.id,
'returned_line_id': line.id, 'returned_line_id': line.id,
'qty': qty, 'qty': qty,
})
}
)
return res return res
def partial_refund(self, partial_return_wizard): def partial_refund(self, partial_return_wizard):
@ -87,12 +88,13 @@ class PosOrder(models.Model):
for wizard_line in partial_return_wizard.line_ids: for wizard_line in partial_return_wizard.line_ids:
qty = -wizard_line.qty qty = -wizard_line.qty
if qty != 0: if qty != 0:
copy_line = wizard_line.pos_order_line_id.copy()
copy_line.write({
copy_line = wizard_line.pos_order_line_id.copy(
{
'order_id': new_order.id, 'order_id': new_order.id,
'returned_line_id': wizard_line.pos_order_line_id.id, 'returned_line_id': wizard_line.pos_order_line_id.id,
'qty': qty, 'qty': qty,
})
}
)
copy_line._onchange_amount_line_all() copy_line._onchange_amount_line_all()
new_order._onchange_amount_all() new_order._onchange_amount_all()
return res return res

1
pos_order_return/readme/CONTRIBUTORS.rst

@ -1,3 +1,4 @@
* Sylvain LE GAL <https://twitter.com/legalsylvain> * Sylvain LE GAL <https://twitter.com/legalsylvain>
* David Vidal <david.vidal@tecnativa.com> * David Vidal <david.vidal@tecnativa.com>
* Kiril Vangelovski <kiril@lambda-is.com> * Kiril Vangelovski <kiril@lambda-is.com>
* Druidoo <https://www.druidoo.io>
Loading…
Cancel
Save