This commit is contained in:
?ngel ?lvarez 2017-04-19 09:54:53 +02:00
parent a9a5daa223
commit 35ffe087cf
4 changed files with 19 additions and 22 deletions

View File

@ -116,7 +116,6 @@ with Transaction().start(dbname, 0, context=context) as transaction:
wp = work_project[project.name]
childs = {}
for sale in wp.sales:
sale.work = project
# Update parent_project Sale
cursor.execute(*table_sale.update(columns=
[table_sale.parent_project],
@ -146,7 +145,7 @@ with Transaction().start(dbname, 0, context=context) as transaction:
p2.parent = project
to_create.append(p2)
logger.info('Writing projects %s' % len(to_create))
logger.info('Writing projects (sales) %s' % len(to_create))
offset = 1000
i = 0
while i < len(to_create):

View File

@ -70,6 +70,7 @@ with Transaction().start(dbname, 0, context=context) as transaction:
code = (work_projects and work_projects[0] != None and
work_projects[0].code or None)
project = projects.get(code, None)
print "code:", code
if not project:
print "*"*10, "CHECK", "*"*10
print "group:", group.code, "projects:", work_projects, code

View File

@ -31,6 +31,10 @@ to_uninstall:
before:
# - tables: ir_model_data
# version: 3.2
# query: ALTER TABLE ir_model_data ADD COLUMN fs_values TEXT;
- 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';
@ -41,10 +45,6 @@ before:
- DELETE FROM ir_model_data WHERE model='stock.location' AND fs_id LIKE '%transit%'
- comment: -> 4.0
query: ALTER TABLE res_user_login_attempt ALTER COLUMN login TYPE VARCHAR(512);
- tables:
- query: ALTER TABLE ir_model_data ADD COLUMN fs_values TEXT;
- version: 3.2
- tables: stock_location
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);
- comment: # Rename table name - 3.6 migration
@ -105,7 +105,7 @@ after:
- tables: account_move_reconciliation
query: ALTER TABLE account_move_reconciliation ALTER COLUMN date SET NOT NULL;
- tables: contract
query: UPDATE contract SET first_invoice_date=start_period_date WHERE first_invoice_date IS NULL AND state = 'cancelled';
query: UPDATE contract SET first_invoice_date=start_period_date WHERE first_invoice_date IS NULL;
- tables: asset
query: ALTER TABLE asset ALTER COLUMN company SET NOT NULL;
- tables: timesheet_line
@ -116,27 +116,25 @@ after:
query: ALTER TABLE contract ALTER COLUMN first_invoice_date SET NOT NULL;
- tables: asset
query: UPDATE asset SET company = 1 WHERE company IS NULL;
- script: ./upgrades/after/convert_domain_rules.py
- tables: work_project
script: ./upgrades/after/migration_project_product.py
- tables: project_work
script: ./upgrades/after/purchase_work.py
- tables: shipment_work
script: ./upgrades/after/migration_shipment_work.py
- tables: account_invoice_milestone
script: ./upgrades/after/milestone_migration.py
- comment: Drop category column
fields: product_template.category
query: ALTER TABLE product_template DROP COLUMN category;
- tables: country_zip
version: 4.0
query: update country_zip set country = (select id from country_country where code = 'ES') where country_zip is null;
# - version: 4.0
# query: update ir_action_act_window set domain = '[["parent", "=", null]]', context = "{'babi_tree_view': true}" where context like '%babi%';
# - comment: # change code to number electronic mail template
version: 4.0
- tables: electronic_mail_template
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
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,%';
#- script: ./upgrades/after/convert_domain_rules.py
#- tables: work_project
# script: ./upgrades/after/migration_project_product.py
# - tables: project_work
# script: ./upgrades/after/purchase_work.py
# - tables: shipment_work
# script: ./upgrades/after/migration_shipment_work.py
# - tables: account_invoice_milestone
# script: ./upgrades/after/milestone_migration.py

View File

@ -28,7 +28,7 @@ def run(*args):
print 'RUNING:', ' '.join(args)
summary = set()
process = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, bufsize=1)
stderr=subprocess.PIPE, bufsize=1, shell=False)
out, err = process.communicate()
@ -52,6 +52,7 @@ def run(*args):
print line
process.stdout.close()
process.stderr.close()
process.wait()
if summary:
@ -138,8 +139,6 @@ def process_actions(actions):
if version <= trytond_version and version > from_version:
continue
if not script:
continue
# Check tables
found = True