ALTER TABLE "ir_translation" DROP CONSTRAINT IF EXISTS "ir_translation_translation_md5_uniq";
ALTER TABLE "ir_translation" DROP COLUMN IF EXISTS "src_md5";
After
~~~~~
* Remove error translations:
.. code-block:: SQL
DELETE FROM "ir_translation" WHERE "type" = 'error';
* Remove old users:
.. code-block:: SQL
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_chorus' AND "module" = 'account_fr_chorus';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_post_clearing_moves' AND "module" = 'account_payment_clearing';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_stripe' AND "module" = 'account_payment_stripe';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_marketing_automation' AND "module" = 'marketing_automation';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_generate_line_consumption' AND "module" = 'sale_subscription';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_generate_line_consumption' AND "module" = 'sale_subscription';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_generate_invoice' AND "module" = 'sale_subscription';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_role' AND "module" = 'user_role';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_trigger' AND "module" = 'res';
5.0
---
Before
~~~~~~
* If ``account_product`` module is activated, set an accounting category to all
products which have accounts and taxes defined (see `#3805
<https://bugs.tryton.org/3805>`_).
After
~~~~~
* Remove old users:
.. code-block:: SQL
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_process_sale' AND "module" = 'sale';
DELETE FROM "ir_model_data" WHERE "model" = 'res.user' AND "fs_id" = 'user_process_purchase' AND "module" = 'purchase';
* If ``account`` module is activated, clean ``account.journal.type`` data:
.. code-block:: SQL
DELETE FROM "ir_model_data" WHERE "model" = 'account.journal.type';
4.8
---
Before
~~~~~~
* Assign any record rules linked to users to a group.
* Add parent language:
.. code-block:: SQL
ALTER TABLE IF EXISTS "ir_lang" ADD COLUMN IF NOT EXISTS "parent" VARCHAR;
* If ``account`` module is activated, update tax line sign:
.. code-block:: SQL
UPDATE "account_tax_line" SET "amount" = -"amount" WHERE "id" IN (SELECT "tl"."id" FROM "account_tax_line" AS "tl" JOIN "account_move_line" AS "ml" ON "tl"."move_line" = "ml"."id" JOIN "account_move" AS "m" ON "ml"."move" = "m"."id" JOIN "account_invoice" AS "i" ON "i"."id" = CAST(SUBSTRING("m"."origin", 17) AS INTEGER) AND "m"."origin" like 'account.invoice,%' WHERE "tl"."amount" > 0 AND "ml"."credit" > 0 AND "i"."type" = 'in');
UPDATE "account_tax_line" SET "amount" = -"amount" WHERE "id" IN (SELECT "tl"."id" FROM "account_tax_line" AS "tl" JOIN "account_move_line" AS "ml" ON "tl"."move_line" = "ml"."id" JOIN "account_move" AS "m" ON "ml"."move" = "m"."id" JOIN "account_invoice" AS "i" ON "i"."id" = CAST(SUBSTRING("m"."origin", 17) AS INTEGER) AND "m"."origin" like 'account.invoice,%' WHERE "tl"."amount" > 0 AND "ml"."debit" > 0 AND "i"."type" = 'out');
After
~~~~~
* If ``account`` module is activated, update tax lines of inactive tax to their
..note:: Run multiple times until no record are deleted.
* Check taxes and tax codes definitions (inactivate old children taxes and add
them to the right codes)
4.6
---
Before
~~~~~~
* If ``web_user`` module is activated, update to lower case email of web users:
.. code-block:: SQL
UPDATE "web_user" SET "email" = LOWER("email");
4.4
---
Before
~~~~~~
* Remove deprecated modules:
.. code-block:: SQL
DELETE FROM "ir_module" WHERE "name" IN ('webdav', 'calendar', 'calendar_todo', 'calendar_scheduling', 'calendar_classification', 'party_vcarddav');
DELETE FROM "ir_ui_view" WHERE "module" IN ('webdav', 'calendar', 'calendar_todo', 'calendar_scheduling', 'calendar_classification', 'party_vcarddav');
* If ``party`` module is activated, update address formats:
.. code-block:: SQL
UPDATE "party_address_format" SET "format_" = REPLACE("format_", '${district}', '${subdivision}');
* If ``purchase`` module is activated, delete relation between purchase and invoice_line:
.. code-block:: SQL
DROP TABLE IF EXISTS "purchase_invoice_line_rel";
After
~~~~~
* If ``account_asset`` module is activated, the depreciation duration of the
products must be checked for all assets as previous value could not be
migrated (see `#6395 <https://bugs.tryton.org/6395>`_).
* After property migration old model data should be cleared:
.. code-block:: SQL
DELETE FROM "ir_model_data" WHERE "model" = 'ir.property';
4.2
---
Before
~~~~~~
* Language codes have been simplified.
If you want to keep custom translation you must update translation code to
match the new code.
Here is an example for the code change from ``en_US`` to ``en``:
* If ``account`` module is activated, update amount second currency with:
.. code-block:: SQL
UPDATE "account_move_line" SET "amount_second_currency" = ("amount_second_currency" * -1) WHERE "amount_second_currency" IS NOT NULL AND SIGN("amount_second_currency") != SIGN("debit" - "credit");