Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] [FIX] l10n_it_reverse_charge: consider original invoice date in RC invoice comments #4142

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Comment on lines -116 to 119
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se il riferimento interno è di self, mi aspetto che anche la data venga presa da self: quindi secondo me la scelta sta tra self.date e self.invoice_date (da decidere in #4141 (comment)).
Una volta scelto si potrebbe anche chiarire nel testo della descrizione quale delle due date è riportata.

)
return {
Expand Down
Loading