-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
[ADD] new module l10n_it_fatturapa_auto_downpayment #4230
base: 16.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
=============================================== | ||
ITA - Fattura PA - select TD02 for downpayments | ||
=============================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:62e9ea53b28e2845aa4728960d96554f12afac66d2b7d62c36aca149fd2f13ea | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github | ||
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_auto_downpayment | ||
:alt: OCA/l10n-italy | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_fatturapa_auto_downpayment | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
**Italiano** | ||
|
||
Modulo opzionale per impostare automaticamente TD02 come tipo di | ||
documento fiscale nelle fatture di acconto (necessario per la | ||
fatturazione elettronica). | ||
|
||
**English** | ||
|
||
Additional module to set TD02 as fiscal document type for downpayment | ||
invoices (needed for FatturaPA e-invoice). | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Installation | ||
============ | ||
|
||
|
||
|
||
Configuration | ||
============= | ||
|
||
**Italiano** | ||
|
||
Alla creazione di una fattura di downpayment, viene settato TD02 come | ||
fiscal document type. | ||
|
||
**English** | ||
|
||
When creating a downpayment invoice, set TD02 as fiscal document type. | ||
|
||
Usage | ||
===== | ||
|
||
**Italiano** | ||
|
||
Il modulo imposta automaticamente TD02 alla creazione di una fattura di | ||
acconto. | ||
|
||
**English** | ||
|
||
The module sets TD02 for downpayment invoices automatically. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_auto_downpayment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Marco Colombo | ||
|
||
Contributors | ||
------------ | ||
|
||
- `Phi Srl <https://www.phi.technology/>`__: | ||
|
||
- Marco Colombo <https://github.com/TheMule71> | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_fatturapa_auto_downpayment>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "ITA - Fattura PA - select TD02 for downpayments", | ||
"version": "16.0.1.0.0", | ||
"sequence": 10, | ||
"summary": "Automatically set TD02 for downpayments", | ||
"category": "Localization/Italy", | ||
"depends": [ | ||
"sale", | ||
"l10n_it_fiscal_document_type", | ||
], | ||
"author": "Marco Colombo, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/l10n-italy", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"application": False, | ||
"auto_install": True, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import account_move |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||
from odoo import models | ||||
|
||||
|
||||
class AccountMove(models.Model): | ||||
_inherit = "account.move" | ||||
|
||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Il metodo in
È 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 commentThe reason will be displayed to describe this comment to others. Learn more. L'unico punto in cui è chiamata è la Piu di quello però, il valore di ritorno è un alista di possibili TDxx validi per una sola fattura. La funziona ignora In pratica la funzione originale è usata come se fosse Io ho aggiunto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. È vero che il metodo in Attualmente potrebbero esserci altri moduli che chiamano |
||||
|
||||
dt = super()._get_document_fiscal_type( | ||||
move_type=move_type, | ||||
partner=partner, | ||||
fiscal_position=fiscal_position, | ||||
journal=journal, | ||||
) | ||||
if self.is_sale_document() and self._is_downpayment(): | ||||
td02 = self.env["fiscal.document.type"].search( | ||||
[("code", "=", "TD02")], limit=1 | ||||
) | ||||
if td02: | ||||
dt.insert(0, td02.id) | ||||
return dt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
**Italiano** | ||
|
||
Alla creazione di una fattura di downpayment, viene settato | ||
TD02 come fiscal document type. | ||
Comment on lines
+3
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Visto che non c'è nulla da configurare, penso sia meglio rimuovere questo file. |
||
|
||
**English** | ||
|
||
When creating a downpayment invoice, set TD02 as fiscal | ||
document type. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- [Phi Srl](https://www.phi.technology/): | ||
- Marco Colombo \<<https://github.com/TheMule71>\> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
**Italiano** | ||
|
||
Modulo opzionale per impostare automaticamente TD02 | ||
come tipo di documento fiscale nelle fatture di | ||
acconto (necessario per la fatturazione elettronica). | ||
|
||
**English** | ||
|
||
Additional module to set TD02 as fiscal document type | ||
for downpayment invoices (needed for FatturaPA e-invoice). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
**Italiano** | ||
|
||
Il modulo imposta automaticamente TD02 alla creazione di una fattura | ||
di acconto. | ||
|
||
**English** | ||
|
||
The module sets TD02 for downpayment invoices automatically. | ||
SirAionTech marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Puoi eliminare
INSTALL.md
? Altrimenti viene creata questa sezione vuota.