Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions l10n_it_account/migration_tools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Common methods for migrations
from openupgradelib import openupgrade


def _remove_module(env, module_name):
query_params = {
"name": module_name,
}
env.cr.execute(
"SELECT id FROM ir_module_module WHERE name = %(name)s",
query_params,
)
if bool(env.cr.fetchone()):
openupgrade.logged_query(
env.cr,
"UPDATE ir_module_module SET state = 'to remove' WHERE name = %(name)s",
query_params,
)
3 changes: 3 additions & 0 deletions l10n_it_account/migrations/18.0.1.0.0/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from odoo import SUPERUSER_ID, api

from odoo.addons.l10n_it_account.migration_tools import _remove_module

OLD_MODULES = [
"l10n_it_account_tax_kind",
"l10n_it_fatturapa",
Expand Down Expand Up @@ -131,3 +133,4 @@ def migrate(cr, version):
migration_function = globals().get(f"_{module}_migration")
if openupgrade.is_module_installed(env.cr, module) and migration_function:
migration_function(env)
_remove_module(env, module)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not remove l10n_it_fatturapa_pec as migration script in l10n_it_edi_pec checks if it is installed to do migration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same thing for l10n_it_declaration_of_intent

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La disattivazione di l10n_it_fatturapa_pec andrebbe fatta nello script di l10n_it_edi_pec

Discorso analogo per l10n_it_declaration_of_intent

6 changes: 1 addition & 5 deletions l10n_it_edi_extension/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==================================
Italy - E-invoicing - Base Feature
==================================
Expand All @@ -17,7 +13,7 @@ Italy - E-invoicing - Base Feature
.. |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/license-AGPL--3-blue.png
.. |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
Expand Down
2 changes: 2 additions & 0 deletions l10n_it_edi_extension/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from openupgradelib import openupgrade, openupgrade_tools

from odoo.addons.base.models.ir_qweb_fields import Markup, nl2br, nl2br_enclose
from odoo.addons.l10n_it_account.migration_tools import _remove_module

OLD_MODULES = [
"l10n_it_fatturapa",
Expand Down Expand Up @@ -947,3 +948,4 @@ def _l10n_it_edi_extension_post_init_hook(env):
migration_function = globals().get(f"_{module}_post_migration")
if openupgrade.is_module_installed(env.cr, module) and migration_function:
migration_function(env)
_remove_module(env, module)
1 change: 1 addition & 0 deletions l10n_it_edi_extension/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"depends": [
"account",
"l10n_it_account",
"l10n_it_edi",
"l10n_it_edi_ndd",
"partner_firstname",
Expand Down
26 changes: 10 additions & 16 deletions l10n_it_edi_extension/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Italy - E-invoicing - Base Feature</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="italy-e-invoicing-base-feature">
<h1 class="title">Italy - E-invoicing - Base Feature</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="italy-e-invoicing-base-feature">
<h1>Italy - E-invoicing - Base Feature</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:98fe650900fad9f33cf63553496f798edcfadff467ebe2aee9502c061d188d0c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_edi_extension"><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-l10n_it_edi_extension"><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><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/l10n_it_edi_extension"><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-l10n_it_edi_extension"><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>
<p>Questo modulo estende le funzionalità standard della fatturazione
elettronica italiana di Odoo, introducendo strumenti utili come
Expand Down Expand Up @@ -712,7 +707,7 @@ <h1>Italy - E-invoicing - Base Feature</h1>
</ul>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p><strong>Italiano</strong></p>
<p>Le uniche configurazioni disponibili sono:</p>
<ul class="simple">
Expand Down Expand Up @@ -824,23 +819,23 @@ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
with what is found in one of their imported e-bill.</p>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<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:%20l10n_it_edi_extension%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">
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Giuseppe Borruso</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Giuseppe Borruso - Dinamiche Aziendali srl
&lt;<a class="reference external" href="mailto:gborruso&#64;dinamicheaziendali.it">gborruso&#64;dinamicheaziendali.it</a>&gt;</li>
Expand All @@ -857,7 +852,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -870,6 +865,5 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
31 changes: 15 additions & 16 deletions l10n_it_edi_related_document/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from openupgradelib import openupgrade
from openupgradelib import openupgrade_tools


def _insert_account_move_related_document(env):
cr = env.cr
cr.execute("SELECT * FROM fatturapa_related_document_type LIMIT 1")
if cr.fetchone():
cr.execute("""
INSERT INTO account_move_related_document (
type, name, "lineRef", invoice_id, invoice_line_id, date,
numitem, code, cig, cup
)
SELECT
type, name, "lineRef", invoice_id, invoice_line_id, date,
numitem, code, cig, cup
FROM fatturapa_related_document_type
""")
if openupgrade_tools.table_exists(cr, "fatturapa_related_document_type"):
cr.execute("SELECT * FROM fatturapa_related_document_type LIMIT 1")
if cr.fetchone():
cr.execute("""
INSERT INTO account_move_related_document (
type, name, "lineRef", invoice_id, invoice_line_id, date,
numitem, code, cig, cup
)
SELECT
type, name, "lineRef", invoice_id, invoice_line_id, date,
numitem, code, cig, cup
FROM fatturapa_related_document_type
""")


def _l10n_it_edi_related_document_post_init_hook(env):
module = "l10n_it_fatturapa"
if openupgrade.is_module_installed(env.cr, module):
_insert_account_move_related_document(env)
_insert_account_move_related_document(env)
Loading