Skip to content

Commit

Permalink
[MIG] account_vat_period_end_statement: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eLBati authored and LorenzoC0 committed Jan 17, 2025
1 parent a00b72e commit 25c77b1
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 178 deletions.
76 changes: 38 additions & 38 deletions account_vat_period_end_statement/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ ITA - Liquidazione IVA
: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/account_vat_period_end_statement
:target: https://github.com/OCA/l10n-italy/tree/18.0/account_vat_period_end_statement
: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-account_vat_period_end_statement
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-account_vat_period_end_statement
: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
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -99,14 +99,14 @@ Configuration
Configurazione > Contabilità > Intervalli date > Generazione
intervalli data (visibile solo in modalità debug):

- prefisso nome intervallo: prefisso identificativo per i periodi da
generare (tipicamente l'anno)
- durata: 1 mese
- numero di intervalli da generare: 12
- tipo: creare un tipo o utilizzarne uno esistente, non è richiesta
una configurazione particolare
- data iniziale: primo giorno del primo periodo che sarà generato
(tipicamente il primo giorno dell'anno i.e. 01/01/2018)
- prefisso nome intervallo: prefisso identificativo per i periodi da
generare (tipicamente l'anno)
- durata: 1 mese
- numero di intervalli da generare: 12
- tipo: creare un tipo o utilizzarne uno esistente, non è richiesta
una configurazione particolare
- data iniziale: primo giorno del primo periodo che sarà generato
(tipicamente il primo giorno dell'anno i.e. 01/01/2018)

Per caricare l'importo corretto, un'imposta deve essere associata al
conto utilizzato nella liquidazione:
Expand All @@ -127,14 +127,14 @@ Configuration
Configuration > Accounting > Date ranges > Generate Date Ranges
(visible only in debug mode):

- range name prefix: prefix identifying the periods to be generated
(usually the year)
- duration: 1 month
- number of ranges to generate: 12
- type: create a type or use an existing one, no specific
configuration is required
- date start: first day of the first period to be generated (usually
the first day of the year e.g. 01/01/2018)
- range name prefix: prefix identifying the periods to be generated
(usually the year)
- duration: 1 month
- number of ranges to generate: 12
- type: create a type or use an existing one, no specific
configuration is required
- date start: first day of the first period to be generated (usually
the first day of the year e.g. 01/01/2018)

In order to load the correct amount from tax, the tax has to be
associated to the account involved in the statement:
Expand All @@ -154,7 +154,7 @@ 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:%20account_vat_period_end_statement%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20account_vat_period_end_statement%0Aversion:%2018.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.

Expand All @@ -170,26 +170,26 @@ Authors
Contributors
------------

- Lorenzo Battistini <https://github.com/eLBati>
- Elena Carlesso
- Marco Marchiori <[email protected]>
- Sergio Corato <[email protected]>
- Andrea Gallina <[email protected]>
- Alex Comba <[email protected]>
- Alessandro Camilli <[email protected]>
- Simone Rubino <[email protected]>
- Giacomo Grasso <[email protected]>
- Lara Baggio <http://linkgroup.it/>
- Gianmarco Conte <[email protected]>
- Michele Rusticucci <[email protected]>
- Salvo Rapisarda <[email protected]>
- `TAKOBI <https://takobi.online>`__:
- Lorenzo Battistini <https://github.com/eLBati>
- Elena Carlesso
- Marco Marchiori <[email protected]>
- Sergio Corato <[email protected]>
- Andrea Gallina <[email protected]>
- Alex Comba <[email protected]>
- Alessandro Camilli <[email protected]>
- Simone Rubino <[email protected]>
- Giacomo Grasso <[email protected]>
- Lara Baggio <http://linkgroup.it/>
- Gianmarco Conte <[email protected]>
- Michele Rusticucci <[email protected]>
- Salvo Rapisarda <[email protected]>
- `TAKOBI <https://takobi.online>`__:

- Simone Rubino <[email protected]>
- Simone Rubino <[email protected]>

- `Aion Tech <https://aiontech.company/>`__:
- `Aion Tech <https://aiontech.company/>`__:

- Simone Rubino <[email protected]>
- Simone Rubino <[email protected]>

Maintainers
-----------
Expand All @@ -204,6 +204,6 @@ 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/account_vat_period_end_statement>`_ project on GitHub.
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/account_vat_period_end_statement>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion account_vat_period_end_statement/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{
"name": "ITA - Liquidazione IVA",
"version": "16.0.1.2.7",
"version": "18.0.1.0.0",
"category": "Localization/Italy",
"summary": "Allow to create the 'VAT Statement'.",
"license": "AGPL-3",
Expand Down
87 changes: 1 addition & 86 deletions account_vat_period_end_statement/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,94 +129,44 @@ def _get_default_interest_percent(self):
"account.account",
"Previous Credits VAT",
help="Credit VAT from previous periods",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
previous_credit_vat_amount = fields.Float(
"Previous Credits VAT Amount",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
digits="Account",
)
previous_year_credit = fields.Boolean("Previous year credits")
previous_debit_vat_account_id = fields.Many2one(
"account.account",
"Previous Debits VAT",
help="Debit VAT from previous periods",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
previous_debit_vat_amount = fields.Float(
"Previous Debits VAT Amount",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
digits="Account",
)
interests_debit_vat_account_id = fields.Many2one(
"account.account",
"Due interests",
help="Due interests for three-monthly statments",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
interests_debit_vat_amount = fields.Float(
"Due interests Amount",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
digits="Account",
)
tax_credit_account_id = fields.Many2one(
"account.account",
"Tax credits",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
tax_credit_amount = fields.Float(
"Tax credits Amount",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
digits="Account",
)
advance_account_id = fields.Many2one(
"account.account",
"Down payment",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
advance_amount = fields.Float(
"Down payment Amount",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
digits="Account",
)
advance_computation_method = fields.Selection(
Expand All @@ -227,39 +177,19 @@ def _get_default_interest_percent(self):
("4", '"4" (soggetti particolari)'),
],
string="Down payment computation method",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
generic_vat_account_line_ids = fields.One2many(
"statement.generic.account.line",
"statement_id",
"Other VAT Credits / Debits or Tax Compensations",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
authority_partner_id = fields.Many2one(
"res.partner",
"Tax Authority Partner",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
authority_vat_account_id = fields.Many2one(
"account.account",
"Tax Authority VAT Account",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
authority_vat_amount = fields.Float(
"Authority VAT Amount",
Expand All @@ -276,19 +206,9 @@ def _get_default_interest_percent(self):
"account.journal",
"Journal",
required=True,
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
date = fields.Date(
required=True,
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
default=fields.Date.context_today,
)
move_id = fields.Many2one("account.move", "VAT statement move", readonly=True)
Expand All @@ -304,11 +224,6 @@ def _get_default_interest_percent(self):
payment_term_id = fields.Many2one(
"account.payment.term",
"Payment Term",
states={
"confirmed": [("readonly", True)],
"paid": [("readonly", True)],
"draft": [("readonly", False)],
},
)
reconciled = fields.Boolean(
"Paid/Reconciled",
Expand Down Expand Up @@ -480,7 +395,7 @@ def _split_vat_data_payment_term(
untaxed_amount_currency,
)
payment_term_lines = []
for term in due_list:
for term in due_list["line_ids"]:
current_line = end_debit_vat_data.copy()
current_line["credit"] = term["company_amount"]
current_line["date_maturity"] = term["date"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">ITA - Liquidazione IVA</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:291d49ba53933717c3fe7a46884b43e9d5cd54e12098f6cf5e5b744611e8e958
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/16.0/account_vat_period_end_statement"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-account_vat_period_end_statement"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/account_vat_period_end_statement"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-account_vat_period_end_statement"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><strong>Italiano</strong></p>
<blockquote>
<p>Per fare la liquidazione IVA, aprire Fatturazione &gt; Contabilità &gt;
Expand Down Expand Up @@ -495,7 +495,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20account_vat_period_end_statement%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20account_vat_period_end_statement%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -542,7 +542,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/16.0/account_vat_period_end_statement">OCA/l10n-italy</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-italy/tree/18.0/account_vat_period_end_statement">OCA/l10n-italy</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions account_vat_period_end_statement/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

from dateutil.rrule import MONTHLY

from odoo.tests import tagged
from odoo.tests.common import Form
from odoo.tests import Form, tagged

from odoo.addons.account.tests.common import AccountTestInvoicingCommon

Expand All @@ -26,8 +25,8 @@ def setUpClass(cls, chart_template_ref=None):
current_datetime = datetime(2020, month=6, day=15)
generator = generator.create(
{
"date_start": "%s-01-01" % current_datetime.year,
"name_prefix": "%s-" % current_datetime.year,
"date_start": f"{current_datetime.year}-01-01",
"name_prefix": f"{current_datetime.year}-",
"type_id": cls.range_type.id,
"duration_count": 1,
"unit_of_time": str(MONTHLY),
Expand All @@ -37,8 +36,8 @@ def setUpClass(cls, chart_template_ref=None):
generator.action_apply()
prev_year_generator = generator.create(
{
"date_start": "%s-01-01" % (current_datetime.year - 1),
"name_prefix": "%s-" % (current_datetime.year - 1),
"date_start": f"{current_datetime.year - 1}-01-01",
"name_prefix": f"{current_datetime.year - 1}-",
"type_id": cls.range_type.id,
"duration_count": 1,
"unit_of_time": str(MONTHLY),
Expand Down Expand Up @@ -130,7 +129,8 @@ def setUpClass(cls, chart_template_ref=None):
)
cls.term_line_model.create(
{
"value": "balance",
"delay_type": "days_after",
"value": "fixed",
"days": 16,
"payment_id": cls.account_payment_term.id,
}
Expand Down
Loading

0 comments on commit 25c77b1

Please sign in to comment.