Skip to content

Commit

Permalink
[MIG] l10n_it_vat_registries: Migration to 16.0
Browse files Browse the repository at this point in the history
Co-authored-by: SirAionTech <simone.rubino@aion-tech.it>
  • Loading branch information
SirAionTech committed Sep 11, 2023
1 parent 334d09b commit 1195753
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 154 deletions.
12 changes: 6 additions & 6 deletions l10n_it_vat_registries/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ITA - Registri IVA
==================

..
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
Expand All @@ -17,13 +17,13 @@ ITA - Registri 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/14.0/l10n_it_vat_registries
:target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_registries
: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-14-0/l10n-italy-14-0-l10n_it_vat_registries
:target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_vat_registries
: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=14.0
: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|
Expand Down Expand Up @@ -112,7 +112,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:%20l10n_it_vat_registries%0Aversion:%2014.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:%20l10n_it_vat_registries%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.

Expand Down Expand Up @@ -153,6 +153,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/14.0/l10n_it_vat_registries>`_ project on GitHub.
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_registries>`_ 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 l10n_it_vat_registries/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"version": "14.0.1.0.5",
"version": "16.0.1.0.0",
"name": "ITA - Registri IVA",
"category": "Localization/Italy",
"author": "Agile Business Group, Odoo Community Association (OCA), LinkIt Srl",
Expand Down
13 changes: 7 additions & 6 deletions l10n_it_vat_registries/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-19 13:26+0000\n"
"PO-Revision-Date: 2023-05-12 12:56+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\n"
"PO-Revision-Date: 2023-01-23 13:44+0000\n"
"Last-Translator: Lorenzo Battistini <lb@takobi.online>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -65,7 +65,7 @@ msgstr "Fatture cliente"
#. module: l10n_it_vat_registries
#: model:ir.model.fields,field_description:l10n_it_vat_registries.field_wizard_registro_iva__date_range_id
msgid "Date range"
msgstr "Intervallo date"
msgstr "Intervallo data"

#. module: l10n_it_vat_registries
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
Expand Down Expand Up @@ -188,8 +188,8 @@ msgid ""
"No journals found in the current selection.\n"
"Please load them before to retry!"
msgstr ""
"Nessun sezionale trovato nella presente selezione.\n"
"Caricarli prima di riprovare!"
"Nessun registro trovato nella selezione corrente,\n"
"caricarli prima di riprovare."

#. module: l10n_it_vat_registries
#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries.report_registro_iva
Expand Down Expand Up @@ -228,8 +228,9 @@ msgstr "Resoconto registro IVA"

#. module: l10n_it_vat_registries
#: model:ir.model,name:l10n_it_vat_registries.model_wizard_registro_iva
#, fuzzy
msgid "Run VAT registry"
msgstr "Stampa Registro IVA"
msgstr "Registro IVA"

#. module: l10n_it_vat_registries
#: model:ir.model.fields,help:l10n_it_vat_registries.field_wizard_registro_iva__journal_ids
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions l10n_it_vat_registries/migrations/14.0.1.0.0/post-migration.py

This file was deleted.

11 changes: 0 additions & 11 deletions l10n_it_vat_registries/migrations/14.0.1.0.3/post-migration.py

This file was deleted.

