Skip to content

Commit

Permalink
[ADD] new module l10n_it_fatturapa_auto_downpayment
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMule71 committed Jul 19, 2024
1 parent 45cb4a3 commit 8cbb8df
Show file tree
Hide file tree
Showing 14 changed files with 694 additions and 0 deletions.
116 changes: 116 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/README.rst
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.
1 change: 1 addition & 0 deletions l10n_it_fatturapa_auto_downpayment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/__manifest__.py
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,
}
1 change: 1 addition & 0 deletions l10n_it_fatturapa_auto_downpayment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move
24 changes: 24 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/models/account_move.py
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()

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
3 changes: 3 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
9 changes: 9 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/readme/CONFIGURE.md
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.

**English**

When creating a downpayment invoice, set TD02 as fiscal
document type.
2 changes: 2 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/readme/CONTRIBUTORS.md
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>\>
10 changes: 10 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/readme/DESCRIPTION.md
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).
Empty file.
8 changes: 8 additions & 0 deletions l10n_it_fatturapa_auto_downpayment/readme/USAGE.md
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.
Loading

0 comments on commit 8cbb8df

Please sign in to comment.