PreUpgrade

0. Celery - Instal·lar celery_flower

0. Possar null els vat_number

select id, state from ir_module_module where name in ('party_vat_unique');

update party_party set vat_number = Null where vat_number = '';

select o.id, o.vat_number from party_party o where exists ( select 'x' from party_party i where i.vat_number = o.vat_number and i.id < o.id);
# en el cas de duplicats, desactivem constrain i el default de de party_vat_unique/party.py

0. Rename table name - no canvia el nom de la taula en migration 3.6:

# select name, state from ir_module_module where name = 'account_financial_statement';

# alter table account_financial_statement_report_line_account rename to account_financial_statement_rep_lin_acco;
# alter table account_financial_statement_report_line_account_id_seq rename to account_financial_statement_rep_lin_acco_id_seq;

# select name, state from ir_module_module where name = 'magento_product';


# alter table product_template_magento_attribute_configurable_rel rename to product_tpl_mgn_attribute_configurable;
# alter table product_template_magento_attribute_configurable_rel_id_seq rename to product_tpl_mgn_attribute_configurable_id_seq;

# select name, state from ir_module_module where name = 'product_review';

# alter table product_configuration_product_review_type_rel rename to product_config_product_review_type;
# alter table product_configuration_product_review_type_rel_id_seq rename to product_config_product_review_type_id_seq;

# select name, state from ir_module_module where name = 'stock_shipment_cashondelivery';

# alter table sale_configuration_sale_payment_type_rel rename to sale_configuration_sale_payment_type;
# alter table sale_configuration_sale_payment_type_rel_id_seq rename to sale_configuration_sale_payment_type_id_seq;

1. Eliminar mòduls que ja no calen a la 3.8 i no estan instal·lats.

sudo /home/INST/tryton/bin/python /home/INST/tryton/bin/trytond -c /etc/trytond/.INST.conf -u party_event electronic_mail_event -d INST

select id, state from ir_module_module where name in ('party_event', 'electronic_mail_event');
delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('party_event', 'electronic_mail_event'));
delete from ir_module_module where name in ('party_event', 'electronic_mail_event');

select id, state from ir_module_module where name in ('stock_inventory_qty', 'stock_lot_inventory_qty');
delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('stock_inventory_qty', 'stock_lot_inventory_qty'));
delete from ir_module_module where name in ('stock_inventory_qty', 'stock_lot_inventory_qty');

2. project_helpdesk: si està instal·lat, el desinstal·lem. I a la base de dades, apliquem el SQL Project Helpdesk abans d'actualizar a la 3.8

select id, state from ir_module_module where name in ('project_helpdesk');

delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('project_helpdesk'));
delete from ir_module_module where name in ('project_helpdesk');

3. contract

select * from ir_module_module where name = 'contract';

si està instal·lat, el desinstal·lem. I a la base de dades, apliquem el SQL Contract abans d'actualizar a la 3.8

4. project_timesheet: si està instal·lat, eliminem els XML pq amb l'actualizació recrei de nou el XML

select id, state from ir_module_module where name in ('project_timesheet');

5. Eliminem dependecies que ja no s'usen:

delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('pyme')) and name = 'account_invoice_consecutive';

6. Sale POS? cal instal·lar sale_wtax

# nantic
select id, state from ir_module_module where name in ('account_bank_statement_user', 'account_budget', 'account_invoice_information_uom', 'account_invoice_order_number', 'account_invoice_milestone', 'asterisk', 'asset', 'asset_attribute', 'asset_guarantee', 'asset_invoice', 'asset_maintenance', 'asset_manufacturer', 'asset_owner', 'asset_relationship', 'asset_vehicle', 'asset_work_shipment', 'carrier_file', 'commission_partial_payment', 'file_format', 'party_asterisk', 'product_cost_plan', 'product_cost_plan_margin', 'product_kit_cost', 'production_editable_tree', 'production_origin', 'production_split', 'production_supply_request', 'purchase_contract', 'purchase_lot_cost', 'purchase_information_uom', 'shipment_work', 'stock_scanner', 'stock_scanner_lot', 'stock_lot_supplier_ref', 'stock_lot_sequence', 'stock_lot_cost', 'stock_lot_manufacturer', 'stock_supply_request', 'stock_split_lot_expiry', 'timetracker', 'work_project', 'analytic_product');

delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('account_bank_statement_user', 'account_budget', 'account_invoice_information_uom', 'account_invoice_order_number', 'account_invoice_milestone',  'asterisk', 'asset', 'asset_attribute', 'asset_guarantee', 'asset_invoice', 'asset_maintenance', 'asset_manufacturer', 'asset_owner', 'asset_relationship', 'asset_vehicle', 'asset_work_shipment', 'carrier_file', 'commission_partial_payment', 'file_format', 'party_asterisk', 'product_cost_plan', 'product_cost_plan_margin', 'product_kit_cost', 'production_editable_tree', 'production_origin', 'production_split', 'production_supply_request', 'purchase_contract', 'purchase_lot_cost', 'purchase_information_uom', 'shipment_work', 'stock_scanner', 'stock_scanner_lot', 'stock_lot_supplier_ref', 'stock_lot_sequence', 'stock_lot_cost', 'stock_lot_manufacturer', 'stock_supply_request', 'stock_split_lot_expiry', 'timetracker', 'work_project', 'analytic_product'));

delete from ir_module_module where name in ('account_bank_statement_user', 'account_budget', 'account_invoice_information_uom', 'account_invoice_order_number', 'account_invoice_milestone', 'asterisk', 'asset', 'asset_attribute', 'asset_guarantee', 'asset_invoice', 'asset_maintenance', 'asset_manufacturer', 'asset_owner', 'asset_relationship', 'asset_vehicle', 'asset_work_shipment', 'carrier_file', 'commission_partial_payment', 'file_format', 'party_asterisk', 'product_cost_plan',  'product_cost_plan_margin', 'product_kit_cost', 'production_editable_tree', 'production_origin', 'production_split', 'production_supply_request', 'purchase_contract', 'purchase_lot_cost', 'purchase_information_uom', 'shipment_work', 'stock_scanner', 'stock_scanner_lot', 'stock_lot_supplier_ref', 'stock_lot_sequence', 'stock_lot_cost', 'stock_lot_manufacturer', 'stock_supply_request', 'stock_split_lot_expiry', 'timetracker', 'work_project', 'analytic_product');

# trytonspain
select id, state from ir_module_module where name in ('account_payment_forecast', 'account_payment_type_move', 'account_reconcile', 'account_es_ca');

delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('account_payment_forecast', 'account_payment_type_move', 'account_reconcile', 'account_es_ca'));

delete from ir_module_module where name in ('account_payment_forecast', 'account_payment_type_move', 'account_reconcile', 'account_es_ca');

select id, state from ir_module_module where name in ('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', 'account_payment_es_csb_58');

delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('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', 'account_payment_es_csb_58'));

delete from ir_module_module where name in ('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', 'account_payment_es_csb_58');

# zz
select id, state from ir_module_module where name in ('stock_warehouse_user');

delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('stock_warehouse_user'));

delete from ir_module_module where name in ('stock_warehouse_user');

# altres
select id, state from ir_module_module where name in ('party_mercantil', 'sale_data_shop', 'product_name', 'contract_invoice', 'contract_formula', 'account_dunning_mail', 'aeat_303_es', 'aeat_340_es', 'aeat_347_es', 'aeat_349_es', 'account_invoice_buttons', 'sale_pos_esc', 'sale_shipment_cost_prices', 'product_esale_purchasable', 'product_esale_manufacturer', 'sale_buttons');
delete from ir_module_module_dependency where module in (select id from ir_module_module where name in ('party_mercantil', 'sale_data_shop', 'product_name', 'contract_invoice', 'contract_formula', 'account_dunning_mail', 'aeat_303_es', 'aeat_340_es', 'aeat_347_es', 'aeat_349_es', 'account_invoice_buttons', 'sale_pos_esc', 'sale_shipment_cost_prices', 'product_esale_purchasable', 'product_esale_manufacturer', 'sale_buttons'));
delete from ir_module_module where name in ('party_mercantil', 'sale_data_shop', 'product_name', 'contract_invoice', 'contract_formula', 'account_dunning_mail', 'aeat_303_es', 'aeat_340_es', 'aeat_347_es', 'aeat_349_es', 'account_invoice_buttons', 'sale_pos_esc', 'sale_shipment_cost_prices', 'product_esale_purchasable', 'product_esale_manufacturer', 'sale_buttons');

alter table activity_activity alter column employee drop not null;

alter table electronic_mail_template RENAME COLUMN party TO activity;

2- Treure el CONSTRAIN de party_party vat_number, vat_country

alter table party_party DROP CONSTRAINT party_party_vat_uniq;

3. Eliminar traduccions account_es_pyme:

