-
-
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
[12.0][FIX] fatturapa withholding tax invoice received e-invoice 1.6 #1878
Merged
sergiocorato
merged 4 commits into
OCA:12.0-l10n_it_fatturapa-1.6
from
efatto:12.0-imp-fatturapa_withholding_tax_in_einvoice_1.6
Sep 18, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d16b663
[12.0][FIX] fatturapa withholding tax invoice received - e-invoice 1.6
sergiocorato 2cb72f6
[FIX] l10n_it_fatturapa_out_wt pep8 fixes
sergiocorato 341db54
[IMP] migration script
sergiocorato 098057c
[FIX] l10n_it_fatturapa_out_wt: Fixed ordering in DatiRitenuta genera…
SimoRubi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
l10n_it_fatturapa_in/migrations/12.0.1.19.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2020 Sergio Corato <https://github.com/sergiocorato> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def create_withholding_data_lines(env): | ||
# create ftpa_withholding_ids from ftpa_withholding_type and ftpa_withholding_amount | ||
openupgrade.logged_query( | ||
env.cr, """ | ||
INSERT INTO withholding_data_line | ||
( | ||
name, | ||
amount, | ||
invoice_id, | ||
create_uid, | ||
create_date, | ||
write_date, | ||
write_uid | ||
) | ||
SELECT | ||
ai.ftpa_withholding_type, | ||
ai.ftpa_withholding_amount, | ||
ai.id, | ||
ai.create_uid, | ||
ai.create_date, | ||
ai.write_date, | ||
ai.write_uid | ||
FROM account_invoice ai | ||
WHERE ai.ftpa_withholding_type IS NOT NULL; | ||
""" | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if not version: | ||
return | ||
create_withholding_data_lines(env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<p:FatturaElettronica xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" versione="FPR12" xmlns:p="http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2"> | ||
<FatturaElettronicaHeader> | ||
<DatiTrasmissione> | ||
<IdTrasmittente> | ||
<IdPaese>IT</IdPaese> | ||
<IdCodice>05979361218</IdCodice> | ||
</IdTrasmittente> | ||
<ProgressivoInvio>FPR11</ProgressivoInvio> | ||
<FormatoTrasmissione>FPR12</FormatoTrasmissione> | ||
<CodiceDestinatario>0000000</CodiceDestinatario> | ||
<ContattiTrasmittente /> | ||
</DatiTrasmissione> | ||
<CedentePrestatore> | ||
<DatiAnagrafici> | ||
<IdFiscaleIVA> | ||
<IdPaese>IT</IdPaese> | ||
<IdCodice>02780790107</IdCodice> | ||
</IdFiscaleIVA> | ||
<Anagrafica> | ||
<Denominazione>SOCIETA' ALPHA SRL</Denominazione> | ||
</Anagrafica> | ||
<RegimeFiscale>RF01</RegimeFiscale> | ||
</DatiAnagrafici> | ||
<Sede> | ||
<Indirizzo>VIALE ROMA 543</Indirizzo> | ||
<CAP>07100</CAP> | ||
<Comune>SASSARI</Comune> | ||
<Provincia>SS</Provincia> | ||
<Nazione>IT</Nazione> | ||
</Sede> | ||
</CedentePrestatore> | ||
<CessionarioCommittente> | ||
<DatiAnagrafici> | ||
<CodiceFiscale>03533590174</CodiceFiscale> | ||
<Anagrafica> | ||
<Denominazione>BETA GAMMA</Denominazione> | ||
</Anagrafica> | ||
</DatiAnagrafici> | ||
<Sede> | ||
<Indirizzo>VIA TORINO 38-B</Indirizzo> | ||
<CAP>00145</CAP> | ||
<Comune>ROMA</Comune> | ||
<Provincia>RM</Provincia> | ||
<Nazione>IT</Nazione> | ||
</Sede> | ||
</CessionarioCommittente> | ||
</FatturaElettronicaHeader> | ||
<FatturaElettronicaBody> | ||
<DatiGenerali> | ||
<DatiGeneraliDocumento> | ||
<TipoDocumento>TD01</TipoDocumento> | ||
<Divisa>EUR</Divisa> | ||
<Data>2020-01-09</Data> | ||
<Numero>124</Numero> | ||
<DatiRitenuta> | ||
<TipoRitenuta>RT02</TipoRitenuta> | ||
<ImportoRitenuta>46.00</ImportoRitenuta> | ||
<AliquotaRitenuta>23.00</AliquotaRitenuta> | ||
<CausalePagamento>Q</CausalePagamento> | ||
</DatiRitenuta> | ||
<DatiRitenuta> | ||
<TipoRitenuta>RT04</TipoRitenuta> | ||
<ImportoRitenuta>40.00</ImportoRitenuta> | ||
<AliquotaRitenuta>4.00</AliquotaRitenuta> | ||
<CausalePagamento>Q</CausalePagamento> | ||
</DatiRitenuta> | ||
<ImportoTotaleDocumento>1220.00</ImportoTotaleDocumento> | ||
</DatiGeneraliDocumento> | ||
</DatiGenerali> | ||
<DatiBeniServizi> | ||
<DettaglioLinee> | ||
<NumeroLinea>1</NumeroLinea> | ||
<Descrizione>Provvigione</Descrizione> | ||
<Quantita>1.000</Quantita> | ||
<PrezzoUnitario>1000.00000</PrezzoUnitario> | ||
<PrezzoTotale>1000.00</PrezzoTotale> | ||
<AliquotaIVA>22.00</AliquotaIVA> | ||
<Ritenuta>SI</Ritenuta> | ||
</DettaglioLinee> | ||
<DatiRiepilogo> | ||
<AliquotaIVA>22.00</AliquotaIVA> | ||
<ImponibileImporto>1000.00</ImponibileImporto> | ||
<Imposta>220.00</Imposta> | ||
<EsigibilitaIVA>I</EsigibilitaIVA> | ||
</DatiRiepilogo> | ||
</DatiBeniServizi> | ||
</FatturaElettronicaBody> | ||
</p:FatturaElettronica> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@sergiocorato il post migrated script viene eseguito dopo l'aggiornamento del modulo, di conseguenza questo campo
ftpa_withholding_amount
, nel momento dell'esecuzione dello script non è più presente: come fa pertanto a funzionare?Su un nostro cliente che usa Odoo.sh otteniamo questo errore:
che mi pare riconducibile a quanto scrivo sopra. Condividi l'analisi o mi sta sfuggendo qualcosa?
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.
vedi #1914
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.
Cioè chi lo elimina
ftpa_withholding_amount
? Odoo stesso quando rimuovi il campo dal model?Io aggiornato a
12.0.2.0.0.99.dev2
ma a questo punto non so perchè abbia funzionatoThere 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.
eh sì
cioè hai usato #1914? funziona perché lo script di migrazione controlla se tale campo esiste prima di effettuare la query.
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.
Ho usato https://pypi.org/project/odoo12-addon-l10n-it-fatturapa-in/12.0.2.0.0.99.dev2/
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.
Ho assunto di sì AFAIK, mi pare logico, @eLBati tu dici che non è così scontato? cc @sergiocorato
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.
In effetti assumevo di no, forse in vecchie versioni era no. Ma magari ora è sì 🤯 😁
Sarebbe da provare
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.
Si, se esiste la colonna
ftpa_withholding_amount
la copia e la usa, altrimenti fa solo laftpa_withholding_type