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.
Warning
You cannot skip more than 2 series ending with .0.
7.8#
After#
If
account_payment_sepamodule is activated, fill the address of validated mandates with default value with thetrytond-console:Mandate = pool.get('account.payment.sepa.mandate') mandates = Mandate.search([ ('state', '=', 'validated'), ('address', '=', None), ]) for mandate in mandates: mandate.address = mandate.on_change_party() Mandate.save(mandates)
7.6#
Before#
Rename columns of
ir.modelandir.model.field: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";
pbkdf2_sha512andscryptpassword hashes are no more supported. Make sure to enableargon2and update old passwords by logging in.
After#
If
stockmodule is activated with internal shipment using transit location, fill the internal transit location with thetrytond-console: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 Shipment.save(shipments) transaction.commit()
If
account_budgetmodule is activated, invert amount sign:UPDATE "account_budget_line" SET amount = -amount;
If
analytic_budgetmodule is activated, invert amount sign:UPDATE "analytic_account_budget_line" SET amount = -amount;
7.4#
Before#
If
product_price_listandproduct_price_list_datesare activated, removeopen_linesbutton:DELETE FROM "ir_model_button" WHERE "name" = 'open_lines' AND "model" = 'product.price_list';
7.2#
Before#
Use NULL value for empty foreign key with:
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" = '';
7.0#
Before#
If
account_paymentmodule is activated, removeaccountiflineis set:UPDATE "account_payment" SET "account" = NULL WHERE "line" IS NOT NULL;
After#
If
account_invoicemodule is activated, fill the amount caches with thetrytond-console: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_listmodule is activated, add a default price list line if price list does not have one and it was relying on the fallback price.
6.0#
Before#
Add access on field:
ALTER TABLE IF EXISTS "ir_model_field" ADD COLUMN IF NOT EXISTS "access" BOOLEAN;
If
account_invoicemodule is activated, fixcurrency,invoice_typeandpartyonaccount.invoice.line: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;
After#
Remove code column on
ir.sequence.type:ALTER TABLE IF EXISTS "ir_sequence_type" DROP COLUMN IF EXISTS "code";