Skip to content

Commit

Permalink
Merge pull request OCA#1 from OCA/8.0
Browse files Browse the repository at this point in the history
Updating 8.0
  • Loading branch information
zamberjo authored Mar 1, 2018
2 parents 5de596b + 3ea086e commit 833b7e3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions addons/account/migrations/8.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@
]


def pre_compute_reconcile_ref_field(cr):
"""Create and compute values for new functional field reconcile_ref.
Bypass the ORM auto creation and computation because it can take
a long time and consume a lot of memory for large account_move_line.
"""
cr.execute("""
alter table account_move_line
add column reconcile_ref character varying;
""")
cr.execute("""
update account_move_line ml
set reconcile_ref = r.name
from account_move_reconcile r
where ml.reconcile_partial_id = r.id;
""")
cr.execute("""
update account_move_line ml
set reconcile_ref = r.name
from account_move_reconcile r
where ml.reconcile_id = r.id;
""")


@openupgrade.migrate()
def migrate(cr, version):
if not version:
Expand All @@ -35,6 +59,7 @@ def migrate(cr, version):
cr, 'account', 'exp', 'account.analytic.journal', res[0], True)
openupgrade.rename_columns(cr, column_renames)
openupgrade.rename_tables(cr, tables_renames)
pre_compute_reconcile_ref_field(cr)
# drop views that inhibit changing field types. They will be recreated
# anyways
for view in [
Expand Down
2 changes: 1 addition & 1 deletion openerp/addons/base/migrations/8.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def cleanup_modules(cr):
# from OCA/product-attribute
('product_customer_code', 'product_supplierinfo_for_customer'),
# from OCA/sale-workflow - included in core
('sale_multi_picking', 'sale_sourced_by_line'),
('sale_multi_picking', 'sale_procurement_group_by_line'),
# from OCA/stock-logistics-workflow
('stock_cancel', 'stock_picking_back2draft'),
], merge_modules=True,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mock==1.0.1
passlib==1.6.2
psutil==2.1.1
psycogreen==1.0
psycopg2==2.5.3
psycopg2==2.7.3.1
pyPdf==1.13
pydot==1.0.2
pyparsing==1.5.7
Expand Down

0 comments on commit 833b7e3

Please sign in to comment.