-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
[14.0][IMP] l10n_it_fatturapa_out: use parent codice_destinatario if not set in partner #4436
base: 14.0
Are you sure you want to change the base?
Conversation
d7b6c4e
to
d589651
Compare
d589651
to
eb08f30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ciao, grazie per la PR.
@@ -13,6 +13,13 @@ class ResPartner(models.Model): | |||
default=lambda self: self.env.company.max_invoice_in_xml, | |||
help="Maximum number of invoices to group in a single " "XML file. 0=Unlimited", | |||
) | |||
use_parent_codice_destinatario = fields.Boolean( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Propongo di chiamare il campo l10n_it_use_parent_codice_destinatario
(anche in vista di future integrazione con Odoo 18, i campi della localizzazione hanno in genere quel prefisso)
@@ -206,7 +206,14 @@ def fpa_to_eur(amount, invoice): | |||
# check value code | |||
code = self.partner_id.ipa_code | |||
else: | |||
code = self.partner_id.codice_destinatario | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
piuttosto che modificare l10n_it_fatturapa_out
con questa logica, io farei una compute nella definizione del campo codice_destinatario
e implementerei la logica lì, dove è definito il campo (l10n_it_fatturapa
).
infatti in futuro un altro modulo potrebbe usare il codice_destinatario
- se va popolato da un partner padre deve reimplementare la logica
@@ -9,6 +9,9 @@ | |||
<field name="ipa_code" position="before"> | |||
<field name="max_invoice_in_xml" /> | |||
</field> | |||
<xpath expr="//field[@name='codice_destinatario']" position="before"> | |||
<field name="use_parent_codice_destinatario" /> | |||
</xpath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conviene anche disabilitare/grigiare/nascondere il campo codice_destinatario
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grazie per la review, ho reso il campo codice_destinatario di sola lettura quando viene utilizzato il codice del padre. Per poterlo modificare, esiste il campo electronic_invoice_use_this_address
.
Aggiungo che implementando la logica in |
eb08f30
to
ab218ad
Compare
3d8f29b
to
6d72030
Compare
36f2f25
to
cf16ce2
Compare
Uses the parent codice_destinatario for each child if the parent has set the flag l10n_it_use_parent_codice_destinatario.
cf16ce2
to
25001b8
Compare
@TheMule71, Hai idea del perchè i test falliscono?
Per come ho implementato la logica di assegnamento di |
Se il campo
use_parent_codice_destinatario
è abilitato ogni child userà il suo codice_destinatario del proprio parent. Tiene conto del campoelectronic_invoice_use_this_address
.