2024-11-24 00:35:36 +01:00
|
|
|
:orphan:
|
|
|
|
|
|
|
|
|
|
.. _index-migration:
|
|
|
|
|
|
|
|
|
|
Migration
|
|
|
|
|
=========
|
|
|
|
|
|
|
|
|
|
Here are listed the manual actions you need to take before and after upgrading
|
|
|
|
|
a database from another series.
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
If you skip a series, all actions between them must be performed.
|
|
|
|
|
|
2025-01-04 00:19:42 +01:00
|
|
|
.. warning::
|
|
|
|
|
You cannot skip more than 2 series ending with ``.0``.
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-8.0:
|
|
|
|
|
|
2026-03-30 22:36:05 +02:00
|
|
|
8.0
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-8.0-before:
|
|
|
|
|
|
2026-03-30 22:36:05 +02:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
|
|
* Remove ``google_maps`` module:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
DELETE FROM "ir_module" WHERE name = 'google_maps';
|
|
|
|
|
|
2026-04-01 09:40:50 +02:00
|
|
|
* Remove ``account_es`` and ``account_es_sii`` modules if you are not
|
|
|
|
|
installing external replacements:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
DELETE FROM "ir_module" WHERE name in ('account_es', 'account_es_sii');
|
|
|
|
|
|
2026-04-01 10:59:57 +02:00
|
|
|
* Remove ``account_de_skr03`` module if you are not installing external
|
|
|
|
|
replacement:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
DELETE FROM "ir_module" WHERE name = 'account_de_skr03';
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.8:
|
|
|
|
|
|
2025-09-14 12:23:08 +02:00
|
|
|
7.8
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.8-before:
|
|
|
|
|
|
2025-12-20 10:23:56 +01:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
|
|
* If ``carrier_carriage`` module is activated, remove ``NOT NULL`` to
|
|
|
|
|
``before_carrier`` and ``after_carrier``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
ALTER TABLE "incoterm_incoterm" ALTER COLUMN "before_carrier" DROP NOT NULL;
|
|
|
|
|
ALTER TABLE "incoterm_incoterm" ALTER COLUMN "after_carrier" DROP NOT NULL;
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.8-after:
|
2025-12-20 10:23:56 +01:00
|
|
|
|
2025-09-14 12:23:08 +02:00
|
|
|
After
|
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
|
|
* If ``account_payment_sepa`` module is activated, fill the address of
|
|
|
|
|
validated mandates with default value with the ``trytond-console``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
Mandate = pool.get('account.payment.sepa.mandate')
|
|
|
|
|
mandates = Mandate.search([
|
|
|
|
|
('state', '=', 'validated'),
|
|
|
|
|
('address', '=', None),
|
|
|
|
|
])
|
2025-12-12 18:58:01 +01:00
|
|
|
|
2025-09-14 12:23:08 +02:00
|
|
|
for mandate in mandates:
|
2026-08-06 13:08:45 +02:00
|
|
|
mandate.on_change_party()
|
2025-12-12 18:58:01 +01:00
|
|
|
|
2025-09-14 12:23:08 +02:00
|
|
|
Mandate.save(mandates)
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.6:
|
|
|
|
|
|
2024-11-24 01:17:41 +01:00
|
|
|
7.6
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.6-before:
|
|
|
|
|
|
2024-11-24 01:17:41 +01:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
|
|
* Rename columns of ``ir.model`` and ``ir.model.field``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
ALTER TABLE IF EXISTS "ir_model" RENAME COLUMN "name" TO "string";
|
|
|
|
|
ALTER TABLE IF EXISTS "ir_model" RENAME COLUMN "model" TO "name";
|
|
|
|
|
ALTER TABLE IF EXISTS "ir_model_field" RENAME COLUMN "field_description" TO "string";
|
|
|
|
|
|
2024-12-01 14:25:26 +01:00
|
|
|
* ``pbkdf2_sha512`` and ``scrypt`` password hashes are no more supported.
|
|
|
|
|
Make sure to enable ``argon2`` and update old passwords by logging in.
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.6-after:
|
|
|
|
|
|
2025-02-08 12:45:40 +01:00
|
|
|
After
|
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
|
|
* If ``stock`` module is activated with internal shipment using transit
|
|
|
|
|
location, fill the internal transit location with the ``trytond-console``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
Shipment = pool.get('stock.shipment.internal')
|
|
|
|
|
shipments = Shipment.search([('state', 'not in', ['request', 'draft'])])
|
|
|
|
|
for shipment in shipments:
|
|
|
|
|
state = shipment.state
|
|
|
|
|
shipment.state = 'draft'
|
|
|
|
|
shipment.internal_transit_location = shipment.transit_location
|
|
|
|
|
shipment.state = state
|
2025-12-12 18:58:01 +01:00
|
|
|
|
2025-02-08 12:45:40 +01:00
|
|
|
Shipment.save(shipments)
|
|
|
|
|
transaction.commit()
|
|
|
|
|
|
2025-02-10 13:08:22 +01:00
|
|
|
* If ``account_budget`` module is activated, invert amount sign:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
UPDATE "account_budget_line" SET amount = -amount;
|
|
|
|
|
|
|
|
|
|
* If ``analytic_budget`` module is activated, invert amount sign:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
UPDATE "analytic_account_budget_line" SET amount = -amount;
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.4:
|
|
|
|
|
|
2024-11-24 01:07:39 +01:00
|
|
|
7.4
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.4-before:
|
|
|
|
|
|
2024-11-24 01:07:39 +01:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
|
|
* If ``product_price_list`` and ``product_price_list_dates`` are activated,
|
|
|
|
|
remove ``open_lines`` button:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
DELETE FROM "ir_model_button" WHERE "name" = 'open_lines' AND "model" = 'product.price_list';
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.2:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
7.2
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.2-before:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
|
|
* Use NULL value for empty foreign key with:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
UPDATE "ir_ui_view" SET "model" = NULL WHERE "model" = '';
|
|
|
|
|
UPDATE "ir_action_act_window" SET "res_model" = NULL WHERE "res_model" = '';
|
|
|
|
|
UPDATE "ir_action_wizard" SET "model" = NULL WHERE "model" = '';
|
|
|
|
|
UPDATE "ir_action_report" SET "model" = NULL WHERE "model" = '';
|
|
|
|
|
UPDATE "ir_action_report" SET "module" = NULL WHERE "module" = '';
|
|
|
|
|
UPDATE "ir_translation" SET "module" = NULL WHERE "module" = '';
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.0:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
7.0
|
|
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.0-before:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
2026-01-20 09:28:30 +01:00
|
|
|
* If ``account_payment_clearing`` module is activated, remove ``account`` if ``line`` is
|
2024-11-24 00:35:36 +01:00
|
|
|
set:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
UPDATE "account_payment" SET "account" = NULL WHERE "line" IS NOT NULL;
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-7.0-after:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
After
|
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
|
|
* If ``account_invoice`` module is activated, fill the amount caches with the
|
|
|
|
|
``trytond-console``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
Invoice = pool.get('account.invoice')
|
|
|
|
|
invoices = Invoice.search([('state', 'in', ['posted', 'paid'])])
|
|
|
|
|
for invoice in invoices:
|
|
|
|
|
invoice.untaxed_amount_cache = invoice.untaxed_amount
|
|
|
|
|
invoice.tax_amount_cache = invoice.tax_amount
|
|
|
|
|
invoice.total_amount_cache = invoice.total_amount
|
|
|
|
|
|
|
|
|
|
Invoice.save(invoices)
|
|
|
|
|
transaction.commit()
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
|
|
This process may take some time depending on the number of invoices on
|
|
|
|
|
your database.
|
|
|
|
|
|
|
|
|
|
* If ``product_price_list`` module is activated, add a default price list line
|
|
|
|
|
if price list does not have one and it was relying on the fallback price.
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-6.0:
|
|
|
|
|
|
2025-01-03 14:40:08 +01:00
|
|
|
6.0
|
2024-11-24 00:35:36 +01:00
|
|
|
---
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-6.0-before:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
Before
|
|
|
|
|
~~~~~~
|
|
|
|
|
|
|
|
|
|
* Add access on field:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
ALTER TABLE IF EXISTS "ir_model_field" ADD COLUMN IF NOT EXISTS "access" BOOLEAN;
|
|
|
|
|
|
|
|
|
|
* If ``account_invoice`` module is activated, fix ``currency``,
|
|
|
|
|
``invoice_type`` and ``party`` on ``account.invoice.line``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
UPDATE "account_invoice_line" SET "currency" = (SELECT "currency" FROM "account_invoice" WHERE "id" = "account_invoice_line"."invoice") WHERE "invoice" IS NOT NULL;
|
|
|
|
|
UPDATE "account_invoice_line" SET "invoice_type" = (SELECT "type" FROM "account_invoice" WHERE "id" = "account_invoice_line"."invoice") WHERE "invoice_type" IS NOT NULL AND "invoice" IS NOT NULL;
|
|
|
|
|
UPDATE "account_invoice_line" SET "party" = (SELECT "party" FROM "account_invoice" WHERE "id" = "account_invoice_line"."invoice") WHERE "party" IS NOT NULL AND "invoice" IS NOT NULL;
|
|
|
|
|
|
2026-01-20 09:26:56 +01:00
|
|
|
.. _migration-6.0-after:
|
|
|
|
|
|
2024-11-24 00:35:36 +01:00
|
|
|
After
|
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
|
|
* Remove code column on ``ir.sequence.type``:
|
|
|
|
|
|
|
|
|
|
.. code-block:: SQL
|
|
|
|
|
|
|
|
|
|
ALTER TABLE IF EXISTS "ir_sequence_type" DROP COLUMN IF EXISTS "code";
|