tryton-upgrades/config.yml

716 lines
37 KiB
YAML
Raw Normal View History

2017-01-19 01:59:38 +01:00
---
to_uninstall:
- account_invoice_post_in_tree
- account_cash_management
2017-01-19 01:59:38 +01:00
- account_chart_speedup
- account_invoice_data
- account_invoice_post_in_tree
- account_move_party_required
- account_payment_bank
2017-01-19 01:59:38 +01:00
- account_payment_es_csb_19
- account_payment_es_csb_32
- account_payment_es_csb_34
- account_payment_es_csb_34_01
- account_payment_es_csb_34_1_la_caixa
- account_payment_es_csb_34_11
2018-02-06 18:08:02 +01:00
- account_payment_es_csb_58
2018-09-18 23:24:15 +02:00
- account_payment_type_move
- account_bank_statement_csb43
2017-01-19 01:59:38 +01:00
- account_statement_of_account
- asset_attribute
2019-02-09 07:31:40 +01:00
- account_payment_bank
- account_payment_type_move
2018-05-10 10:18:33 +02:00
- aeat_340
2017-01-19 01:59:38 +01:00
- aeat_303_es
- aeat_349_es
- asset_guarantee
- asset_estate
- audit_log
- calendar
- calendar_classification
- calendar_scheduling
- calendar_todo
- country_zip_es
2019-02-09 07:31:40 +01:00
- guarantee
2020-05-07 15:46:32 +02:00
- party_credit_limit
2018-02-06 18:08:02 +01:00
- party_vcarddav
- party_merge
2017-01-19 01:59:38 +01:00
- product_configuration
2018-02-27 12:34:09 +01:00
- project_auto_timesheet
- project_asterisk
- project_current_effort
- project_unittest
- project_unittest
- product_price_list_category
- sale_invoices_paid
- sale_shipments_done
2018-02-06 18:08:02 +01:00
- stock_delivery_note_valued_jreport
- stock_picking_box
- stock_lot_expiry
- stock_reservation
- webdav
2017-01-19 01:59:38 +01:00
2017-12-06 10:14:44 +01:00
to_install:
2019-06-21 09:17:34 +02:00
- account_product_accounting
2018-02-14 15:50:13 +01:00
- account_move_draft
2018-07-05 20:18:14 +02:00
- account_invoice_line_description
- party_identifier
- account_invoice_company_currency
2018-02-06 18:14:27 +01:00
- electronic_mail
- html_report
2017-01-19 01:59:38 +01:00
before:
2017-04-19 09:54:53 +02:00
# - tables: ir_model_data
# version: 3.2
# query: ALTER TABLE ir_model_data ADD COLUMN fs_values TEXT;
2017-01-20 01:01:29 +01:00
- UPDATE ir_model_data SET module = 'aeat_303' WHERE module = 'aeat_303_es';
- UPDATE ir_model_data SET module = 'aeat_349' WHERE module = 'aeat_349_es';
- UPDATE ir_translation SET module = 'aeat_303' WHERE module = 'aeat_303_es';
- UPDATE ir_translation SET module = 'aeat_349' WHERE module = 'aeat_349_es';
- DELETE from ir_ui_view where module = '';
- DELETE from ir_ui_view where data = '' and module = 'account_payment_type';
- UPDATE ir_ui_view SET type = NULL WHERE inherit IS NOT NULL AND type IS NOT NULL AND module <> 'farm';
2017-01-20 01:01:29 +01:00
- DELETE FROM ir_model_data WHERE model='stock.location' AND fs_id LIKE '%transit%'
2017-07-14 15:18:55 +02:00
- DELETE FROM ir_ui_view where module = '%sale%milestone%'
2018-03-23 16:52:58 +01:00
2019-04-13 15:26:07 +02:00
- comment: Remove name from account journal period
2019-05-08 10:00:56 +02:00
version: 4.8
query: ALTER TABLE account_journal_period DROP COLUMN IF EXISTS name;
2019-04-13 15:26:07 +02:00
- comment: drop constraint, new ones applied on module
version: 5.1
query: ALTER TABLE account_account DROP CONSTRAINT IF EXISTS account_account_code_uniq;
- comment: # copy to migrate default values, must be dropped
version: 4.8
2019-04-03 14:27:30 +02:00
query: CREATE TABLE if not exists ir_property_backup as (select * from ir_property)
- comment: #Adapat fields from stock_lot_expiry to stock_lot_sled
fields: product_template.life_time
version: 4.8
query: ALTER TABLE product_template rename column life_time to shelf_life_time;
- comment: #Adapat fields from stock_lot_expiry to stock_lot_sled
fields: product_template.expiry_time
version: 4.8
query: ALTER TABLE product_template rename column expiry_time to expiration_time;
- comment: #Adapat fields from stock_lot_expiry to stock_lot_sled
fields: stock_lot.life_date
version: 4.8
query: ALTER TABLE stock_lot rename column life_date to shelf_life_expiration_date;
- comment: #Adapat fields from stock_lot_expiry to stock_lot_sled
fields: stock_lot.expiry_date
version: 4.8
query: ALTER TABLE stock_lot rename column expiry_date to expiration_date;
- comment: # Tax migration from new tax rules. on 4.7
tables: aeat_347_record
version: 4.8
query: create table if not exists mapping_taxes as select
a.*,
t.template as parent_template,
t.name
from (
select
t.id as tax_id,
t.name as tax_name,
t.parent as tax_parent,
t.include_347,
t.recargo_equivalencia,
i.fs_id,
i.db_id as template_id,
split_part(i.fs_id, '+',1)
from
ir_model_data i,
account_tax_template tt,
account_tax t
where
tt.id = t.template and
db_id = tt.id and
model='account.tax.template' and module='account_es' and
tt.parent is not null and fs_id like '%_child'
2019-06-20 10:52:15 +02:00
and t.include_347=true and t.recargo_equivalencia=false
UNION ALL
select
t.id as tax_id,
t.name as tax_name,
t.parent as tax_parent,
t.include_347,
t.recargo_equivalencia,
i.fs_id,
i.db_id as template_id,
rtrim(rtrim(rtrim(split_part(i.fs_id, '+',2),'_child'), 'iva'), 'irpf')
from
ir_model_data i,
account_tax_template tt,
account_tax t
where
tt.id = t.template and
i.db_id = tt.id and
model='account.tax.template' and module='account_es' and
tt.parent is not null and fs_id like '%_child'
2019-06-20 10:52:15 +02:00
and t.include_347 = false and t.recargo_equivalencia=false
UNION ALL
select
t.id as tax_id,
t.name as tax_name,
t.parent as tax_parent,
t.include_347,
t.recargo_equivalencia,
i.fs_id,
i.db_id as template_id,
rtrim(rtrim(rtrim(split_part(i.fs_id, '+',2),'_child'), 'iva'), '_re')
from
ir_model_data i,
account_tax_template tt,
account_tax t
where
tt.id = t.template and
i.db_id = tt.id and
model='account.tax.template' and module='account_es' and
tt.parent is not null and fs_id like '%_child'
and t.include_347 = true and t.recargo_equivalencia=true
2019-06-20 10:52:15 +02:00
UNION ALL
select
t.id as tax_id,
t.name as tax_name,
t.parent as tax_parent,
t.include_347,
t.recargo_equivalencia,
i.fs_id,
i.db_id as template_id,
rtrim(rtrim(rtrim(split_part(i.fs_id, '+',1),'_child'), 'iva'), '_re')
from
ir_model_data i,
account_tax_template tt,
account_tax t
where tt.id = t.template and
i.model='account.tax.template' and
i.module='account_es' and
i.db_id = tt.id and
t.parent is not null and fs_id like '%+re%iva_child'
) as a,
account_tax t
where a.tax_parent = t.id
- comment: remove deferral value in ir_model_data
version: 4.0
query: UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["deferral", false], ', '') where fs_values ilike '%["deferral", false],%' and module = 'account_es';
UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["deferral", true], ', '') where fs_values ilike '%["deferral", true],%' and module = 'account_es';
UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["deferral",true],', '') where fs_values ilike '%["deferral",true],%' and module = 'account_es';
UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["deferral",false],', '') where fs_values ilike '%["deferral",false],%' and module = 'account_es';
- comment:
2019-09-25 14:07:27 +02:00
vestion: 4.0
query: ALTER TABLE res_user_login_attempt ALTER COLUMN login TYPE VARCHAR(512);
- tables: stock_location
2019-09-25 14:07:27 +02:00
version: 4.0
query: INSERT INTO stock_location (name, code, type, create_uid, create_date, "right", "left") VALUES ('Migration Drop Shipment', 'DROPMIGRATION', 'drop', 0, '2016-10-04 00:00:00', 0, 0);
2017-01-20 01:01:29 +01:00
- comment: # Rename table name - 3.6 migration
tables: account_financial_statement
2017-01-19 01:59:38 +01:00
query:
ALTER TABLE account_financial_statement_report_line_account
RENAME TO account_financial_statement_rep_lin_acco
- tables: account_financial_statement
query:
ALTER TABLE account_financial_statement_report_line_account_id_seq
RENAME TO account_financial_statement_rep_lin_acco_id_seq
# - comment: # [SQL]: Change tax sign for credit note (must be run before update)
# tables: account_tax_template
# version: 4.0
# query:
# UPDATE account_tax_template
# SET
# credit_note_base_sign = credit_note_base_sign * -1,
# credit_note_tax_sign = credit_note_tax_sign * -1;
2018-05-03 23:00:59 +02:00
- tables: account_tax
version: 4.0
query:
UPDATE account_tax
SET
credit_note_base_sign = credit_note_base_sign * -1,
credit_note_tax_sign = credit_note_tax_sign * -1;
2017-01-19 01:59:38 +01:00
2017-01-21 01:42:34 +01:00
- comment: # [SQL]: Fix amount second currency with 3.4 -> 3.6
version: 3.6
2017-01-20 01:01:29 +01:00
tables: account_move_line
2017-01-19 01:59:38 +01:00
query:
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)
- tables: shipment_work
2019-09-24 09:16:58 +02:00
version: 4.0
2017-01-19 01:59:38 +01:00
query: ALTER TABLE shipment_work RENAME COLUMN project TO work_project
- fields: sale_sale.project
2019-09-24 09:16:58 +02:00
version: 4.0
2017-01-19 01:59:38 +01:00
query: ALTER TABLE sale_sale RENAME COLUMN project TO work_project
2018-02-06 18:08:02 +01:00
- comment: # change PYSON context menu
version: 4.0
tables: babi_report
query: "UPDATE ir_action_act_window SET domain = '[[\"parent\", \"=\", null]]', context = '{\"babi_tree_view\": true}' WHERE context like '%babi%'"
2017-10-02 14:22:55 +02:00
- comment: babi introduces the company field with NOT NULL to babi_report_execution so we drop all data to ensure the constraint can be added
version: 4.2
tables: babi_report_execution
query: DELETE FROM babi_report_execution;
- comment: # set domain to null in account bank statement
version: 4.0
query: UPDATE ir_action_act_window SET domain = null where id in (SELECT db_id FROM ir_model_data where fs_id = 'act_account_bank_statement');
- comment: # set domain to null in account bank statement line
version: 4.0
query: UPDATE ir_action_act_window SET domain = null where id in (SELECT db_id FROM ir_model_data where fs_id = 'act_account_bank_statement_line');
- comment: # set update_unit_price to false
version: 4.0
query: update account_tax_template set update_unit_price = false where id = (select db_id from ir_model_data where fs_id = 'iva_reagp_compras_12_1');
2018-02-06 18:08:02 +01:00
- comment: # rename locale languages
version: 4.2
query: UPDATE ir_translation SET lang = 'en' WHERE lang = 'en_US';UPDATE ir_translation SET lang = 'ca' WHERE lang = 'ca_ES';UPDATE ir_translation SET lang = 'es' WHERE lang = 'es_ES';UPDATE ir_translation SET lang = 'pt' WHERE lang = 'pt_PT';UPDATE ir_translation SET lang = 'de' WHERE lang = 'de_DE';UPDATE ir_translation SET lang = 'it' WHERE lang = 'it_IT';UPDATE ir_translation SET lang = 'fr' WHERE lang = 'fr_FR';
- comment: # rename configuration locale
version: 4.2
query: UPDATE ir_configuration SET language = 'en' WHERE language = 'en_US';UPDATE ir_configuration SET language = 'ca' WHERE language = 'ca_ES';
- comment: # delete modules
version: 4.4
2018-03-23 16:52:58 +01:00
tables: ir_module
2018-02-06 18:08:02 +01:00
query: DELETE FROM ir_module WHERE name IN ('webdav', 'calendar', 'calendar_todo', 'calendar_scheduling', 'calendar_classification', 'party_vcarddav');
2018-03-23 16:52:58 +01:00
- comment: # delete modules
tables: ir_module_module
version: 4.4
query: DELETE FROM ir_module_module WHERE name IN ('webdav', 'calendar', 'calendar_todo', 'calendar_scheduling', 'calendar_classification', 'party_vcarddav');
2018-02-06 18:08:02 +01:00
- comment: # delete modules views
version: 4.4
query: DELETE FROM ir_ui_view WHERE module IN ('webdav', 'calendar', 'calendar_todo', 'calendar_scheduling', 'calendar_classification', 'party_vcarddav');
2018-02-14 15:50:13 +01:00
2018-02-06 18:08:02 +01:00
- comment: # update format address
2018-02-14 15:50:13 +01:00
tables: party_address_format
2018-02-06 18:08:02 +01:00
version: 4.4
query: UPDATE party_address_format SET format_ = REPLACE(format_, '${district}', '${subdivision}');
2018-02-14 15:50:13 +01:00
- comment: # remove wrong proprties
version: 4.4
query: delete from ir_property where res like 'party.party,None';
2018-02-06 18:08:02 +01:00
- comment: # delete party ir properties
version: 4.4
query: DELETE FROM ir_property where res like 'party.party,%' and SUBSTRING(res, POSITION(',' IN res) + 1)::integer not in (select id from party_party);
2018-02-14 15:50:13 +01:00
2018-02-06 18:08:02 +01:00
- comment: # delete product category ir properties
version: 4.4
query: DELETE FROM ir_property where res like 'product.category,%' and SUBSTRING(res, POSITION(',' IN res) + 1)::integer not in (select id from product_category);
- comment: # delete product ir properties
version: 4.4
query: DELETE FROM ir_property where res like 'product.template,%' and SUBSTRING(res, POSITION(',' IN res) + 1)::integer not in (select id from product_template);
2018-02-14 15:50:13 +01:00
- comment: # delete account_tax_rule ir properties
version: 4.4
query: DELETE FROM ir_property where value like 'account_tax_rule,None';
- comment: # delete account_tax_rule ir properties
version: 4.4
query: DELETE FROM ir_property where value like 'account_tax_rule,%' and SUBSTRING(value, POSITION(',' IN value) + 1)::integer not in (select id from account_tax_rule);
2018-04-18 11:39:30 +02:00
- comment: # delete properties of account_journal without foreign key
2018-03-23 16:52:58 +01:00
version: 4.7
query: delete from ir_property where id in (select id from ir_property where res like 'account.journal%' and value like 'ir.sequence%' and split_part(res, ',', 2)::int not in (select id from account_journal));
2018-04-18 11:39:30 +02:00
- comment: # delete properties of account_journal without foreign key
version: 4.7
query: delete from ir_property where id in (select id from ir_property where res like 'account.journal%' and value like 'account.account%' and split_part(res, ',', 2)::int not in (select id from account_journal));
- comment: # delete properties of stock_sequence without foreign key
version: 4.7
query: delete from ir_property where id in (select id from ir_property where res like 'stock.configuration%' and value like 'ir.sequence%' and split_part(res, ',', 2)::int not in (select id from ir_sequence));
2018-12-08 06:51:03 +01:00
- comment: # delete properties of party and account without foreign key
version: 4.7
query: delete from ir_property where id in (select id from ir_property where res like 'party.party%' and value like 'account.account%' and split_part(value, ',', 2)::int not in (select id from account_account));
2019-02-16 06:38:08 +01:00
- comment: # delete default properties
version: 4.7
query: delete from ir_property where res is null;
2018-04-18 11:39:30 +02:00
2018-02-06 18:08:02 +01:00
# - comment: # drop ir properties in case account_asset is installed
# version: 4.4
# script: TODO https://bugs.tryton.org/issue6395
2018-05-03 23:00:59 +02:00
2018-02-06 18:08:02 +01:00
- comment: # update default_country ir_property
version: 4.4
query: UPDATE ir_property SET res = null where field in (select id from ir_model_field where name = 'default_country') and res = 'party.configuration,1';
- comment: # Update to lower case email of web users
version: 4.6
tables: web_user
query: UPDATE web_user SET email = LOWER(email);
2018-02-14 15:50:13 +01:00
# account_es and aeat
2018-02-06 18:08:02 +01:00
- comment: # add new column in code_uniq constrain when upgrade
version: 4.6
query: ALTER TABLE account_account_template DROP CONSTRAINT if exists "account_account_template_code_uniq";
2018-02-14 15:50:13 +01:00
# - comment: # Rename model data aeat_349
# version: 4.6
# tables: ir_module
# query: UPDATE ir_model_data set fs_id = fs_id || (select CASE WHEN state = 'installed' THEN '_pyme' ELSE '_normal' END FROM ir_module where name = 'account_es_pyme') where module = 'aeat_349' and fs_id like 'aeat_349_template%';
#
# - comment: # Rename model data aeat_349
# version: 4.6
# tables: ir_module_module
# query: UPDATE ir_model_data set fs_id = fs_id || (select CASE WHEN state = 'installed' THEN '_pyme' ELSE '_normal' END FROM ir_module_module where name = 'account_es_pyme') where module = 'aeat_349' and fs_id like 'aeat_349_template%';
#
# - comment: # Rename model data aeat_303
# version: 4.6
# tables: ir_module
# query: UPDATE ir_model_data set fs_id = fs_id || (select CASE WHEN state = 'installed' THEN '_pyme' ELSE '_normal' END FROM ir_module where name = 'account_es_pyme') where module = 'aeat_303' and fs_id like 'aeat_303_mapping_code_%_val%';
#
# - comment: # Rename model data aeat_303
# version: 4.6
# tables: ir_module_module
# query: UPDATE ir_model_data set fs_id = fs_id || (select CASE WHEN state = 'installed' THEN '_pyme' ELSE '_normal' END FROM ir_module_module where name = 'account_es_pyme') where module = 'aeat_303' and fs_id like 'aeat_303_mapping_code_%_val%';
#
# - comment: # Rename model data aeat_340
# version: 4.6
# tables: ir_module
# query: UPDATE ir_model_data set fs_id = fs_id || (select CASE WHEN state = 'installed' THEN '_pyme' ELSE '_normal' END FROM ir_module where name = 'account_es_pyme') where module = 'aeat_340' and fs_id like 'aeat_340_template_type_%';
#
# - comment: # Rename model data aeat_340
# version: 4.6
# tables: ir_module_module
# query: UPDATE ir_model_data set fs_id = fs_id || (select CASE WHEN state = 'installed' THEN '_pyme' ELSE '_normal' END FROM ir_module_module where name = 'account_es_pyme') where module = 'aeat_340' and fs_id like 'aeat_340_template_type_%';
2018-03-23 16:52:58 +01:00
- comment: # Add exceptional parent language (must be run before update
version: 4.8
tables: ir_lang
query: ALTER TABLE ir_lang ADD parent VARCHAR;
2018-05-29 16:57:59 +02:00
- comment: # delete register with type 'jasper' on core modules
version: 4.8
query: delete from ir_translation where module in ('account_invoice', 'sale', 'stock', 'purchase') and type = 'jasper';
- comment: # update jasper translations to report type
2018-05-29 16:57:59 +02:00
version: 4.8
2018-05-15 14:31:35 +02:00
query: update ir_translation set type = 'report' where type = 'jasper';
2018-02-06 18:08:02 +01:00
2019-02-09 07:31:40 +01:00
- comment: # uninstall account_es_pyme and install account_es
version: 4.6
where: SELECT count(*) FROM ir_model_data WHERE fs_id = 'es_pymes';
query: UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'base_pymes_', 'base_') where fs_id like 'base_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'baser_pymes_', 'baser_') where fs_id like 'baser_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'cuota_pymes_', 'cuota_') where fs_id like 'cuota_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'cuotar_pymes_', 'cuotar_') where fs_id like 'cuotar_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'cuotas_pymes_', 'cuotas_') where fs_id like 'cuotas_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'es_balance_pymes', 'es_balance_normal') where fs_id like 'es_balance_pymes%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'es_pyg_pymes', 'es_pyg_normal') where fs_id like 'es_pyg_pymes%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'es_pymes', 'es') where fs_id = 'es_pymes' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'fp_pymes_', 'fp_') where fs_id like 'fp_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'fptt_pymes_', 'fptt_') where fs_id like 'fptt_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'igic_pymes_', 'igic_') where fs_id like 'igic_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'irpf_pymes_', 'irpf_') where fs_id like '%irpf_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'ispc_pymes', 'ispc') where fs_id = 'ispc_pymes' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'irpf_pymes_', 'irpf_') where fs_id like 'irpf_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'iva_pymes_', 'iva_') where fs_id like '%iva_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 're_pymes_', 're_') where fs_id like '%re_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'pgc_pymes_', 'pgc_') where fs_id like 'pgc_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'recc_pymes', 'recc') where fs_id like 'recc_pymes%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'suplido_pymes_', 'suplido_') where fs_id like 'suplido_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'bases_pymes_', 'bases_') where fs_id like 'bases_pymes_%' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'vat_code_chart_pymes_root', 'vat_code_chart_root') where fs_id = 'vat_code_chart_pymes_root' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'tax_group_both_pymes', 'tax_group_both') where fs_id = 'tax_group_both_pymes' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'tax_group_purchase_pymes', 'tax_group_purchase') where fs_id = 'tax_group_purchase_pymes' and module = 'account_es_pyme';
UPDATE ir_model_data set fs_id = REPLACE(fs_id, 'tax_group_sale_pymes', 'tax_group_sale') where fs_id = 'tax_group_sale_pymes' and module = 'account_es_pyme';
UPDATE ir_model_data SET module = 'account_es' WHERE module = 'account_es_pyme';
UPDATE ir_translation set module = 'account_es' where module = 'account_es_pyme';
UPDATE ir_ui_view set module = 'account_es' where module = 'account_es_pyme';
UPDATE ir_model_field set module = 'account_es' where module = 'account_es_pyme';
UPDATE ir_module set state = 'not activated' where name = 'account_es_pyme';
UPDATE ir_module set state = 'activated' where name = 'account_es';
DELETE from ir_module_dependency where name = 'account_es_pyme';
- comment: # delete ir.export.line that has not export value trytond-issue6551
version: 4.4
query: DELETE from ir_export_line where export is null;
- comment: # upgrade ir.configuration
version: 4.2
query: update ir_configuration set language = 'es';
- comment: # alter table aeat_347_report_property column number
version: 4.2
2018-12-14 16:00:37 +01:00
tables: aeat_347_report_property
query: ALTER table aeat_347_report_property alter column number TYPE varchar(5);
- comment: # alter table aeat_303_report column previous_declaration_receipt
version: 4.2
tables: aeat_303_report
query: ALTER TABLE aeat_303_report ALTER COLUMN previous_declaration_receipt TYPE VARCHAR(13);
- comment: # remove deprecated journal type ir.model.data
version: 5.0
query: DELETE from ir_model_data where fs_id in ('journal_type_general', 'journal_type_revenue', 'journal_type_expense', 'journal_type_cash', 'journal_type_situation', 'journal_type_write_off', 'journal_type_statement');
- comment: # Delete unused crons
version: 4.8
query: DELETE from ir_cron where function in ('generate_requests', 'generate_internal_shipment');
DELETE from ir_model_data where module = 'stock_supply' and model = 'ir.cron';
2019-01-07 12:00:59 +01:00
- comment: # Remove error translations
2019-04-03 14:27:30 +02:00
version: 5.1
2019-01-07 12:00:59 +01:00
query: DELETE FROM "ir_translation" WHERE "type" = 'error';
2019-04-03 14:27:30 +02:00
- comment: # Remove src_md5 from ir_translation
version: 5.1
query: ALTER TABLE "ir_translation" DROP CONSTRAINT if exists "ir_translation_translation_md5_uniq";
- comment: # Remove src_md5 from ir_translation
version: 5.1
query: ALTER TABLE "ir_translation" DROP COLUMN if exists "src_md5";
- comment: # Rename account_category from product, if migrating from 4.0 or higher thtows error because accounts_category already exists
version: 4.0
query: ALTER TABLE product_template RENAME column account_category TO accounts_category;
- comment: # Change cast of month on account_invoice_payment_term_line
version: 4.0
2019-08-14 12:42:13 +02:00
fields: account_invoice_payment_term_line.month
query: ALTER TABLE account_invoice_payment_term_line ALTER COLUMN month TYPE INTEGER USING month::INT
2019-04-03 14:27:30 +02:00
- comment: # Change cast of weekday on account_invoice_payment_term_line
version: 4.0
2019-08-14 12:42:13 +02:00
fields: account_invoice_payment_term_line.weekday
query: ALTER TABLE account_invoice_payment_term_line ALTER COLUMN weekday TYPE INTEGER USING weekday::INT
2019-04-09 13:57:38 +02:00
- comment: # Set Second Currency of account_Account null if it's equal of company currency
2019-05-08 10:00:56 +02:00
version: 4.8
2019-04-13 15:26:07 +02:00
query: update account_account set second_currency = null where second_currency=(select currency from company_company where id=company)
- comment: # remove style option in ir.action.window
version: 4.8
query: UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["style",""],', '') where fs_id like 'report_%' and model = 'ir.action.report';
UPDATE ir_model_data set values = REPLACE(fs_values, '["style",""],', '') where fs_id like 'report_%' and model = 'ir.action.report';
UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["style","company/header_A4.odt"],', '') where fs_id like 'report_%' and model = 'ir.action.report';
UPDATE ir_model_data set fs_values = REPLACE(fs_values, '["style","company/header_A4.odt"],', '') where fs_id like 'report_%' and model = 'ir.action.report';
- comment: Remove lead_time field from stock_location_lead_time. The type was float in our patch in version 3.4 but now it's better to remove and let trytond recreate it as few people are using it.
version: 5.2
fields: stock_location_lead_time.lead_time
query: ALTER TABLE stock_location_lead_time DROP COLUMN lead_time;
- comment: Remove lead_time field from production_lead_time. The type was float in our patch in version 3.4 but now it's better to remove and let trytond recreate it as few people are using it.
version: 5.2
fields: production_lead_time.lead_time
query: ALTER TABLE production_lead_time DROP COLUMN lead_time;
- script: ./upgrades/before/remove_deprecated_taxes.py
- comment: replace account_payment_sepa_message from TEXT to BYTEA
version: 5.4
tables: account_payment_sepa_message
query: ALTER TABLE account_payment_sepa_message ALTER COLUMN message TYPE BYTEA USING message::BYTEA;
- comment: # Delete unused users
version: 4.8
query: DELETE FROM ir_model_data WHERE module = 'stock_supply' AND model = 'res.user';
DELETE FROM ir_model_data WHERE module = 'stock_supply_production' AND model = 'res.user';
DELETE FROM ir_model_data WHERE module = 'res' AND model = 'res.user' AND fs_id IN ('user_trigger', 'user_cron_trigger');
2020-05-10 09:03:27 +02:00
- comment: # Upgrade 5.6
version: 5.6
tables: sale_amendment_line
query: ALTER TABLE sale_amendment_line DROP CONSTRAINT sale_amendment_line_shipment_party_fkey;
after:
- comment: Remove include_347 from diferent models
version: 5.1
query: ALTER TABLE party_party DROP COLUMN IF EXISTS include_347; ALTER TABLE account_tax_rule DROP COLUMN IF EXISTS include_347; ALTER TABLE account_tax_rule_template DROP COLUMN IF EXISTS include_347;
2017-01-19 01:59:38 +01:00
- DELETE FROM ir_translation WHERE module = 'account_es_pyme';
- comment: -> Change sign on account_tax_line
version: 3.8 # TODO: check i 3.8 needs.
query: update account_tax_line set amount=amount*-1 where type = 'tax' and tax in (select id from account_tax where name ilike '%(2)%');
2019-06-26 11:59:06 +02:00
- comment: # translations fuzzy to false
query: UPDATE ir_translation set fuzzy = false where fuzzy = true and res_id = -1;
- tables: aeat_303_mapping-account_tax_code
query: delete from "aeat_303_mapping-account_tax_code"
- tables: aeat_303_mapping
query: delete from aeat_303_mapping ;
2018-04-13 12:41:42 +02:00
- comment: -> 4.7
version: 4.7
tables: account_tax_template
2018-04-13 12:41:42 +02:00
query: update account_tax_template set update_unit_price = false where update_unit_price
- comment: -> 4.7
version: 4.7
tables: account_tax
2018-04-13 12:41:42 +02:00
query: update account_tax set update_unit_price = false where update_unit_price
- comment: -> 4.0
2017-01-21 01:30:25 +01:00
version: 4.0
query: UPDATE account_move_reconciliation SET date=create_date::DATE WHERE date IS NULL;
2017-01-20 01:01:29 +01:00
- comment: # Change login's length
query: ALTER TABLE res_user_login_attempt ALTER COLUMN login TYPE character varying(512);
- comment: # Mark all categories as accounting type
2017-01-21 01:30:25 +01:00
version: 4.0
2017-01-20 01:01:29 +01:00
tables: product_category
query: UPDATE product_category SET accounting = True;
- comment: # Set reconciliation date
tables: account_move_reconciliation
query: UPDATE account_move_reconciliation SET date=create_date WHERE date IS NULL;
- tables: account_move_reconciliation
query: ALTER TABLE account_move_reconciliation ALTER COLUMN date SET NOT NULL;
- tables: contract
2017-04-19 09:54:53 +02:00
query: UPDATE contract SET first_invoice_date=start_period_date WHERE first_invoice_date IS NULL;
2017-01-20 01:01:29 +01:00
- tables: asset
query: ALTER TABLE asset ALTER COLUMN company SET NOT NULL;
- tables: timesheet_line
query: ALTER TABLE timesheet_line ALTER COLUMN duration SET NOT NULL;
- tables: stock_shipment_in_return
query: ALTER TABLE stock_shipment_in_return ALTER COLUMN supplier SET NOT NULL;
- tables: contract
query: ALTER TABLE contract ALTER COLUMN first_invoice_date SET NOT NULL;
- tables: asset
query: UPDATE asset SET company = 1 WHERE company IS NULL;
2017-01-21 00:57:41 +01:00
- comment: Drop category column
fields: product_template.category
query: ALTER TABLE product_template DROP COLUMN category;
- tables: country_zip
query: update country_zip set country = (select id from country_country where code = 'ES') where country_zip is null;
version: 4.0
- tables: electronic_mail_template
2019-09-25 14:07:27 +02:00
version: 4.0
query: update electronic_mail_template set subject = regexp_replace(subject, 'record.code', 'record.number', 'g'), plain = regexp_replace(plain, 'record.code', 'record.number', 'g'), html = regexp_replace(html, 'record.code', 'record.number', 'g') where model in (select id from ir_model where model in ('account.invoice', 'sale.sale', 'purchase.purchase', 'stock.shipment.in', 'stock.shipment.out', 'stock.shipment.in'));
- comment: # change code to number electronic mail template
version: 4.0
tables: electronic_mail_template
query: update ir_translation set value = regexp_replace(value, 'record.code', 'record.number', 'g') where res_id in (select id from electronic_mail_template where model in (select id from ir_model where model in ('account.invoice', 'sale.sale', 'purchase.purchase', 'stock.shipment.in', 'stock.shipment.out', 'stock.shipment.in'))) and name like 'electronic.mail.template,%';
2017-04-19 09:54:53 +02:00
- comment: # After property migration old model data should be cleared:
version: 4.4
query: DELETE FROM ir_model_data WHERE model = 'ir.property';
- comment: # Relation between purchase and invoice_lines must be deleted
2018-02-06 18:08:02 +01:00
version: 4.4
2018-02-14 15:50:13 +01:00
query: DROP TABLE if exists purchase_invoice_line_rel;
- comment: # Update address formats
version: 4.4
query: UPDATE party_address_format SET format_ = REPLACE(format_, '${district}', '${subdivision}');
2018-02-06 18:08:02 +01:00
- comment: # delete duplicated party configuration sequence
version: 4.4
query: DELETE FROM party_configuration_party_sequence where id = 2;
2018-02-14 15:50:13 +01:00
- comment: # migration from sale_opportunity module to core.
2018-03-23 16:52:58 +01:00
tables: opportunity_sale_rel
version: 4.7
query: update sale_sale s set origin = 'sale.opportunity,'|| o.opportunity from opportunity_sale_rel o where s.id = o.sale
- comment: # update template extension jasper reports
version: 4.7
query: update ir_action_report set template_extension = 'jrxml' where report like '%jrxml';
- comment: # Set product as producible
version: 4.7
tables: "product_product-production_bom"
query: update product_template set producible = true where id in(select p.template from "product_product-production_bom" pb, product_product p where pb.product=p.id)
- comment: # Set account in account bank statement journal. Get value from ir_propery and try find credit or debit account because in ir_model_field there is no available ID field
version: 4.7
tables: "account_bank_statement_journal"
query: update account_bank_statement_journal set account = substring(sub.value, 17)::int from (select ip.value, ip.res from account_bank_statement_journal as absj left join account_journal as aj on absj.journal = aj.id inner join ir_property_backup as ip on ip.res = concat('account.journal,', aj.id) and ip.value like 'account.account,%') as sub where journal = substring(sub.res, 17)::int;
- comment: # deprecated model
version: 4.7
query: DELETE from ir_model_data where model = 'account.journal.type'
2019-07-03 10:25:12 +02:00
- comment: # update sale customer_reference to sale reference (sale_reference)
fields: sale_sale.customer_reference
version: 4.8
query: update sale_sale set reference = customer_reference where customer_reference is not null and customer_reference != '';
- comment: # Remove account_bank_reconciliation that the bank_reconcile is False in account
version: 4.8
tables: "account_bank_reconciliation"
query: delete from account_bank_reconciliation where id in (select abr.id from account_bank_reconciliation as abr left join account_move_line as aml on abr.move_line = aml.id left join account_account as aa on aa.id = aml.account where aa.bank_reconcile = False);
2019-07-03 10:25:12 +02:00
- comment: # Set end_date inactive account taxes and accounts
version: 5.0
query: update account_account set end_date = current_date, template_override = True where active = False and end_date is null and template is not null;
update account_account set end_date = current_date where active = False and end_date is null;
update account_tax set end_date = current_date, template_override = True where active = False and end_date is null and template is not null;
update account_tax set end_date = current_date, template_override = True where active = False and end_date is null;
- comment: # Set end_date inactive account taxes and accounts
version: 5.0
query: update account_account set end_date = current_date, template_override = True where active = False and end_date is null and template is not null;
update account_account set end_date = current_date where active = False and end_date is null;
update account_tax set end_date = current_date, template_override = True where active = False and end_date is null and template is not null;
update account_tax set end_date = current_date, template_override = True where active = False and end_date is null;
2019-09-18 12:20:25 +02:00
- comment: #disable old taxes not contempled.
version: 5.0
query: update account_tax set active=false, end_date=now()::date where name like '%IRPF%+%IVA%' and active = True
2019-12-31 00:40:35 +01:00
- comment: We need this query before sync_model_data.py otherwise it fails
version: 5.2
query: update ir_model_data set fs_values = REPLACE(fs_values, '["update_unit_price",true]', '["update_unit_price",false]') WHERE fs_values like '%["update_unit_price",true]%';
- comment: We need this query before sync_model_data.py otherwise it fails
version: 5.2
query: update ir_model_data set values = REPLACE(values, '["update_unit_price",true]', '["update_unit_price",false]') WHERE values like '%["update_unit_price",true]%';
- comment: # 347 replace 'none' to None aeat347_operation_key
version: 5.2
tables: aeat_347_report
query: update account_invoice set aeat347_operation_key = null where aeat347_operation_key = 'none';
- comment: # https://hg.tryton.org/modules/sale/rev/5809fe404415
version: 5.4
tables: product_price_list_line
query: UPDATE product_price_list_line set formula = REPLACE(formula, 'product.list_price', 'product.list_price_used') where formula like '%product.list_price%';
- comment: set company that is null
version: 4.4
tables: product_cost_price
query: UPDATE product_cost_price set company = 1 where company is null;
2020-05-10 09:03:27 +02:00
- comment: # Upgrade 5.6
version: 5.6
tables: project_work
query: UPDATE project_work SET status = db_id FROM ir_model_data WHERE module = 'project' AND fs_id = 'work_open_status' AND state = 'opened';
UPDATE project_work SET status = db_id FROM ir_model_data WHERE module = 'project' and fs_id = 'work_done_status' AND state = 'done';
2019-12-31 00:40:35 +01:00
- script: ./upgrades/after/sync_model_data.py
version: 4.8
2019-07-05 15:22:25 +02:00
- script: ./upgrades/after/upgrade_account_chart.py
2019-09-24 09:16:58 +02:00
version: 4.8
2019-07-05 15:22:25 +02:00
- comment: # upgrade configuration models from ir_property
version: 4.8
script: ./upgrades/after/migration_properties.py
2019-07-05 15:22:25 +02:00
- comment: # update taxes
version: 4.4
script: ./upgrades/after/update_taxes.py
2019-07-05 15:22:25 +02:00
- script: ./upgrades/after/convert_domain_rules.py
2019-09-25 14:07:27 +02:00
version: 4.8
2019-07-05 15:22:25 +02:00
# - script: ./upgrades/after/upload_sii.py
# tables: aeat_sii_report_lines
2019-08-14 09:51:18 +02:00
- script: ./upgrades/after/upgrade_account_invoice_discount_global.py
2019-09-25 14:07:27 +02:00
version: 4.8
- comment: Delete unused users
version: 5.0
query: DELETE FROM res_user WHERE login IN ('user_trigger', 'user_cron_purchase_request', 'user_cron_internal_shipment', 'user_cron_production_request', 'user_cron_trigger', 'user_cron_process_purchase', 'user_cron_process_sale', 'user_cron_post_clearing_moves', 'user_send_modules', 'user_send_data', 'user_clean_executions');
- comment: Delete unused users from ir_model_data
version: 5.0
query: DELETE FROM ir_model_data WHERE model='res.user' AND fs_id IN ('user_trigger', 'user_process_purchase', 'user_process_sale', 'user_post_clearing_moves', 'user_cron_trigger', 'user_send_modules', 'user_send_data', 'user_clean_executions');
- comment: # upgrade countries/subdivision and locales
script: ./upgrades/after/upgrade_country.sh
version: 5.2
ignore:
- WARNING trytond.backend.postgresql.table Unable to set column move_line of table analytic_account_line not null !