Migration from 5.8 to 6.0

Must

  • [SQL] fix currency, invoice_type and party on 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;
    
  • [SQL] before update, add access on field

    ALTER TABLE ir_model_field ADD COLUMN "access" BOOLEAN;
    

Should

  • [SQL] after update, remove code column
    ALTER table ir_sequence_type DROP COLUMN code;
    

A post was split to a new topic: How to update to 6.0 from Gentoo repository

Sorry for being picky at this point, but it seems as if there are two semicolons missing at the end of the command lines. True? For the less experienced user it is not obvious whether they are needed or not… ):

As well, to me it was not clear that commands 1-3 and 4 need to be executed in one sequence, is there any argument against putting all of the 4 lines in one box?

Cheers,
Wolf

Semicolon is not needed for single command.

UPDATE account_invoice_line SET party = (SELECT party FROM account_invoice WHERE id = account_invoice_line.invoice) WHERE party IS NOT NULL;

This query set nulls to party column of the invoice lines without invoice when the module purchase_invoice_line_standalone is activated.
The following query solves the issue:

update account_invoice_line as il set party = p.party from purchase_line pl, purchase_purchase p where invoice is null and il.party is null and il.origin like 'purchase.line,%' and CAST(substring(il.origin FROM POSITION(',' in il.origin)+1) AS integer) = pl.id and p.id = pl.purchase;

Indeed we just need to update line linked to an invoice.

Also I found some account invoice lines have not set the invoice_type. At the moment I fixed with:

UPDATE account_invoice_line SET invoice_type = 'in' WHERE invoice_type IS NULL and invoice is NULL and origin like 'purchase%';
UPDATE account_invoice_line SET invoice_type = 'out' WHERE invoice_type IS NULL and invoice is NULL and origin like 'sale%';

This is not needed as line without invoice has invoice_type required since the beginning.

And by the way, if there is a bug it should be reported on the bug tracker not as comment on the migration.

I try to report at Issue 10705: add_remove attribute don't filter field domain - Tryton issue tracker