Skip to content

Commit

Permalink
[FIX] l10n_it_reverse_charge: original invoice date in RC
Browse files Browse the repository at this point in the history
For some unknown reason, since its inception (? e460d4d ) the description relating to the original invoice, always used the date of the RC document, not the actual one.
  • Loading branch information
rlucia authored and OCA-git-bot committed Oct 21, 2024
1 parent 7078999 commit 288ac14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion l10n_it_reverse_charge/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ def rc_inv_vals(self, partner, rc_type, lines, currency):
else:
move_type = "out_refund"
supplier = self.partner_id
reference_date = self.invoice_date
original_invoice = self.search(
[("rc_self_purchase_invoice_id", "=", self.id)], limit=1
)
if original_invoice:
supplier = original_invoice.partner_id
reference_date = original_invoice.invoice_date

narration = _(
"Reverse charge self invoice.\n"
Expand All @@ -113,7 +115,7 @@ def rc_inv_vals(self, partner, rc_type, lines, currency):
"Internal reference: %(internal_reference)s",
supplier=supplier.display_name,
reference=self.invoice_origin or self.ref or "",
date=self.date,
date=reference_date,
internal_reference=self.name,
)
return {
Expand Down

0 comments on commit 288ac14

Please sign in to comment.