2 changes: 1 addition & 1 deletion l10n_it_vat_registries/models/account_tax_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class AccountTaxRegistry(models.Model):
_name = "account.tax.registry"
_description = "Tax registry"
name = fields.Char("Name", required=True)
name = fields.Char(required=True)
company_id = fields.Many2one(
"res.company",
"Company",
Expand Down
4 changes: 2 additions & 2 deletions l10n_it_vat_registries/models/vat_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ def _get_move_total(self, move):
total = 0.0
receivable_payable_found = False
for move_line in move.line_ids:
if move_line.account_id.internal_type == "receivable":
if move_line.account_id.account_type == "asset_receivable":
total += move_line.debit or (-move_line.credit)
receivable_payable_found = True
elif move_line.account_id.internal_type == "payable":
elif move_line.account_id.account_type == "liability_payable":
total += (-move_line.debit) or move_line.credit
receivable_payable_found = True
if receivable_payable_found:
Expand Down
27 changes: 12 additions & 15 deletions l10n_it_vat_registries/report/reports.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<?xml version="1.0" ?>
<odoo>
<data noupdate="1">
<odoo noupdate="1">

<record id="action_report_registro_iva" model="ir.actions.report">
<field name="name">Invoices VAT Registry</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">l10n_it_vat_registries.report_registro_iva</field>
<field name="report_file">l10n_it_vat_registries.report_registro_iva</field>
<field
name="paperformat_id"
ref="l10n_it_account.l10n_it_account_a4_landscape"
/>
</record>

</data>
<record id="action_report_registro_iva" model="ir.actions.report">
<field name="name">Invoices VAT Registry</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">l10n_it_vat_registries.report_registro_iva</field>
<field name="report_file">l10n_it_vat_registries.report_registro_iva</field>
<field
name="paperformat_id"
ref="l10n_it_account.l10n_it_account_a4_landscape"
/>
</record>

</odoo>
8 changes: 3 additions & 5 deletions l10n_it_vat_registries/security/vat_registry_security.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<odoo noupdate="1">

<record id="tax_registry_comp_rule" model="ir.rule">
<field name="name">tax_registry multi-company</field>
<field name="model_id" ref="model_account_tax_registry" />
<field name="global" eval="True" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
name="domain_force"
>['|',('company_id','=',False),('company_id','in',company_ids)]</field>
</record>

</data>
</odoo>
7 changes: 4 additions & 3 deletions l10n_it_vat_registries/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,11 @@ <h1 class="title">ITA - Registri IVA</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:aa15b5cf25d504fd618238bc8a4575276f49e0478d3120bbd81423c5e196cc42
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/14.0/l10n_it_vat_registries"><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-14-0/l10n-italy-14-0-l10n_it_vat_registries"><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=14.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="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/14.0/l10n_it_vat_registries"><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-14-0/l10n-italy-14-0-l10n_it_vat_registries"><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>Law: Decreto del Presidente della Repubblica del 26 ottobre 1972 n. 633
<a class="reference external" href="https://goo.gl/31yTVj">https://goo.gl/31yTVj</a></p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -446,7 +447,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">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:%20l10n_it_vat_registries%0Aversion:%2014.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:%20l10n_it_vat_registries%0Aversion:%2016.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 @@ -481,7 +482,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">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/14.0/l10n_it_vat_registries">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/16.0/l10n_it_vat_registries">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
26 changes: 8 additions & 18 deletions l10n_it_vat_registries/tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
class TestRegistry(TransactionCase):
def test_invoice_and_report(self):
test_date = fields.Date.today()
self.journal = self.env["account.journal"].search([("type", "=", "sale")])[0]
self.journal = self.env["account.journal"].search(
[("type", "=", "sale")], limit=1
)
self.ova = self.env["account.account"].search(
[
(
"user_type_id",
"=",
self.env.ref("account.data_account_type_current_assets").id,
)
],
[("account_type", "=", "asset_current")],
limit=1,
)
tax = self.env["account.tax"].create(
Expand All @@ -35,13 +31,7 @@ def test_invoice_and_report(self):
invoice_line_account = (
self.env["account.account"]
.search(
[
(
"user_type_id",
"=",
self.env.ref("account.data_account_type_expenses").id,
)
],
[("account_type", "=", "expense")],
limit=1,
)
.id
Expand Down Expand Up @@ -69,7 +59,6 @@ def test_invoice_and_report(self):
],
}
)
invoice._onchange_invoice_line_ids()
invoice.action_post()

wizard = self.env["wizard.registro.iva"].create(
Expand All @@ -84,13 +73,14 @@ def test_invoice_and_report(self):
wizard.on_change_tax_registry_id()
res = wizard.print_registro()

report_name = "l10n_it_vat_registries.report_registro_iva"
domain = [
("report_type", "like", "qweb"),
("report_name", "=", "l10n_it_vat_registries.report_registro_iva"),
("report_name", "in", [report_name]),
]
report = self.env["ir.actions.report"].search(domain)
data = res["context"]["report_action"]["data"]
html = report._render_qweb_html(data["ids"], data)
html = report._render_qweb_html(report_name, data["ids"], data)

self.assertTrue(b"Tax 10.0" in html[0])

Expand Down
26 changes: 13 additions & 13 deletions l10n_it_vat_registries/views/account_journal_view.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record id="view_account_journal_form" model="ir.ui.view">
<field name="name">account.journal.form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form" />
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="tax_registry_id" />
</field>
<odoo>

<record id="view_account_journal_form" model="ir.ui.view">
<field name="name">account.journal.form</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form" />
<field name="arch" type="xml">
<field name="type" position="after">
<field name="tax_registry_id" />
</field>
</record>
</data>
</openerp>
</field>
</record>

</odoo>
70 changes: 35 additions & 35 deletions l10n_it_vat_registries/views/account_tax_registry_view.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record id="view_account_tax_registry_form" model="ir.ui.view">
<field name="name">account.tax.registry.form</field>
<field name="model">account.tax.registry</field>
<field name="arch" type="xml">
<form>
<group>
<field name="name" />
<field name="layout_type" />
</group>
<separator string="Journals" />
<field name="journal_ids" />
</form>
</field>
</record>
<odoo>

<record id="action_account_tax_registry_form" model="ir.actions.act_window">
<field name="name">VAT registries</field>
<field name="res_model">account.tax.registry</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a VAT registry.
</p><p>
A VAT registry is used to group several journals in one registry.
</p>
</field>
</record>
<menuitem
action="action_account_tax_registry_form"
id="menu_action_account_tax_registry_form"
parent="account.account_account_menu"
/>
</data>
</openerp>
<record id="view_account_tax_registry_form" model="ir.ui.view">
<field name="name">account.tax.registry.form</field>
<field name="model">account.tax.registry</field>
<field name="arch" type="xml">
<form>
<group>
<field name="name" />
<field name="layout_type" />
</group>
<separator string="Journals" />
<field name="journal_ids" />
</form>
</field>
</record>

<record id="action_account_tax_registry_form" model="ir.actions.act_window">
<field name="name">VAT registries</field>
<field name="res_model">account.tax.registry</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a VAT registry.
</p><p>
A VAT registry is used to group several journals in one registry.
</p>
</field>
</record>
<menuitem
action="action_account_tax_registry_form"
id="menu_action_account_tax_registry_form"
parent="account.account_account_menu"
/>

</odoo>
Loading

0 comments on commit 1195753

Please sign in to comment.