delete from ir_translation where module = 'account_es_pyme';


select name, res_id, src, value from ir_translation where name like 'account.account,name' and module is null and res_id in (select id from account_account where code not like '%000' and length(code) > 6) and src != value and lang = 'es_ES';

select a.code, t.res_id, t.src, t.value from ir_translation t, account_account a where t.name like 'account.account,name' and module is null and res_id=a.id and code not like '%000' and length(code) >= 6 and lang = 'ca_ES' and src != value and a.name != value;

# no fer-ho!! 

UPDATE account_account SET name=s.value FROM (select id, name, res_id, src, value from ir_translation where name like 'account.account,name' and module is null and res_id in (select id from account_account where code not like '%000' and length(code) >= 6) and lang = 'ca_ES' and src != value and fuzzy='f') s WHERE id=s.res_id;

delete from ir_translation where name like 'account.account,name' and module is null;

4. Canviar dígits a la secció product:

DIGITS = config_.getint('product', 'price_decimal', default=4)
DISCOUNT_DIGITS = config_.getint('product', 'discount_decimal', default=4)

5. Idiomes definits manualment i nous idiomes a Tryton (it_IT). Problemes al update?

6. Instal·lar mòduls:

./trytond/bin/trytond -v -c trytond.conf -u party_identifier activity --all -d NOMDB

7. Recorda! SQL Project Helpdesk abans d'actualizar a la 3.8

PostUpgrade

'' if self.type == 'service' else (str(self.width)+str(self.width_uom.symbol) if self.width and self.width_uom else '') + ' x ' + (str(self.height)+str(self.height_uom.symbol) if self.height and self.height_uom else '') + ' x ' + (str(self.length)+str(self.length_uom.symbol) if self.length and self.length_uom else '') if self.shape == 'parallelepiped' else '∅' + (str(self.diameter)+str(self.diameter_uom.symbol) if self.diameter and self.diameter_uom else '') + ' x ' + (str(self.length)+str(self.length_uom.symbol) if self.length and self.length_uom else '') if self.shape == 'cylinder' else ''

# select id, domain, context from ir_action_act_window where context like '%babi%';

# update ir_action_act_window set domain = '[["parent", "=", null]]', context = '{"babi_tree_view": true}' where context like '%babi%';

# select id, domain, context from ir_action_act_window where domain like '%mailbox%';

update ir_action_act_window set domain = '[["mailbox", "=", 1]]' where id = 223; # Canviar domini i ID

esale_attribute_group - Importar

result = pool.get('esale.attribute.group')(1) #ID default attribute

select * from product_price_list_line where formula like 'product.special_price>0 and product.special_price or product.list_price%';
select substring(formula, 72) from product_price_list_line where formula like 'product.special_price>0 and product.special_price or product.list_price%';

update product_price_list_line set formula = '(product.special_price if product.special_price >0 else product.list_price)' || substring(formula, 72) where formula like 'product.special_price>0 and product.special_price or product.list_price%';

Actualització 3.8.x

1. Actualitzar retrofix 2. Actualitzar python-sql

Per aplicar una actualització 3.8.x:

1. Eliminar taula party_event pq es pugin eliminar tercers:

drop table party_event;

2. Millores en els plans comptables (account_es i account_es_pyme). Abans d'actualitzar el mòdul és important executar això:

update account_account_template set reconcile=false where reconcile = true and kind='view';
update account_account_template set reconcile=false where reconcile = true and name like '%\%';

i desprès actualitzar el pla comptable.

3. Mirar si hi han account.move.line orfes i eliminar-los:

select * from account_move_line where move is null;

4. trytond.convert not updated (id: menu_print_general_ledger) / not updated (id: menu_print_general_journal)

update ir_model_data set values = fs_values where id = 6610;

Si refresquem el punt anterior, els values haurà canviat.

* Finalment anem a Admin/User Interface/Menu. Busquem els IDs menús i a anglès deixem:

Print General Ledger
Print Journal 

Noves funcionalitats

Nous mòduls

TO FIX

TO UPGRADE 3.9

A revisar

Migració 3.6 a 3.8

-       <property name="TRYTON_RELATIONS" value="[&apos;lines&apos;]"/>
+       <property name="TRYTON_RELATIONS" value="lines"/>

Migracio3.6-3.8 (last edited 2016-03-16 12:04:29 by resteve)

Contenidos creados por el equipo de Zikzakmedia. Creative Commons By-NC-SA

PythonZikzakmedia