-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c69b994
commit acc80a1
Showing
7 changed files
with
65 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
l10n_it_accompanying_invoice/migrations/16.0.1.0.1/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
from .hooks import RENAMED_FIELDS | ||
|
||
|
||
def _get_set_clause(fields_list): | ||
set_fields_list = [f"{field[1]} = ai.{field[0]}" for field in fields_list] | ||
set_fields_clause = ", ".join(set_fields_list) | ||
return set_fields_clause | ||
|
||
|
||
def migrate(cr, installed_version): | ||
fields_list = [(field[0][1], field[1][1]) for field in RENAMED_FIELDS] | ||
set_fields_clause = _get_set_clause(fields_list) | ||
query = f""" | ||
UPDATE account_move am | ||
SET {set_fields_clause} | ||
FROM account_invoice ai | ||
WHERE am.old_invoice_id = ai.id | ||
""" | ||
openupgrade.logged_query(cr, query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
**Italiano** | ||
|
||
Il modulo è stato migrato, ma gli script di migrazione non | ||
sono stati provati e quindi sono stati commentati. | ||
Odoo Italia non supporta più i moduli alla versione 12.0 perciò | ||
non ci siamo occupati ufficialmente della migrazione dei dati da | ||
questa versione. | ||
|
||
Tuttavia se non si volessero perdere i dati già presenti nella | ||
versione 12.0 si potrebbe togliere la dipendenza dal modulo | ||
`l10n_it_ddt` nel `__manifest__.py` e lanciare gli script di | ||
migrazione commentati. | ||
Si possono provare in un ambiente di test decommentando | ||
- il riferimento a `hooks.py` in `__init__.py` | ||
- `external_dependencies` e `pre_init_hook` in `__manifest__.py` | ||
- le righe di codice in `migrations/16.0.1.0.0/pre-migrate.py` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters