Skip to content
Snippets Groups Projects
Commit d2f56053 authored by Adrien Guilliams (adgu)'s avatar Adrien Guilliams (adgu)
Browse files

[FIX] point_of_sale: restore payment method in invoice


Accounting moved the logic of _get_reconciled_vals
into _compute_payments_widget_reconciled_info but did not made the
change in point_of_sale.
This commit resolve this by putting the logic of the previous
_get_reconciled_vals into an override of the
_compute_payments_widget_reconciled_info method.
This is done because this is a legal requirement in France to have and
maybe in other countries.

closes odoo/odoo#139979

X-original-commit: ad7d4b68
Signed-off-by: default avatarRobin Heinz (rhe) <rhe@odoo.com>
parent 0828bd12
Branches
Tags
No related merge requests found
......@@ -44,6 +44,19 @@ class AccountMove(models.Model):
return lot_values
def _compute_payments_widget_reconciled_info(self):
"""Add pos_payment_name field in the reconciled vals to be able to show the payment method in the invoice."""
super()._compute_payments_widget_reconciled_info()
for move in self:
if move.invoice_payments_widget:
if move.state == 'posted' and move.is_invoice(include_receipts=True):
reconciled_partials = move._get_all_reconciled_invoice_partials()
for i, reconciled_partial in enumerate(reconciled_partials):
counterpart_line = reconciled_partial['aml']
pos_payment = counterpart_line.move_id.sudo().pos_payment_ids
move.invoice_payments_widget['content'][i].update({
'pos_payment_name': pos_payment.payment_method_id.name,
})
class AccountMoveLine(models.Model):
_inherit = 'account.move.line'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment