-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
[IMP] new module l10n_it_fatturapa_auto_downpayment #4230
base: 16.0
Are you sure you want to change the base?
[IMP] new module l10n_it_fatturapa_auto_downpayment #4230
Conversation
Non so dare una valutazione su questo caso specifico, ma credo che un obiettivo di oca-italy dovrebbe essere cercare di evitare la proliferazione di nuovi moduli per la contabilità... che ne pensate? |
0e68b98
to
9f96f96
Compare
Ho fatto sia una PR come modifica a modulo esistente e sia una PR come modulo nuovo. Il motivo per avere un nuovo modulo è solo per evitare di introdurre la dipendenza dal modulo |
fd91b78
to
5c5592b
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.
Functional test: OK
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 della PR!
Potresti mettere [ADD] invece di [IMP] nel messaggio del commit?
[ADD] for adding new modules
Grande che hai messo un test 😄 fammi sapere cosa ne pensi delle note qui sotto, le uniche cose bloccanti per me sono nell'override
def _get_document_fiscal_type( | ||
self, move_type=None, partner=None, fiscal_position=None, journal=None | ||
): | ||
self.ensure_one() |
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.
Il metodo in super
def _get_document_fiscal_type( |
È possibile spostare questo vincolo e il resto del codice che ne ha bisogno dentro un
if len(self) == 1
o qualcosa di analogo?
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.
L'unico punto in cui è chiamata è la _compute_set_document_fiscal_type()
, all'interno di un loop fattura per fattura.
Piu di quello però, il valore di ritorno è un alista di possibili TDxx validi per una sola fattura. La funziona ignora self
di fatto (potrebbe essere @api.model
), ma gli vengono passati un solo partner, una sola posizione fiscale, un solo journal, relativi ad una sola fattura.
In pratica la funzione originale è usata come se fosse self.ensure_one()
e scritta come se fosse @api.model
. Non credo possa essere chiamata su un recordset, visto che per avere un risultato sensato dovresti assicurarti a priori che sono fatture con lo stesso partner, stessa fpos, stesso journal.
Io ho aggiunto self.ensure_one()
perché effettivamente uso self
.
@@ -0,0 +1,9 @@ | |||
**Italiano** | |||
|
|||
- Alla creazione di una fattura di downpayment, viene settato |
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.
Perché un elenco?
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.
Non so, credo un refuso? In genere copio da un altro modulo e edito.
|
||
**English** | ||
|
||
The module sets TD02 for downpayment invoices automatically. |
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.
Da allineare con l'italiano
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.
A me sembra abbastanza allineato.
"Il modulo funziona automaticamente alla creazione di una fattura di acconto."
"The module sets TD02 for downpayment invoices automatically."
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.
Però in pratica "funziona" in inglese viene tradotto con "sets TD02", si può rendere più esplicita la parte in italiano?
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.
Sistemato.
td02 = self.env["fiscal.document.type"].search( | ||
[("code", "=", "TD02")], limit=1 | ||
) | ||
dt.insert(0, td02.id) |
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.
Se TD02 non viene trovato, si vuole davvero aggiungere False
come prima scelta per il tipo di documento fiscale?
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.
No, giusto. Diciamo che non so cosa fare se manca però, visto che non dovrebbe mancare la possibilità di generare TD02...
Corretto. Grazie per la review! |
5c5592b
to
b79d2be
Compare
b79d2be
to
8cbb8df
Compare
Se la fattura è un acconto, setta automaticamente TD02 come tipo documento fiscale.
Tale comportamento è simile a l10n_it_edi
Rimpiazza #4222
Fixes: #4221