Merge lp:~coopenerp/openobject-italia/7.0-adding-intra-cee into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
- 7.0-adding-intra-cee
- Merge into italian-addons-7.0
Status: | Approved |
---|---|
Approved by: | Alessandro Camilli |
Approved revision: | 242 |
Proposed branch: | lp:~coopenerp/openobject-italia/7.0-adding-intra-cee |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0 |
Diff against target: |
1052 lines (+991/-0) 11 files modified
l10n_it_invoice_intra_cee/AUTHORS.txt (+2/-0) l10n_it_invoice_intra_cee/__init__.py (+24/-0) l10n_it_invoice_intra_cee/__openerp__.py (+41/-0) l10n_it_invoice_intra_cee/account/__init__.py (+23/-0) l10n_it_invoice_intra_cee/account/account.py (+539/-0) l10n_it_invoice_intra_cee/account/account_data.xml (+32/-0) l10n_it_invoice_intra_cee/account/account_view.xml (+89/-0) l10n_it_invoice_intra_cee/company/__init__.py (+23/-0) l10n_it_invoice_intra_cee/company/company.py (+36/-0) l10n_it_invoice_intra_cee/company/company_view.xml (+18/-0) l10n_it_invoice_intra_cee/i18n/it.po (+164/-0) |
To merge this branch: | bzr merge lp:~coopenerp/openobject-italia/7.0-adding-intra-cee |
Related bugs: | |
Related blueprints: |
Autofatturazione - - Reverse charge
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lorenzo Battistini | Needs Fixing | ||
Davide Corio (community) | Abstain | ||
Andrea Cometa (community) | Approve | ||
Review via email: mp+210855@code.launchpad.net |
This proposal supersedes a proposal from 2014-03-13.
Commit message
Description of the change
Aggiunto modulo per la gestione delle fatture INTRA CEE
Davide Corio (enlightx-deactivatedaccount) wrote : Posted in a previous version of this proposal | # |
Andrea Cometa (scigghia) wrote : Posted in a previous version of this proposal | # |
Ciao Davide, qui abbiamo scritto una guida sul modulo http://
Davide Corio (enlightx-deactivatedaccount) wrote : Posted in a previous version of this proposal | # |
@Andrea,
non si può approvare il MP, siccome il target branch è errato.
A parte questo.
Esisteva un blueprint, sul quale stavo lavorando. Inoltre eri a conoscenza del fatto che ci stavo lavorando.
Guardando il tuo modulo deduco che stiamo facendo bene o male le stesse cose, con gli stessi principi.
Duplicazione di sforzi?
Non ho nessun problema a sentirmi dire <<il tuo modulo fa schifo, ne faccio un altro>>, basta comunicare per evitare di perdere tempo.
Procedo a cancellare il mio branch, così non facciamo confusione.
Andrea Cometa (scigghia) : Posted in a previous version of this proposal | # |
Andrea Cometa (scigghia) wrote : Posted in a previous version of this proposal | # |
in realtà lo sviluppo è stato portato avanti da Giuseppe ed Andrea in maniera così rapida che non ho avuto modo di coordinarmi (purtroppo)
Francesco ha contribuito, io ho pubblicato quanto fatto
ora, dato che il modulo è pronto possiamo semplicemente decidere se va bene per tutti o meno
il blueprint non è stato preso in considerazione dato che abbiamo seguito le specifiche di un cliente ed ora ci sembra giusto condividere il lavoro
Andrea Cometa (scigghia) wrote : | # |
ora il branch dovrebbe essere quello giusto :)
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
Personalmente non sono a favore dello scrivere manualmente "paid".
Una fattura dovrebbe risultare in tale stato perchè è openerp a deciderlo, dopo aver verificato la riconciliazione completa.
Il deepcopy è pericoloso.
L'autofattura non dovrebbe essere intestata all'azienda stessa? dal vostro codice mi pare che venga intestata al fornitore.
Inoltre penso che se dobbiamo includere nuovi moduli, soprattutto in vista di OpenERP 8.0, dovrebbero rispettare le linee guida OCA, (nuove API OpenERP, PEP8, test automatici, ...)
Francesco Apruzzese (opencode) wrote : | # |
Il 13/03/2014 18:08, Davide Corio @ LS ha scritto:
> Review: Disapprove
>
> Personalmente non sono a favore dello scrivere manualmente "paid".
> Una fattura dovrebbe risultare in tale stato perchè è openerp a deciderlo, dopo aver verificato la riconciliazione completa.
Ovviamente ogni tipo di soluzione è ben accetta se possiamo migliorare
il codice. La decisione riguardo lo stato di pagamento è dovuta al fatto
che per far risultare una fattura pagata dovremmo registrare un
pagamento che in realtà non sarebbe mai stato emesso e pertanto
eventuali riepiloghi risulterebbero sfalsati.
> Il deepcopy è pericoloso.
Non trovo contro-
fuori del contesto) capire perchè.
>
> L'autofattura non dovrebbe essere intestata all'azienda stessa? dal vostro codice mi pare che venga intestata al fornitore.
Voci discordanti. Ma lo si può cambiare in un niente.
>
> Inoltre penso che se dobbiamo includere nuovi moduli, soprattutto in vista di OpenERP 8.0, dovrebbero rispettare le linee guida OCA, (nuove API OpenERP, PEP8, test automatici, ...)
Per le nuove API ok. Per il PEP8 abbiamo cercato di attenerci il più
possibile ma su questo credo che ci sarebbe da aprire un enorme
discussione in piazza poiché neanche i moduli di OpenERP basilari
rispettano la minima regola. I moduli scritti bene si contano davvero
sulle dita di una mano. Sfido chiunque a smentirmi. Se mi dite dove
abbiamo fallato provvediamo a correggere subito. Questi, in fin dei
conti, sono dettagli secondari.
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
On 13 Mar 2014, at 18:51, Francesco Apruzzese <email address hidden> wrote:
> Ovviamente ogni tipo di soluzione è ben accetta se possiamo migliorare
> il codice. La decisione riguardo lo stato di pagamento è dovuta al fatto
> che per far risultare una fattura pagata dovremmo registrare un
> pagamento che in realtà non sarebbe mai stato emesso e pertanto
> eventuali riepiloghi risulterebbero sfalsati.
Temo il contrario.
La fattura fornitore viene riconciliata dal pagamento al fornitore + scrittura integrativa, siccome l'iva deve essere esplicitata sulla fattura intra comunque.
L'autofattura quindi rimarrebbe "scoperta".
ma forse ho compreso male il vostro codice?
> Non trovo contro-
> fuori del contesto) capire perchè.
è pericoloso tanto quanto la funzione duplica di openerp :-)
Penso sarebbe più opportuno avere una funzione tipo _prepare_
>> L'autofattura non dovrebbe essere intestata all'azienda stessa? dal vostro codice mi pare che venga intestata al fornitore.
>
> Voci discordanti. Ma lo si può cambiare in un niente.
Quindi sarebbe necessario avere un riscontro da parte dell'agenzia delle entrate presumo.
> Per le nuove API ok. Per il PEP8 abbiamo cercato di attenerci il più
> possibile ma su questo credo che ci sarebbe da aprire un enorme
> discussione in piazza poiché neanche i moduli di OpenERP basilari
> rispettano la minima regola. I moduli scritti bene si contano davvero
> sulle dita di una mano. Sfido chiunque a smentirmi.
Il fatto che il core di openerp sia scritto male non penso sia un giustificativo valido per continuare a scrivere male il codice.
se osv.osv è deprecato in favore di orm.Model, perchè continuare ad usare il primo?
se è risaputo che spezzare le righe ad 80 colonne aumenta la leggibilità, perchè non farlo?
BTW, questa è ovviamente la mia opinione. Spero che arrivino altri contributi alla revisione di questo modulo.
--
Davide Corio
<email address hidden>
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
On 13 Mar 2014, at 19:12, Davide Corio @ LS <email address hidden> wrote:
> La fattura fornitore viene riconciliata dal pagamento al fornitore + scrittura integrativa, siccome l'iva deve essere esplicitata sulla fattura intra comunque.
o meglio... questo è quello che avevo in mente :)
--
Davide Corio
<email address hidden>
Davide Corio (enlightx-deactivatedaccount) : | # |
Francesco Apruzzese (opencode) wrote : | # |
Il 13/03/2014 19:12, Davide Corio @ LS ha scritto:
> Temo il contrario.
> La fattura fornitore viene riconciliata dal pagamento al fornitore + scrittura integrativa, siccome l'iva deve essere esplicitata sulla fattura intra comunque.
> L'autofattura quindi rimarrebbe "scoperta".
>
> ma forse ho compreso male il vostro codice?
Se hai una fattura fornitore ed una fattura intra e le paghi entrambe
risulta che hai emesso due volte lo stesso importo come pagamento. Il
succo è questo. OpenERP richiede due pagamenti legati alle due fatture
per farle risultare pagate. O forse mi sfugge qualche automatismo?
> è pericoloso tanto quanto la funzione duplica di openerp :-)
In pratica va a finire che non abbiamo scritto un modulo ma una bomba a
mano per quante cose pericolose ci sono dentro. :)
Continuo però a non capire perché deepcopy sia pericoloso ed ora non
capisco neanche perchè la funzione di duplicazione di OpenERP sia
pericolosa. Va bene. C'è pericolo. Ma vorrei sapere perchè. Anche per
conoscenza personale. Sai com'è....
> Quindi sarebbe necessario avere un riscontro da parte dell'agenzia delle entrate presumo.
Il primo che finisce in carcere ci chiama e noi correggiamo il modulo. :)
> Il fatto che il core di openerp sia scritto male non penso sia un giustificativo valido per continuare a scrivere male il codice.
Non mi riferivo al core infatti. Mi riferivo ai moduli. Compresi i
nostri. Basta prenderne qualcuno a campione. Non me ne voglia chi ha
scritto i codici, eh. Sia chiaro. Ma continuo a ripetere che abbiamo
PROVATO a sottostare alle regole PEP8. Se mi dite dove abbiamo sbagliato
correggo. Altrimenti non riesco a seguirvi.
>
> se osv.osv è deprecato in favore di orm.Model, perchè continuare ad usare il primo?
Hai ragione e correggo.
> se è risaputo che spezzare le righe ad 80 colonne aumenta la leggibilità, perchè non farlo?
C'è una sola riga che supera gli 80 caratteri. L'altra è un commento.
Personalmente non ho dato importanza alla cosa poichè la riga più lunga
è di 86 caratteri. Correggo e la prossima volta presterò più attenzione.
> BTW, questa è ovviamente la mia opinione. Spero che arrivino altri contributi alla revisione di questo modulo.
Siamo una community. È giusto che sia così.
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
On 13 Mar 2014, at 19:30, Francesco Apruzzese <email address hidden> wrote:
>
> Se hai una fattura fornitore ed una fattura intra e le paghi entrambe
umh... la fattura fornitore "è" la fattura intra :)
>> C'è pericolo. Ma vorrei sapere perchè. Anche per
> conoscenza personale. Sai com'è....
Semplicemente perchè devi fare attenzione a non copiare cose sbagliate.
Ma qui sta alla bontà di chi scrive il codice.
Ma principalmente ciò che la copia inibisce è la possibilità di intervenire nella creazione del documento.
> C'è una sola riga che supera gli 80 caratteri. L'altra è un commento.
> Personalmente non ho dato importanza alla cosa poichè la riga più lunga
> è di 86 caratteri. Correggo e la prossima volta presterò più attenzione.
Non volevo sindacare sulla qualità del tuo codice, era un riferimento generale, alla scarsa qualità del codice della localizzazione italiana.
Non sono uno sviluppatore, quindi non penso di poter scrivere codice migliore del tuo, ma apprezzo le dinamiche e gli sforzi della comunità internazionale e mi piacerebbe vedere lo stesso nella community italiana.
--
Davide Corio
<email address hidden>
Lorenzo Battistini (elbati) wrote : | # |
Ciao Andrea e grazie per il contributo.
Potresti migliorare la descrizione del modulo aggiungendo una mini guida su come debba essere utilizzato?
Potresti aggiungere anche il copyright dell'associazione
# Copyright (C) 2012 Associazione OpenERP Italia
# (<http://
?
Sarebbe ottimo se riuscissi ad aggiungere anche i test YAML, che aiuterebbero anche a capire le specifiche del modulo.
Per quanto riguarda la scrittura diretta di 'paid' nello stato della fattura, anch'io sono contrario. Facendo così si avrebbe il campo 'stato' incoerente con lo stato del workflow.
Una fattura va nello stato pagato quando tutti i suoi debiti/crediti sono riconciliati.
In questo caso, prendendo l'esempio descritto qui
http://
nella terza registrazione contabile,
'Fornitore in Dare €200 (valore dell’IVA al 20%)'
viene riconciliato parzialmente con i 200 del debito della fattura fornitore, lasciando la fattura aperta per 1000. Quando poi verrano versati quei 1000€ al fornitore, la fattura verrà automaticamente chiusa.
Mentre la fattura cliente si riconcilia subito totalmente con
'Cliente (se stessi per autofattura) in Avere €1200 (il valore della fattura con IVA)'
Lorenzo Battistini (elbati) wrote : | # |
On 03/20/2014 02:39 PM, Lorenzo Battistini - Agile BG wrote:
> Potresti aggiungere anche il copyright dell'associazione
> # Copyright (C) 2012 Associazione OpenERP Italia
> # (<http://
> ?
Copyright (C) 2014 Associazione OpenERP Italia
;-)
Andrea Cometa (scigghia) wrote : | # |
Ciao Lorenzo, la mini guida è presente qui: http://
prendo in considerazione le modifiche proposte, soprattutto relativamente alla gestione dello stato fattura, provvederò a variarlo mediante workflow
- 238. By Andrea Cometa
-
[fix] fix bug residual
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
Se può essere utile, nel mio modulo:
lp:~enlightx/openobject-italia/7.0-reverse-charge-imp
avevo aggiunto i movimenti per riconciliare la parte iva delle fatture di acquisto e delle autofatture.
il codice è ovviamente un po' grezzo, l'ho pubblicato comunque nel caso in cui vi servisse come spunto.
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
NB: mi pareva di aver visto da qualche parte, forse in account_voucher, un metodo che, date due account.move, ti restituiva gli id delle relative account.move.line da riconciliare.
Se non ho preso un abbaglio, potrebbe essere utile per tenere il codice pulito.
Sergio Corato (icsergio) wrote : | # |
Ciao a tutti,
ho testato entrambi i branch e secondo me ci sono idee buone in entrambi.
Per questo ho provato a fare un merge dei due, aggiungendo qualche modifica che farei io, e ho aggiunto un branch alla blue-print (è solo una bozza veloce per capire come farei).
In particolare:
- non legherei la configurazione del reverse alla company ma alle fiscal_position, in modo da poterne creare più di una
- terrei la procedura di creazione per riga nella fattura, in modo da poter escludere delle righe
- legherei la verifica delle righe da duplicare sulla base della presenza o meno nelle stesse dell'IVA reverse, creando quindi il collegamento dell'IVA reverse all'interno dell'IVA normale dedicata (questo implica che una fattura intra-cee ricevuta per essere duplicata deve avere un codice iva acquisto dedicato, direi facilmente fattibile usando le posizioni fiscali nella loro implementazione standard)
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
On 23 Mar 2014, at 21:51, Sergio Corato <email address hidden> wrote:
> - non legherei la configurazione del reverse alla company ma alle fiscal_position, in modo da poterne creare più di una
Mi pareva che tutti e due i branch usassero le posizioni fiscali.
Nel mio avevo messo a livello company alcuni settaggi generici, ma se c’è motivo per averli specifici per posizioni fiscale sono d’accordissimo nello spostarli.
> - terrei la procedura di creazione per riga nella fattura, in modo da poter escludere delle righe
Io avevo messo un flag sulla riga fattura, siccome spesso capita che sulla singola fattura ci siano righe soggette a RC ed altre no.
> - legherei la verifica delle righe da duplicare sulla base della presenza o meno nelle stesse dell'IVA reverse, creando quindi il collegamento dell'IVA reverse all'interno dell'IVA normale dedicata (questo implica che una fattura intra-cee ricevuta per essere duplicata deve avere un codice iva acquisto dedicato, direi facilmente fattibile usando le posizioni fiscali nella loro implementazione standard)
Yes, lo faccio fare a tutti i clienti.
Personalmente, come avevo già commentato, sarei per l’evitare la “duplicazione”.
Preferirei che i dati della fattura e delle righe venissero calcolati con un metodo dedicato, così che sia eventualmente possibile farne l’override per inserire codice custom.
Grazie come sempre per il prezioso supporto.
--
Davide Corio
<email address hidden>
- 239. By Francesco Apruzzese
-
[IMP] Manage payment state for supplier and auto invoice. Full PEP8 compatibility. Copyright assigned to OpenERP Italia Community
Francesco Apruzzese (opencode) wrote : | # |
Il modulo ha subito un forte lavoro di re-implementazione di molte parti.
La configurazione delle varie voci da utilizzare nel flusso è rimasta sulle posizioni fiscali come proposto sopra.
La creazione della struttura della nuova fattura ora è stata inserita in una funzione dedicata così che eventuali moduli di terzi possano ereditare ed estendere tale funzionalità.
Il codice rispetta in pieno le regole definite per PEP8 (tranne una riga ma non mi va di spezzare una stringa per qualche carattere).
Abbiamo cercato, lì dove possibile, di utilizzare le funzioni già presenti nei moduli interessati per evitare di reinventare la ruota.
Ora entrambe le fatture interessate vengono pagate (lì dove dovuto) mediante il normale flusso di OpenERP in maniera totalmente automatica e trasparente.
Il codice ora è sotto copyright della comunità.
La mini guida linkata sopra è ancora valida per chi volesse effettuare i test.
Ci teniamo a precisare che quanto scritto nel modulo è valido solo ed esclusivamente per la gestione fattura Intra CEE. Questo vuol dire che ciò che manca per il Reverse Charge non è una bug o una mancanza ma è volutamente tenuto fuori. Questo vuol dire che il RC dovrà o essere implementato una volta che il modulo risulta utilizzabile o gestito mediante un altro modulo a sè stante.
Lorenzo Battistini (elbati) wrote : | # |
On 03/25/2014 04:18 PM, Francesco Apruzzese wrote:
> Il modulo ha subito un forte lavoro di re-implementazione di molte parti.
Grazie Francesco.
> Il codice ora è sotto copyright della comunità.
Per me potete aggiungere anche il vostro, se volete.
> La mini guida linkata sopra è ancora valida per chi volesse effettuare i test.
Includerei comunque la guida anche nella descrizione del modulo.
>
> Ci teniamo a precisare che quanto scritto nel modulo è valido solo ed esclusivamente per la gestione fattura Intra CEE. Questo vuol dire che ciò che manca per il Reverse Charge non è una bug o una mancanza ma è volutamente tenuto fuori. Questo vuol dire che il RC dovrà o essere implementato una volta che il modulo risulta utilizzabile o gestito mediante un altro modulo a sè stante.
Scusa ma l'autofatturazione non è il meccanismo con cui si gestisce il
reverse charge?
http://
Cosa mancherebbe a questo modulo per gestire il reverse charge?
Francesco Apruzzese (opencode) wrote : | # |
Il 25/03/2014 16:51, Lorenzo Battistini - Agile BG ha scritto:
>
>> La mini guida linkata sopra è ancora valida per chi volesse effettuare i test.
> Includerei comunque la guida anche nella descrizione del modulo.
>
Vediamo come poter fare la cosa al meglio
> Scusa ma l'autofatturazione non è il meccanismo con cui si gestisce il
> reverse charge?
> http://
> Cosa mancherebbe a questo modulo per gestire il reverse charge?
>
>
Da quello che si è potuto appurare, i due strumenti sono diversi:
http://
Ho notato però che l'argomento è un po' particolare. Sarebbe utile
sentire chi di queste cose ne capisce (lungi da me) per capire un attimo
il quadro completo.
Attualmente il nostro modulo non può gestire un reverse charge poichè
questo è pensato per riga di fattura mentre il nostro modulo genere
autofatture per il totale del documento stesso.
- 240. By Francesco Apruzzese
-
[IMP] Managment fro intra CEE, Extra UE Service and Reverse Charge [FIX] PEP8 code. auto invocie payment based on OpenERP Work Flow
Andrea Cometa (scigghia) wrote : | # |
il modulo è stato interamente revisionato, per una guida si può fare riferimento qui: http://
Sergio Corato (icsergio) wrote : | # |
Il 09/04/2014 12:48, Andrea Cometa ha scritto:
> il modulo è stato interamente revisionato, per una guida si può fare riferimento qui: http://
>
Ciao Andrea,
ottimo lavoro, ho fatto alcuni test e segnalo alcune opinioni personali:
1. il campo boolean RC così com'è lascia troppa libertà all'utente, e
allo stesso tempo richiede una certa competenza: io lo eviterei (oppure
renderei readonly, collegato alla presenza o meno della tassa
"auto_invoice_
che hanno una tassa auto_invoice_tax_id collegata alla tassa usata siano
considerate. In tal modo si semplificherebbe anche il lavoro, dato che
le imposte possono essere configurate una volta sola in fase di
installazione.
2. il campo RC deve essere sempre compilato (r. 371)? in tal caso
sarebbe inutile. Invece deve permettere di creare un'autofattura parziale;
3. nella vista delle tasse, il campo aggiuntivo auto_invoice_tax_id
dovrebbe essere visibile solo in quelle di tipo acquisto, in quanto
tutte le procedure di reverse charge partono dalla fattura di acquisto.
Lasciare il campo anche nelle tasse di tipo vendita confonde l'utente.
--
Sergio Corato
Didotech.com - Icstools.it
web : www.didotech.com
blog : www.icstools.it
skype : sergiocorato
mail : <email address hidden>
- 241. By Francesco Apruzzese
-
[FIX] Delete payment for auto invoice
- 242. By Francesco Apruzzese
-
[FIX] Hide auto invoice tax in sale taxes [IMP] PEP8
Lorenzo Battistini (elbati) wrote : | # |
On 04/30/2014 02:41 PM, Alessandro Camilli wrote:
> The proposal to merge lp:~coopenerp/openobject-italia/7.0-adding-intra-cee into lp:openobject-italia/7.0 has been updated.
>
> Status: Needs review => Approved
Alessandro, se vuoi fare una review positiva, dovresti aggiungere un
commento (anche vuoto) con review: approve
Francesco, se fai delle modifiche al branch (e quindi alla MP) , tipo la
242
<http://
che vuoi che vengano revisionate, dovresti mandare un commento sulla MP,
altrimenti non veniamo notificati delle modifiche.
Grazie
Lorenzo Battistini (elbati) wrote : | # |
This project is now hosted on https:/
Unmerged revisions
- 242. By Francesco Apruzzese
-
[FIX] Hide auto invoice tax in sale taxes [IMP] PEP8
- 241. By Francesco Apruzzese
-
[FIX] Delete payment for auto invoice
- 240. By Francesco Apruzzese
-
[IMP] Managment fro intra CEE, Extra UE Service and Reverse Charge [FIX] PEP8 code. auto invocie payment based on OpenERP Work Flow
- 239. By Francesco Apruzzese
-
[IMP] Manage payment state for supplier and auto invoice. Full PEP8 compatibility. Copyright assigned to OpenERP Italia Community
- 238. By Andrea Cometa
-
[fix] fix bug residual
- 237. By Francesco Apruzzese
-
[ADD] Module l10n_it_
invoice_ intra_cee
Preview Diff
1 | === added directory 'l10n_it_invoice_intra_cee' |
2 | === added file 'l10n_it_invoice_intra_cee/AUTHORS.txt' |
3 | --- l10n_it_invoice_intra_cee/AUTHORS.txt 1970-01-01 00:00:00 +0000 |
4 | +++ l10n_it_invoice_intra_cee/AUTHORS.txt 2014-04-29 13:17:07 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +Francesco Apruzzese <support@coopenerp.it> |
7 | +Andrea Gallina <support@coopenerp.it> |
8 | |
9 | === added file 'l10n_it_invoice_intra_cee/__init__.py' |
10 | --- l10n_it_invoice_intra_cee/__init__.py 1970-01-01 00:00:00 +0000 |
11 | +++ l10n_it_invoice_intra_cee/__init__.py 2014-04-29 13:17:07 +0000 |
12 | @@ -0,0 +1,24 @@ |
13 | +# -*- coding: utf-8 -*- |
14 | +############################################################################## |
15 | +# |
16 | +# Copyright (C) 2014 Associazione OpenERP Italia |
17 | +# (<http://www.openerp-italia.org>) |
18 | +# All Rights Reserved |
19 | +# |
20 | +# This program is free software: you can redistribute it and/or modify |
21 | +# it under the terms of the GNU Affero General Public License as published |
22 | +# by the Free Software Foundation, either version 3 of the License, or |
23 | +# (at your option) any later version. |
24 | +# |
25 | +# This program is distributed in the hope that it will be useful, |
26 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
27 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
28 | +# GNU Affero General Public License for more details. |
29 | +# |
30 | +# You should have received a copy of the GNU Affero General Public License |
31 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
32 | +# |
33 | +############################################################################## |
34 | + |
35 | +import company |
36 | +import account |
37 | |
38 | === added file 'l10n_it_invoice_intra_cee/__openerp__.py' |
39 | --- l10n_it_invoice_intra_cee/__openerp__.py 1970-01-01 00:00:00 +0000 |
40 | +++ l10n_it_invoice_intra_cee/__openerp__.py 2014-04-29 13:17:07 +0000 |
41 | @@ -0,0 +1,41 @@ |
42 | +# -*- coding: utf-8 -*- |
43 | +############################################################################## |
44 | +# |
45 | +# Copyright (C) 2014 Associazione OpenERP Italia |
46 | +# (<http://www.openerp-italia.org>) |
47 | +# All Rights Reserved |
48 | +# |
49 | +# This program is free software: you can redistribute it and/or modify |
50 | +# it under the terms of the GNU Affero General Public License as published |
51 | +# by the Free Software Foundation, either version 3 of the License, or |
52 | +# (at your option) any later version. |
53 | +# |
54 | +# This program is distributed in the hope that it will be useful, |
55 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
56 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
57 | +# GNU Affero General Public License for more details. |
58 | +# |
59 | +# You should have received a copy of the GNU Affero General Public License |
60 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
61 | +# |
62 | +############################################################################## |
63 | + |
64 | +{ |
65 | + 'name': "Invoice Intra CEE", |
66 | + 'version': '0.1', |
67 | + 'category': 'Account', |
68 | + 'description': """Manage Invoice for Intra CEE supplier""", |
69 | + 'author': 'CoOpenERP <info@coopenerp.it>', |
70 | + 'website': 'http://www.coopenerp.it', |
71 | + 'license': 'AGPL-3', |
72 | + "depends": ['base', 'account', 'account_voucher', 'account_cancel'], |
73 | + "init_xml": [], |
74 | + "update_xml": [ |
75 | + 'company/company_view.xml', |
76 | + 'account/account_view.xml', |
77 | + 'account/account_data.xml', |
78 | + ], |
79 | + "demo_xml": [], |
80 | + "active": False, |
81 | + "installable": True |
82 | +} |
83 | |
84 | === added directory 'l10n_it_invoice_intra_cee/account' |
85 | === added file 'l10n_it_invoice_intra_cee/account/__init__.py' |
86 | --- l10n_it_invoice_intra_cee/account/__init__.py 1970-01-01 00:00:00 +0000 |
87 | +++ l10n_it_invoice_intra_cee/account/__init__.py 2014-04-29 13:17:07 +0000 |
88 | @@ -0,0 +1,23 @@ |
89 | +# -*- coding: utf-8 -*- |
90 | +############################################################################## |
91 | +# |
92 | +# Copyright (C) 2014 Associazione OpenERP Italia |
93 | +# (<http://www.openerp-italia.org>) |
94 | +# All Rights Reserved |
95 | +# |
96 | +# This program is free software: you can redistribute it and/or modify |
97 | +# it under the terms of the GNU Affero General Public License as published |
98 | +# by the Free Software Foundation, either version 3 of the License, or |
99 | +# (at your option) any later version. |
100 | +# |
101 | +# This program is distributed in the hope that it will be useful, |
102 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
103 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
104 | +# GNU Affero General Public License for more details. |
105 | +# |
106 | +# You should have received a copy of the GNU Affero General Public License |
107 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
108 | +# |
109 | +############################################################################## |
110 | + |
111 | +import account |
112 | |
113 | === added file 'l10n_it_invoice_intra_cee/account/account.py' |
114 | --- l10n_it_invoice_intra_cee/account/account.py 1970-01-01 00:00:00 +0000 |
115 | +++ l10n_it_invoice_intra_cee/account/account.py 2014-04-29 13:17:07 +0000 |
116 | @@ -0,0 +1,539 @@ |
117 | +# -*- coding: utf-8 -*- |
118 | +############################################################################## |
119 | +# |
120 | +# Copyright (C) 2014 Associazione OpenERP Italia |
121 | +# (<http://www.openerp-italia.org>) |
122 | +# All Rights Reserved |
123 | +# |
124 | +# This program is free software: you can redistribute it and/or modify |
125 | +# it under the terms of the GNU Affero General Public License as published |
126 | +# by the Free Software Foundation, either version 3 of the License, or |
127 | +# (at your option) any later version. |
128 | +# |
129 | +# This program is distributed in the hope that it will be useful, |
130 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
131 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
132 | +# GNU Affero General Public License for more details. |
133 | +# |
134 | +# You should have received a copy of the GNU Affero General Public License |
135 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
136 | +# |
137 | +############################################################################## |
138 | + |
139 | +from osv import fields, osv |
140 | +from openerp import netsvc |
141 | +from tools.translate import _ |
142 | +import openerp.addons.decimal_precision as dp |
143 | +from urllib import urlencode, quote as quote |
144 | + |
145 | +import logging |
146 | +_logger = logging.getLogger(__name__) |
147 | + |
148 | +try: |
149 | + # We use a jinja2 sandboxed environment to render mako templates. |
150 | + from jinja2.sandbox import SandboxedEnvironment |
151 | + mako_template_env = SandboxedEnvironment( |
152 | + block_start_string="<%", |
153 | + block_end_string="%>", |
154 | + variable_start_string="${", |
155 | + variable_end_string="}", |
156 | + comment_start_string="<%doc>", |
157 | + comment_end_string="</%doc>", |
158 | + line_statement_prefix="%", |
159 | + line_comment_prefix="##", |
160 | + trim_blocks=True, |
161 | + autoescape=True, |
162 | + ) |
163 | + mako_template_env.globals.update({ |
164 | + 'str': str, |
165 | + 'quote': quote, |
166 | + 'urlencode': urlencode, |
167 | + }) |
168 | +except ImportError: |
169 | + _logger.warning( |
170 | + "jinja2 not available, autofilling features will not work!") |
171 | + |
172 | + |
173 | +class account_fiscal_position(osv.osv): |
174 | + |
175 | + _inherit = 'account.fiscal.position' |
176 | + |
177 | + _columns = { |
178 | + 'account_transient_id': fields.many2one( |
179 | + 'account.account', 'Account CEE'), |
180 | + 'journal_auto_invoice_id': fields.many2one( |
181 | + 'account.journal', 'Journal Auto Invoice CEE'), |
182 | + 'journal_transfer_entry_id': fields.many2one( |
183 | + 'account.journal', |
184 | + 'Transfer Entry Journal'), |
185 | + 'active_intra_cee': fields.boolean('Active Intra CEE Management'), |
186 | + 'active_reverse_charge': fields.boolean( |
187 | + 'Active Reverse Charge Management'), |
188 | + 'active_extra_ue_service': fields.boolean( |
189 | + 'Active Extra UE Service Management'), |
190 | + 'extra_ue_line_detail': fields.text( |
191 | + 'Extra UE Line Detail', |
192 | + help='Text used as description line in Extra UE Auto Invoice'), |
193 | + 'extra_ue_service_tax_id': fields.many2one( |
194 | + 'account.tax', |
195 | + 'Extra UE Service Tax'), |
196 | + } |
197 | + |
198 | + def _check_active_type_value(self, cr, uid, ids, context=None): |
199 | + for afp in self.browse(cr, uid, ids, context): |
200 | + flag = 0 |
201 | + if afp.active_intra_cee: |
202 | + flag += 1 |
203 | + if afp.active_reverse_charge: |
204 | + flag += 1 |
205 | + if afp.active_extra_ue_service: |
206 | + flag += 1 |
207 | + if flag > 1: |
208 | + return False |
209 | + return True |
210 | + |
211 | + _constraints = [ |
212 | + (_check_active_type_value, |
213 | + 'Error!\nYou cannot create select two or more flag for time', |
214 | + ['active_intra_cee', 'active_reverse_charge', |
215 | + 'active_extra_ue_service']), |
216 | + ] |
217 | + |
218 | + |
219 | +class account_tax(osv.osv): |
220 | + |
221 | + _inherit = 'account.tax' |
222 | + |
223 | + _columns = { |
224 | + 'auto_invoice_tax_id': fields.many2one('account.tax', |
225 | + 'Auto Invoice Tax'), |
226 | + } |
227 | + |
228 | + |
229 | +class account_invoice_line(osv.osv): |
230 | + |
231 | + _inherit = 'account.invoice.line' |
232 | + |
233 | + _columns = { |
234 | + 'reverse_charge': fields.boolean("RC"), |
235 | + } |
236 | + |
237 | + |
238 | +class account_invoice(osv.osv): |
239 | + |
240 | + _inherit = 'account.invoice' |
241 | + |
242 | + def render_description(self, cr, uid, description, invoice_id, |
243 | + context=None): |
244 | + if not description: |
245 | + return u"" |
246 | + if context is None: |
247 | + context = {} |
248 | + try: |
249 | + invoice = self.browse(cr, uid, invoice_id, context=context) |
250 | + user = self.pool.get('res.users').browse(cr, uid, uid, context) |
251 | + variables = { |
252 | + 'object': invoice, |
253 | + 'user': user, |
254 | + 'ctx': context, |
255 | + } |
256 | + result = mako_template_env.from_string( |
257 | + description).render(variables) |
258 | + if result == u"False": |
259 | + result = u"" |
260 | + return result |
261 | + except Exception: |
262 | + _logger.exception("failed to render description %r", description) |
263 | + return u"" |
264 | + |
265 | + def _auto_invoice_amount_all(self, cr, uid, ids, name, args, context=None): |
266 | + res = {} |
267 | + tax_obj = self.pool.get('account.tax') |
268 | + for invoice in self.browse(cr, uid, ids, context=context): |
269 | + fp = invoice.fiscal_position |
270 | + res[invoice.id] = { |
271 | + 'auto_invoice_amount_untaxed': 0.0, |
272 | + 'auto_invoice_amount_tax': 0.0, |
273 | + 'auto_invoice_amount_total': 0.0 |
274 | + } |
275 | + for line in invoice.invoice_line: |
276 | + if fp and fp.active_reverse_charge and line.reverse_charge: |
277 | + res[invoice.id][ |
278 | + 'auto_invoice_amount_untaxed'] += line.price_subtotal |
279 | + for t in tax_obj.compute_all( |
280 | + cr, uid, line.invoice_line_tax_id, |
281 | + (line.price_unit * (1-( |
282 | + line.discount or 0.0)/100.0)), |
283 | + line.quantity, line.product_id)['taxes']: |
284 | + res[invoice.id][ |
285 | + 'auto_invoice_amount_tax'] += t['amount'] |
286 | + if (not fp) or (fp and not fp.active_reverse_charge): |
287 | + res[invoice.id][ |
288 | + 'auto_invoice_amount_untaxed'] += line.price_subtotal |
289 | + for t in tax_obj.compute_all( |
290 | + cr, uid, line.invoice_line_tax_id, |
291 | + (line.price_unit * (1-( |
292 | + line.discount or 0.0)/100.0)), |
293 | + line.quantity, line.product_id)['taxes']: |
294 | + res[invoice.id][ |
295 | + 'auto_invoice_amount_tax'] += t['amount'] |
296 | + res[invoice.id]['auto_invoice_amount_total'] = res[ |
297 | + invoice.id]['auto_invoice_amount_tax'] + res[ |
298 | + invoice.id]['auto_invoice_amount_untaxed'] |
299 | + return res |
300 | + |
301 | + _columns = { |
302 | + 'transfer_entry_id': fields.many2one('account.move', |
303 | + 'Transfer Entry', |
304 | + ondelete="set null"), |
305 | + 'auto_invoice_id': fields.many2one('account.invoice', |
306 | + 'Auto Invoice', |
307 | + ondelete="set null"), |
308 | + 'auto_invoice_amount_untaxed': fields.function( |
309 | + _auto_invoice_amount_all, |
310 | + digits_compute=dp.get_precision('Account'), |
311 | + string='Auto Invoice Subtotal', store=False, |
312 | + multi='auto_invoice_all'), |
313 | + 'auto_invoice_amount_tax': fields.function( |
314 | + _auto_invoice_amount_all, |
315 | + digits_compute=dp.get_precision('Account'), |
316 | + string='Auto Invoice Tax', store=False, multi='auto_invoice_all'), |
317 | + 'auto_invoice_amount_total': fields.function( |
318 | + _auto_invoice_amount_all, |
319 | + digits_compute=dp.get_precision('Account'), |
320 | + string='Auto Invoice Total', store=False, |
321 | + multi='auto_invoice_all'), |
322 | + } |
323 | + |
324 | + def voucher_from_invoice(self, cr, uid, invoice_id, amount, |
325 | + journal_id, voucher_type='payment', |
326 | + context=None): |
327 | + context = context or {} |
328 | + voucher_obj = self.pool.get('account.voucher') |
329 | + invoice = self.browse(cr, uid, invoice_id, context) |
330 | + # ----- Voucher Header |
331 | + voucher_id = voucher_obj.create(cr, uid, { |
332 | + 'name': invoice.name, |
333 | + 'partner_id': invoice.partner_id.id, |
334 | + 'amount': amount, |
335 | + 'journal_id': journal_id, |
336 | + 'account_id': invoice.account_id.id, |
337 | + 'type': voucher_type, |
338 | + }) |
339 | + move_line_ids = [] |
340 | + # ----- Extract all the move lines from new invoice |
341 | + for l in invoice.move_id.line_id: |
342 | + if l.date_maturity: |
343 | + move_line_ids.append(l.id) |
344 | + context.update({ |
345 | + 'move_line_ids': move_line_ids, |
346 | + 'invoice_id': invoice.id, |
347 | + }) |
348 | + # ----- Voucher Lines |
349 | + voucher_lines = voucher_obj.recompute_voucher_lines( |
350 | + cr, uid, [voucher_id], invoice.partner_id.id, |
351 | + invoice.journal_id.id, amount, |
352 | + invoice.currency_id.id, voucher_type, |
353 | + invoice.date_invoice, context) |
354 | + voucher_lines_cr = [] |
355 | + voucher_lines_dr = [] |
356 | + for voucher_line in voucher_lines['value']['line_dr_ids']: |
357 | + voucher_lines_dr.append((0, 0, voucher_line)) |
358 | + for voucher_line in voucher_lines['value']['line_cr_ids']: |
359 | + voucher_lines_cr.append((0, 0, voucher_line)) |
360 | + voucher_obj.write(cr, uid, [voucher_id, ], { |
361 | + 'line_dr_ids': voucher_lines_dr, |
362 | + 'line_cr_ids': voucher_lines_cr, |
363 | + 'pre_line': voucher_lines['value']['pre_line'], |
364 | + 'writeoff_amount': voucher_lines['value']['writeoff_amount'], |
365 | + }, context) |
366 | + # ----- Post Voucher |
367 | + voucher_obj.button_proforma_voucher(cr, uid, [voucher_id, ], |
368 | + context) |
369 | + return voucher_id |
370 | + |
371 | + def _get_tax_relation(self, cr, uid, invoice_id, context=None): |
372 | + # ----- keep relation between tax and relative intra cee tax |
373 | + tax_relation = {} |
374 | + inv = self.browse(cr, uid, invoice_id) |
375 | + for line in inv.invoice_line: |
376 | + # ----- Check if tax has autoinvoice tax |
377 | + for tax in line.invoice_line_tax_id: |
378 | + tax_relation.update( |
379 | + {tax.id: tax.auto_invoice_tax_id.id}) |
380 | + return tax_relation |
381 | + |
382 | + def auto_invoice_vals(self, cr, uid, invoice_id, fiscal_position_id, |
383 | + context=None): |
384 | + context = context or {} |
385 | + invoice = self.browse(cr, uid, invoice_id, context) |
386 | + fp_id = fiscal_position_id or invoice.fiscal_position.id |
387 | + fiscal_position = self.pool.get('account.fiscal.position').browse( |
388 | + cr, uid, fp_id, context) |
389 | + # ----- Get actual invoice copy |
390 | + copy_inv = self.copy_data(cr, uid, invoice_id, {}, context) |
391 | + if not copy_inv: |
392 | + return {} |
393 | + new_inv = copy_inv.copy() |
394 | + # ----- Change some data in new invoice |
395 | + new_inv.update({ |
396 | + 'type': invoice.type.replace('in_', 'out_'), |
397 | + 'origin': invoice.number or '', |
398 | + 'supplier_invoice_number': '', |
399 | + 'internal_number': '', |
400 | + 'number': '', |
401 | + 'state': 'draft', |
402 | + 'move_id': False, |
403 | + 'account_id': invoice.partner_id.property_account_receivable.id, |
404 | + 'journal_id': fiscal_position.journal_auto_invoice_id.id, |
405 | + }) |
406 | + new_line = [] |
407 | + tax_relation = self._get_tax_relation(cr, uid, invoice_id, context) |
408 | + for line in new_inv['invoice_line']: |
409 | + vals = line[2].copy() |
410 | + # ----- Change account in new invoice line |
411 | + vals['account_id'] = fiscal_position.account_transient_id.id |
412 | + # ----- Change tax in new invoice line |
413 | + new_tax = [] |
414 | + for tax in vals['invoice_line_tax_id']: |
415 | + new_tax.append((6, 0, [tax_relation[tax[2][0]]])) |
416 | + vals['invoice_line_tax_id'] = new_tax |
417 | + new_line.append((0, 0, vals)) |
418 | + new_inv['invoice_line'] = new_line |
419 | + return new_inv |
420 | + |
421 | + def rc_auto_invoice_vals(self, cr, uid, invoice_id, fiscal_position_id, |
422 | + context=None): |
423 | + # ----- Get complete invoice copy |
424 | + res = self.auto_invoice_vals(cr, uid, invoice_id, |
425 | + fiscal_position_id, context) |
426 | + # ----- Get partner from company for auto invoice |
427 | + company = self.pool.get('res.users').browse( |
428 | + cr, uid, uid, context).company_id |
429 | + res['partner_id'] = company.auto_invoice_partner_id and \ |
430 | + company.auto_invoice_partner_id.id \ |
431 | + or company.partner_id and company.partner_id.id |
432 | + # ----- Delete line without reverse charge flag |
433 | + rc_lines = [] |
434 | + for line in res['invoice_line']: |
435 | + if line[2]['reverse_charge']: |
436 | + rc_lines.append(line) |
437 | + res['invoice_line'] = rc_lines |
438 | + return res |
439 | + |
440 | + def extra_ue_auto_invoice_vals(self, cr, uid, invoice_id, |
441 | + fiscal_position_id, context=None): |
442 | + # ----- Get complete invoice copy |
443 | + res = self.auto_invoice_vals(cr, uid, invoice_id, |
444 | + fiscal_position_id, context) |
445 | + # ----- Get partner from company for auto invoice |
446 | + company = self.pool.get('res.users').browse( |
447 | + cr, uid, uid, context).company_id |
448 | + res['partner_id'] = company.auto_invoice_partner_id and \ |
449 | + company.auto_invoice_partner_id.id \ |
450 | + or company.partner_id and company.partner_id.id |
451 | + # ----- Get right lines |
452 | + invoice = self.browse(cr, uid, invoice_id, context) |
453 | + fp_id = fiscal_position_id or invoice.fiscal_position.id |
454 | + fiscal_position = self.pool.get('account.fiscal.position').browse( |
455 | + cr, uid, fp_id, context) |
456 | + product_obj = self.pool.get('product.product') |
457 | + total = 0.0 |
458 | + for line in res['invoice_line']: |
459 | + product = line[2]['product_id'] and product_obj.browse( |
460 | + cr, uid, line[2]['product_id']) or False |
461 | + if product and product.type == 'service' or not product: |
462 | + price_subtotal = line[2]['price_unit'] * ( |
463 | + 1-(line[2]['discount'] or 0.0)/100.0) |
464 | + total += price_subtotal * line[2]['quantity'] |
465 | + if not total: |
466 | + return False |
467 | + d = fiscal_position.extra_ue_line_detail |
468 | + res['invoice_line'] = [(0, 0, { |
469 | + 'name': self.render_description(cr, uid, d, invoice_id, context), |
470 | + 'price_unit': total, |
471 | + 'quantity': 1, |
472 | + 'account_id': fiscal_position.account_transient_id.id, |
473 | + 'invoice_line_tax_id': [ |
474 | + (6, 0, [fiscal_position.extra_ue_service_tax_id.id])] |
475 | + })] |
476 | + return res |
477 | + |
478 | + def create_auto_invoice(self, cr, uid, ids, context=None): |
479 | + context = context or {} |
480 | + new_invoice_ids = [] |
481 | + move_obj = self.pool.get('account.move') |
482 | + wf_service = netsvc.LocalService("workflow") |
483 | + for inv in self.browse(cr, uid, ids, context): |
484 | + # ----- Apply Auto Invoice only on supplier invoice/refund |
485 | + if not (inv.type == 'in_invoice' or inv.type == 'in_refund'): |
486 | + continue |
487 | + fiscal_position = inv.fiscal_position |
488 | + # ----- Check if fiscal positon is active for intra CEE invoice |
489 | + if not fiscal_position: |
490 | + continue |
491 | + if not (fiscal_position.active_intra_cee or |
492 | + fiscal_position.active_reverse_charge or |
493 | + fiscal_position.active_extra_ue_service): |
494 | + continue |
495 | + # ----- keep relation between tax and relative intra cee tax |
496 | + for line in inv.invoice_line: |
497 | + # ----- Check if taxes exist on each line |
498 | + if not line.invoice_line_tax_id: |
499 | + raise osv.except_osv( |
500 | + _('Error'), |
501 | + _('You must define a tax for each line \ |
502 | + in Intra CEE Invoice')) |
503 | + # ----- Check if tax has autoinvoice tax |
504 | + for tax in line.invoice_line_tax_id: |
505 | + if not tax.auto_invoice_tax_id: |
506 | + raise osv.except_osv( |
507 | + _('Error'), |
508 | + _('Set an Auto Invoice Tax for tax %s') % ( |
509 | + tax.name)) |
510 | + # ----- Get actual invoice copy based on fiscal position flag |
511 | + if fiscal_position.active_intra_cee: |
512 | + new_inv = self.auto_invoice_vals(cr, uid, inv.id, |
513 | + fiscal_position.id, |
514 | + context) |
515 | + elif fiscal_position.active_reverse_charge: |
516 | + new_inv = self.rc_auto_invoice_vals(cr, uid, inv.id, |
517 | + fiscal_position.id, |
518 | + context) |
519 | + elif fiscal_position.active_extra_ue_service: |
520 | + new_inv = self.extra_ue_auto_invoice_vals( |
521 | + cr, uid, inv.id, fiscal_position.id, context) |
522 | + if not new_inv: |
523 | + continue |
524 | + # ----- Create Auto Invoice...Yeah!!!!! |
525 | + auto_invoice_id = self.create(cr, uid, new_inv, context) |
526 | + new_invoice_ids.append(auto_invoice_id) |
527 | + # ----- Recompute taxes in new invoice |
528 | + self.button_reset_taxes(cr, uid, [auto_invoice_id], context) |
529 | + # ----- Validate invoice |
530 | + wf_service.trg_validate(uid, 'account.invoice', |
531 | + auto_invoice_id, 'invoice_open', cr) |
532 | + # ----- Get new values from auto invoice |
533 | + new_invoice = self.browse(cr, uid, auto_invoice_id, context) |
534 | + # ----- |
535 | + # Create tranfer entry movements |
536 | + # ----- |
537 | + account_move_line_vals = [] |
538 | + # ----- Tax for supplier |
539 | + debit_1 = credit_1 = 0.0 |
540 | + debit_2 = credit_2 = 0.0 |
541 | + debit_3 = credit_3 = 0.0 |
542 | + if inv.type == 'in_invoice': |
543 | + debit_1 = inv.auto_invoice_amount_tax |
544 | + debit_2 = inv.auto_invoice_amount_untaxed |
545 | + credit_3 = inv.auto_invoice_amount_total |
546 | + else: |
547 | + credit_1 = inv.auto_invoice_amount_tax |
548 | + credit_2 = inv.auto_invoice_amount_untaxed |
549 | + debit_3 = inv.auto_invoice_amount_total |
550 | + account_move_line_vals.append((0, 0, { |
551 | + 'name': 'Tax for Supplier', |
552 | + 'debit': debit_1, |
553 | + 'credit': credit_1, |
554 | + 'partner_id': new_invoice.partner_id.id, |
555 | + 'account_id': new_invoice.partner_id.property_account_payable.id, |
556 | + })) |
557 | + # ----- Products values |
558 | + account_move_line_vals.append((0, 0, { |
559 | + 'name': 'Products', |
560 | + 'debit': debit_2, |
561 | + 'credit': credit_2, |
562 | + 'partner_id': new_invoice.partner_id.id, |
563 | + 'account_id': fiscal_position.account_transient_id.id, |
564 | + })) |
565 | + # ----- Invoice Total |
566 | + account_move_line_vals.append((0, 0, { |
567 | + 'name': 'Invoice Total', |
568 | + 'debit': debit_3, |
569 | + 'credit': credit_3, |
570 | + 'partner_id': new_invoice.partner_id.id, |
571 | + 'account_id': new_invoice.partner_id.property_account_receivable.id, |
572 | + })) |
573 | + # ----- Account Move |
574 | + account_move_vals = { |
575 | + 'name': '/', |
576 | + 'state': 'draft', |
577 | + 'journal_id': fiscal_position.journal_transfer_entry_id.id, |
578 | + 'line_id': account_move_line_vals, |
579 | + } |
580 | + transfer_entry_id = move_obj.create( |
581 | + cr, uid, account_move_vals, context) |
582 | + move_obj.post(cr, uid, [transfer_entry_id], context) |
583 | + # ----- Link the tranfer entry move and auto invoice |
584 | + # to supplier invoice |
585 | + self.write(cr, uid, [inv.id], |
586 | + {'auto_invoice_id': auto_invoice_id, |
587 | + 'transfer_entry_id': transfer_entry_id}) |
588 | + # ----- Pay Autoinvoice |
589 | + self.voucher_from_invoice( |
590 | + cr, uid, new_invoice.id, new_invoice.amount_total, |
591 | + fiscal_position.journal_transfer_entry_id.id, 'receipt', |
592 | + context) |
593 | + # ---- Create a payment for vat of supplier invoice |
594 | + self.voucher_from_invoice( |
595 | + cr, uid, inv.id, inv.auto_invoice_amount_tax, |
596 | + fiscal_position.journal_transfer_entry_id.id, |
597 | + 'payment', context) |
598 | + return new_invoice_ids |
599 | + |
600 | + def action_number(self, cr, uid, ids, context=None): |
601 | + res = super(account_invoice, self).action_number(cr, uid, |
602 | + ids, context) |
603 | + self.create_auto_invoice(cr, uid, ids, context) |
604 | + return res |
605 | + |
606 | + def action_cancel(self, cr, uid, ids, context=None): |
607 | + invoices = self.browse(cr, uid, ids, context) |
608 | + account_move = self.pool.get('account.move') |
609 | + voucher_obj = self.pool.get('account.voucher') |
610 | + wf_service = netsvc.LocalService("workflow") |
611 | + move_ids = [] |
612 | + for inv in invoices: |
613 | + # ----- Delete Auto Invoice |
614 | + if inv.auto_invoice_id: |
615 | + # ----- Delete Payments for suppier invoice |
616 | + if len(inv.payment_ids) > 1: |
617 | + raise osv.except_osv( |
618 | + _('Error!'), |
619 | + _('You cannot cancel an invoice which is partially \ |
620 | + paid. You need to unreconcile related payment entries \ |
621 | + first.')) |
622 | + payment_ids = [] |
623 | + for payment in inv.payment_ids: |
624 | + voucher_ids = voucher_obj.search( |
625 | + cr, uid, [('move_id', '=', payment.move_id.id)]) |
626 | + if not voucher_ids: |
627 | + continue |
628 | + payment_ids = payment_ids + voucher_ids |
629 | + # ----- Delete Payments for auto invoice |
630 | + for payment in inv.auto_invoice_id.payment_ids: |
631 | + voucher_ids = voucher_obj.search( |
632 | + cr, uid, [('move_id', '=', payment.move_id.id)]) |
633 | + if not voucher_ids: |
634 | + continue |
635 | + payment_ids = payment_ids + voucher_ids |
636 | + if payment_ids: |
637 | + voucher_obj.cancel_voucher( |
638 | + cr, uid, payment_ids, context) |
639 | + voucher_obj.unlink(cr, uid, payment_ids, context) |
640 | + # ---- Delete Invoice |
641 | + wf_service.trg_validate(uid, 'account.invoice', |
642 | + inv.auto_invoice_id.id, |
643 | + 'invoice_cancel', cr) |
644 | + self.action_cancel_draft( |
645 | + cr, uid, [inv.auto_invoice_id.id]) |
646 | + self.unlink(cr, uid, [inv.auto_invoice_id.id], context) |
647 | + # ----- Save account move ids |
648 | + if inv.transfer_entry_id: |
649 | + move_ids.append(inv.transfer_entry_id.id) |
650 | + # ----- Reopen and delete account move |
651 | + if move_ids: |
652 | + account_move.button_cancel(cr, uid, move_ids, context) |
653 | + account_move.unlink(cr, uid, move_ids, context) |
654 | + return super(account_invoice, self).action_cancel( |
655 | + cr, uid, ids, context) |
656 | |
657 | === added file 'l10n_it_invoice_intra_cee/account/account_data.xml' |
658 | --- l10n_it_invoice_intra_cee/account/account_data.xml 1970-01-01 00:00:00 +0000 |
659 | +++ l10n_it_invoice_intra_cee/account/account_data.xml 2014-04-29 13:17:07 +0000 |
660 | @@ -0,0 +1,32 @@ |
661 | +<?xml version="1.0" encoding="utf-8"?> |
662 | +<openerp> |
663 | + <data noupdate="1"> |
664 | + |
665 | + <record id="auto_invoice_journal_sequence" model="ir.sequence"> |
666 | + <field name="name">Auto Invoice Journal Sequence</field> |
667 | + <field eval="3" name="padding"/> |
668 | + <field name="implementation">no_gap</field> |
669 | + <field name="prefix">AIJ/%(year)s/</field> |
670 | + </record> |
671 | + <record id="transfert_entry_journal_sequence" model="ir.sequence"> |
672 | + <field name="name">Transfert Entry Journal Sequence</field> |
673 | + <field eval="3" name="padding"/> |
674 | + <field name="implementation">no_gap</field> |
675 | + <field name="prefix">TEJ/%(year)s/</field> |
676 | + </record> |
677 | + |
678 | + <record forcecreate="1" id="auto_invoice_journal" model="account.journal"> |
679 | + <field name="name">Auto Invoice Journal</field> |
680 | + <field name="code">AIJ</field> |
681 | + <field name="type">sale</field> |
682 | + <field name="sequence_id" ref="auto_invoice_journal_sequence"/> |
683 | + </record> |
684 | + <record forcecreate="1" id="transfert_entry_invoice_journal" model="account.journal"> |
685 | + <field name="name">Transfert Entry Journal</field> |
686 | + <field name="code">TEJ</field> |
687 | + <field name="type">general</field> |
688 | + <field name="sequence_id" ref="transfert_entry_journal_sequence"/> |
689 | + </record> |
690 | + |
691 | + </data> |
692 | +</openerp> |
693 | |
694 | === added file 'l10n_it_invoice_intra_cee/account/account_view.xml' |
695 | --- l10n_it_invoice_intra_cee/account/account_view.xml 1970-01-01 00:00:00 +0000 |
696 | +++ l10n_it_invoice_intra_cee/account/account_view.xml 2014-04-29 13:17:07 +0000 |
697 | @@ -0,0 +1,89 @@ |
698 | +<?xml version="1.0" encoding="utf-8"?> |
699 | +<openerp> |
700 | +<data> |
701 | + |
702 | + <!-- FISCAL POSITION FORM --> |
703 | + |
704 | + <record id="intra_cee_view_account_position_form" model="ir.ui.view"> |
705 | + <field name="name">intra_cee.account_position.form</field> |
706 | + <field name="model">account.fiscal.position</field> |
707 | + <field name="inherit_id" ref="account.view_account_position_form"/> |
708 | + <field name="arch" type="xml"> |
709 | + <xpath expr="/form/separator[@string='Taxes Mapping']" position="before"> |
710 | + <group> |
711 | + <separator string="Intra CEE Configuration" colspan="4" /> |
712 | + <group col="6"> |
713 | + <field name="active_intra_cee" /> |
714 | + <field name="active_reverse_charge" /> |
715 | + <field name="active_extra_ue_service" /> |
716 | + </group> |
717 | + </group> |
718 | + <group> |
719 | + <group col="6"> |
720 | + <field name="account_transient_id" |
721 | + attrs="{'required':['|', '|', ('active_intra_cee', '=', True), ('active_reverse_charge', '=', True), ('active_extra_ue_service', '=', True)]}"/> |
722 | + <field name="journal_transfer_entry_id" |
723 | + attrs="{'required':['|', '|', ('active_intra_cee', '=', True), ('active_reverse_charge', '=', True), ('active_extra_ue_service', '=', True)]}"/> |
724 | + <field name="journal_auto_invoice_id" |
725 | + attrs="{'required':['|', '|', ('active_intra_cee', '=', True), ('active_reverse_charge', '=', True), ('active_extra_ue_service', '=', True)]}"/> |
726 | + </group> |
727 | + </group> |
728 | + <group> |
729 | + <field name="extra_ue_service_tax_id" colspan="4" |
730 | + attrs="{'required':[('active_extra_ue_service', '=', True)]}"/> |
731 | + <field name="extra_ue_line_detail" colspan="4" |
732 | + attrs="{'required':[('active_extra_ue_service', '=', True)]}" |
733 | + help="Text accept mako markdown. for example ${object.partner_id.name} for partner or ${object.number} for invoice number, etc..."/> |
734 | + </group> |
735 | + </xpath> |
736 | + </field> |
737 | + </record> |
738 | + |
739 | + <!-- TAX FORM --> |
740 | + |
741 | + <record id="intra_cee_view_tax_form" model="ir.ui.view"> |
742 | + <field name="name">intra_cee.account_tax.form</field> |
743 | + <field name="model">account.tax</field> |
744 | + <field name="inherit_id" ref="account.view_tax_form"/> |
745 | + <field name="arch" type="xml"> |
746 | + <xpath expr="/form/notebook/page[@string='Tax Definition']/group/group[@string='Misc']" position="after"> |
747 | + <group string="Auto Invoice" attrs="{'invisible': [('type_tax_use','=','sale')],}"> |
748 | + <field name="auto_invoice_tax_id" /> |
749 | + </group> |
750 | + <newline /> |
751 | + </xpath> |
752 | + </field> |
753 | + </record> |
754 | + |
755 | + <!-- SUPPLIER INVOICE FORM --> |
756 | + |
757 | + <record id="intra_cee_invoice_supplier_form" model="ir.ui.view"> |
758 | + <field name="name">intra_cee.invoice_supplier.form</field> |
759 | + <field name="model">account.invoice</field> |
760 | + <field name="inherit_id" ref="account.invoice_supplier_form"/> |
761 | + <field name="arch" type="xml"> |
762 | + <field name="move_id" position="after"> |
763 | + <field name="transfer_entry_id" groups="account.group_account_user" |
764 | + readonly="True"/> |
765 | + <field name="auto_invoice_id" groups="account.group_account_user" |
766 | + readonly="True"/> |
767 | + </field> |
768 | + <xpath expr="//notebook/page[@string='Invoice']/field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="after"> |
769 | + <field name="reverse_charge" /> |
770 | + </xpath> |
771 | + </field> |
772 | + </record> |
773 | + |
774 | + <record id="auto_invoice_invoice_line_form" model="ir.ui.view"> |
775 | + <field name="name">auto_invoice.invoice.line.form</field> |
776 | + <field name="model">account.invoice.line</field> |
777 | + <field name="inherit_id" ref="account.view_invoice_line_form"/> |
778 | + <field name="arch" type="xml"> |
779 | + <field name="product_id" position="before"> |
780 | + <field name="reverse_charge" /> |
781 | + </field> |
782 | + </field> |
783 | + </record> |
784 | + |
785 | +</data> |
786 | +</openerp> |
787 | |
788 | === added directory 'l10n_it_invoice_intra_cee/company' |
789 | === added file 'l10n_it_invoice_intra_cee/company/__init__.py' |
790 | --- l10n_it_invoice_intra_cee/company/__init__.py 1970-01-01 00:00:00 +0000 |
791 | +++ l10n_it_invoice_intra_cee/company/__init__.py 2014-04-29 13:17:07 +0000 |
792 | @@ -0,0 +1,23 @@ |
793 | +# -*- coding: utf-8 -*- |
794 | +############################################################################## |
795 | +# |
796 | +# Copyright (C) 2014 Associazione OpenERP Italia |
797 | +# (<http://www.openerp-italia.org>) |
798 | +# All Rights Reserved |
799 | +# |
800 | +# This program is free software: you can redistribute it and/or modify |
801 | +# it under the terms of the GNU Affero General Public License as published |
802 | +# by the Free Software Foundation, either version 3 of the License, or |
803 | +# (at your option) any later version. |
804 | +# |
805 | +# This program is distributed in the hope that it will be useful, |
806 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
807 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
808 | +# GNU Affero General Public License for more details. |
809 | +# |
810 | +# You should have received a copy of the GNU Affero General Public License |
811 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
812 | +# |
813 | +############################################################################## |
814 | + |
815 | +import company |
816 | |
817 | === added file 'l10n_it_invoice_intra_cee/company/company.py' |
818 | --- l10n_it_invoice_intra_cee/company/company.py 1970-01-01 00:00:00 +0000 |
819 | +++ l10n_it_invoice_intra_cee/company/company.py 2014-04-29 13:17:07 +0000 |
820 | @@ -0,0 +1,36 @@ |
821 | +# -*- coding: utf-8 -*- |
822 | +############################################################################## |
823 | +# |
824 | +# Copyright (C) 2014 Associazione OpenERP Italia |
825 | +# (<http://www.openerp-italia.org>) |
826 | +# All Rights Reserved |
827 | +# |
828 | +# This program is free software: you can redistribute it and/or modify |
829 | +# it under the terms of the GNU Affero General Public License as published |
830 | +# by the Free Software Foundation, either version 3 of the License, or |
831 | +# (at your option) any later version. |
832 | +# |
833 | +# This program is distributed in the hope that it will be useful, |
834 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
835 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
836 | +# GNU Affero General Public License for more details. |
837 | +# |
838 | +# You should have received a copy of the GNU Affero General Public License |
839 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
840 | +# |
841 | +############################################################################## |
842 | + |
843 | +from osv import fields, osv |
844 | +from openerp import netsvc |
845 | +from tools.translate import _ |
846 | + |
847 | + |
848 | +class res_company(osv.osv): |
849 | + |
850 | + _inherit = 'res.company' |
851 | + |
852 | + _columns = { |
853 | + 'auto_invoice_partner_id': fields.many2one( |
854 | + 'res.partner', 'Auto Invoice Partner', |
855 | + help="If not set, partner for auto invoice will be your company"), |
856 | + } |
857 | |
858 | === added file 'l10n_it_invoice_intra_cee/company/company_view.xml' |
859 | --- l10n_it_invoice_intra_cee/company/company_view.xml 1970-01-01 00:00:00 +0000 |
860 | +++ l10n_it_invoice_intra_cee/company/company_view.xml 2014-04-29 13:17:07 +0000 |
861 | @@ -0,0 +1,18 @@ |
862 | +<?xml version="1.0" encoding="utf-8"?> |
863 | +<openerp> |
864 | +<data> |
865 | + |
866 | + <record id="auto_invoice_view_company_form" model="ir.ui.view"> |
867 | + <field name="name">auto_invoice.res.company.form</field> |
868 | + <field name="model">res.company</field> |
869 | + <field name="inherit_id" ref="base.view_company_form"/> |
870 | + <field name="arch" type="xml"> |
871 | + <field name="currency_id" position="after"> |
872 | + <field name="auto_invoice_partner_id" |
873 | + domain="[('is_company', '=', True)]"/> |
874 | + </field> |
875 | + </field> |
876 | + </record> |
877 | + |
878 | +</data> |
879 | +</openerp> |
880 | |
881 | === added directory 'l10n_it_invoice_intra_cee/guide' |
882 | === added file 'l10n_it_invoice_intra_cee/guide/it.odt' |
883 | Binary files l10n_it_invoice_intra_cee/guide/it.odt 1970-01-01 00:00:00 +0000 and l10n_it_invoice_intra_cee/guide/it.odt 2014-04-29 13:17:07 +0000 differ |
884 | === added directory 'l10n_it_invoice_intra_cee/i18n' |
885 | === added file 'l10n_it_invoice_intra_cee/i18n/it.po' |
886 | --- l10n_it_invoice_intra_cee/i18n/it.po 1970-01-01 00:00:00 +0000 |
887 | +++ l10n_it_invoice_intra_cee/i18n/it.po 2014-04-29 13:17:07 +0000 |
888 | @@ -0,0 +1,164 @@ |
889 | +# Translation of OpenERP Server. |
890 | +# This file contains the translation of the following modules: |
891 | +# * l10n_it_invoice_intra_cee |
892 | +# |
893 | +msgid "" |
894 | +msgstr "" |
895 | +"Project-Id-Version: OpenERP Server 7.0\n" |
896 | +"Report-Msgid-Bugs-To: \n" |
897 | +"POT-Creation-Date: 2014-03-31 07:17+0000\n" |
898 | +"PO-Revision-Date: 2014-03-31 07:17+0000\n" |
899 | +"Last-Translator: <>\n" |
900 | +"Language-Team: \n" |
901 | +"MIME-Version: 1.0\n" |
902 | +"Content-Type: text/plain; charset=UTF-8\n" |
903 | +"Content-Transfer-Encoding: \n" |
904 | +"Plural-Forms: \n" |
905 | + |
906 | +#. module: l10n_it_invoice_intra_cee |
907 | +#: field:account.fiscal.position,extra_ue_line_detail:0 |
908 | +msgid "Extra UE Line Detail" |
909 | +msgstr "Dettagli Extra UE" |
910 | + |
911 | +#. module: l10n_it_invoice_intra_cee |
912 | +#: field:account.fiscal.position,active_intra_cee:0 |
913 | +msgid "Active Intra CEE Management" |
914 | +msgstr "Attiva Gestione Intra CEE" |
915 | + |
916 | +#. module: l10n_it_invoice_intra_cee |
917 | +#: field:account.invoice,auto_invoice_id:0 |
918 | +#: view:account.tax:0 |
919 | +msgid "Auto Invoice" |
920 | +msgstr "Auto Fattura" |
921 | + |
922 | +#. module: l10n_it_invoice_intra_cee |
923 | +#: model:ir.model,name:l10n_it_invoice_intra_cee.model_account_invoice_line |
924 | +msgid "Invoice Line" |
925 | +msgstr "Righe Fattura" |
926 | + |
927 | +#. module: l10n_it_invoice_intra_cee |
928 | +#: view:account.fiscal.position:0 |
929 | +msgid "Text accept mako markdown. for example ${object.partner_id.name} for partner or ${object.number} for invoice number, etc..." |
930 | +msgstr "Il testo accetta segnaposto mako. Per esempio ${object.partner_id.name} per ottenere il nome del partner o ${object.number} per il numero fattura, etc..." |
931 | + |
932 | +#. module: l10n_it_invoice_intra_cee |
933 | +#: code:addons/l10n_it_invoice_intra_cee/account/account.py:368 |
934 | +#, python-format |
935 | +msgid "You must define a tax for each line in Intra CEE Invoice" |
936 | +msgstr "Bisogna definire almeno un'aliquota IVA per ogni dettaglio delle fatture soggette ad Intra CEE" |
937 | + |
938 | +#. module: l10n_it_invoice_intra_cee |
939 | +#: help:account.fiscal.position,extra_ue_line_detail:0 |
940 | +msgid "Text used as description line in Extra UE Auto Invoice" |
941 | +msgstr "Testo utilizzato come descrizione della riga dell'auto fattura extra UE" |
942 | + |
943 | +#. module: l10n_it_invoice_intra_cee |
944 | +#: field:account.fiscal.position,journal_auto_invoice_id:0 |
945 | +msgid "Journal Auto Invoice CEE" |
946 | +msgstr "Sezionale Auto Fattura" |
947 | + |
948 | +#. module: l10n_it_invoice_intra_cee |
949 | +#: field:res.company,auto_invoice_partner_id:0 |
950 | +msgid "Auto Invoice Partner" |
951 | +msgstr "Cliente Auto Fattura" |
952 | + |
953 | +#. module: l10n_it_invoice_intra_cee |
954 | +#: field:account.invoice,auto_invoice_amount_total:0 |
955 | +msgid "Auto Invoice Total" |
956 | +msgstr "Totale Auto Fattura" |
957 | + |
958 | +#. module: l10n_it_invoice_intra_cee |
959 | +#: field:account.invoice.line,reverse_charge:0 |
960 | +msgid "RC" |
961 | +msgstr "RC" |
962 | + |
963 | +#. module: l10n_it_invoice_intra_cee |
964 | +#: field:account.invoice,auto_invoice_amount_tax:0 |
965 | +#: field:account.tax,auto_invoice_tax_id:0 |
966 | +msgid "Auto Invoice Tax" |
967 | +msgstr "Aliquota Auto Fattura" |
968 | + |
969 | +#. module: l10n_it_invoice_intra_cee |
970 | +#: field:account.fiscal.position,account_transient_id:0 |
971 | +msgid "Account CEE" |
972 | +msgstr "Conto Transitorio" |
973 | + |
974 | +#. module: l10n_it_invoice_intra_cee |
975 | +#: code:addons/l10n_it_invoice_intra_cee/account/account.py:374 |
976 | +#, python-format |
977 | +msgid "Set an Auto Invoice Tax for tax %s" |
978 | +msgstr "Impostare l'aliquota dell'auto fattura per l'aliquota IVA %s" |
979 | + |
980 | +#. module: l10n_it_invoice_intra_cee |
981 | +#: view:account.fiscal.position:0 |
982 | +msgid "Intra CEE Configuration" |
983 | +msgstr "Configurazione Intra CEE" |
984 | + |
985 | +#. module: l10n_it_invoice_intra_cee |
986 | +#: model:ir.model,name:l10n_it_invoice_intra_cee.model_res_company |
987 | +msgid "Companies" |
988 | +msgstr "Aziende" |
989 | + |
990 | +#. module: l10n_it_invoice_intra_cee |
991 | +#: constraint:account.fiscal.position:0 |
992 | +msgid "Error!\n" |
993 | +"You cannot create select two or more flag for time" |
994 | +msgstr "Errore!\n" |
995 | +"Non puoi seleziona due o più spunte alla volta" |
996 | + |
997 | +#. module: l10n_it_invoice_intra_cee |
998 | +#: code:addons/l10n_it_invoice_intra_cee/account/account.py:367 |
999 | +#: code:addons/l10n_it_invoice_intra_cee/account/account.py:373 |
1000 | +#, python-format |
1001 | +msgid "Error" |
1002 | +msgstr "Errore" |
1003 | + |
1004 | +#. module: l10n_it_invoice_intra_cee |
1005 | +#: field:account.fiscal.position,extra_ue_service_tax_id:0 |
1006 | +msgid "Extra UE Service Tax" |
1007 | +msgstr "Tassa Servizio Extra UE" |
1008 | + |
1009 | +#. module: l10n_it_invoice_intra_cee |
1010 | +#: field:account.invoice,auto_invoice_amount_untaxed:0 |
1011 | +msgid "Auto Invoice Subtotal" |
1012 | +msgstr "Subtotale Auto Fattura" |
1013 | + |
1014 | +#. module: l10n_it_invoice_intra_cee |
1015 | +#: model:ir.model,name:l10n_it_invoice_intra_cee.model_account_tax |
1016 | +msgid "Tax" |
1017 | +msgstr "Imposta" |
1018 | + |
1019 | +#. module: l10n_it_invoice_intra_cee |
1020 | +#: help:res.company,auto_invoice_partner_id:0 |
1021 | +msgid "If not set, partner for auto invoice will be your company" |
1022 | +msgstr "Se non impostato, il partner per l'auto fattura sarà l'azienda" |
1023 | + |
1024 | +#. module: l10n_it_invoice_intra_cee |
1025 | +#: field:account.fiscal.position,active_extra_ue_service:0 |
1026 | +msgid "Active Extra UE Service Management" |
1027 | +msgstr "Attiva Gestione Servizi Extra UE" |
1028 | + |
1029 | +#. module: l10n_it_invoice_intra_cee |
1030 | +#: field:account.invoice,transfer_entry_id:0 |
1031 | +msgid "Transfer Entry" |
1032 | +msgstr "Giroconto" |
1033 | + |
1034 | +#. module: l10n_it_invoice_intra_cee |
1035 | +#: model:ir.model,name:l10n_it_invoice_intra_cee.model_account_fiscal_position |
1036 | +msgid "Fiscal Position" |
1037 | +msgstr "Posizione fiscale" |
1038 | + |
1039 | +#. module: l10n_it_invoice_intra_cee |
1040 | +#: field:account.fiscal.position,active_reverse_charge:0 |
1041 | +msgid "Active Reverse Charge Management" |
1042 | +msgstr "Attiva Gestione Reverse Charge" |
1043 | + |
1044 | +#. module: l10n_it_invoice_intra_cee |
1045 | +#: model:ir.model,name:l10n_it_invoice_intra_cee.model_account_invoice |
1046 | +msgid "Invoice" |
1047 | +msgstr "Fattura" |
1048 | + |
1049 | +#. module: l10n_it_invoice_intra_cee |
1050 | +#: field:account.fiscal.position,journal_transfer_entry_id:0 |
1051 | +msgid "Transfer Entry Journal" |
1052 | +msgstr "Sezionale Giroconto" |
Ciao, penso tu abbia sbagliato target :)
PS: avevo già lavorato sullo stesso argomento:
lp:~enlightx/openobject-italia/7.0-reverse-charge-imp
ancora in sviluppo, più che altro un PoC
Ultimante avevo aggiunto la conferma automatica della fattura di vendita e sto lavorando alla sua riconciliazione automatica, siccome è inutile che si debba andare a pagarla manualmente.
Cmq guarderò il tuo modulo, se è meglio del mio...tanto meglio :)