Merge lp:~sylvain-legal/openupgrade-addons/7.0-fix-account-move-line-name into lp:openupgrade-addons

Proposed by Sylvain LE GAL (GRAP)
Status: Merged
Merged at revision: 8137
Proposed branch: lp:~sylvain-legal/openupgrade-addons/7.0-fix-account-move-line-name
Merge into: lp:openupgrade-addons
Diff against target: 45 lines (+9/-11)
2 files modified
account/migrations/7.0.1.1/post-migration.py (+9/-10)
account/migrations/7.0.1.1/pre-migration.py (+0/-1)
To merge this branch: bzr merge lp:~sylvain-legal/openupgrade-addons/7.0-fix-account-move-line-name
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Approve
Review via email: mp+186696@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for the fix! Looks perfect to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/migrations/7.0.1.1/post-migration.py'
--- account/migrations/7.0.1.1/post-migration.py 2013-09-09 20:56:30 +0000
+++ account/migrations/7.0.1.1/post-migration.py 2013-09-20 00:42:11 +0000
@@ -40,20 +40,19 @@
40 new text field name on the invoice line.40 new text field name on the invoice line.
41 """41 """
42 invoice_line_obj = pool.get('account.invoice.line')42 invoice_line_obj = pool.get('account.invoice.line')
43 note_column = openupgrade.get_legacy_name('note')43
44 cr.execute(44 cr.execute("""
45 """45 SELECT id, {0}, {1}
46 SELECT id, %s, %s
47 FROM account_invoice_line46 FROM account_invoice_line
48 WHERE %s is not NULL47 WHERE {1} is not NULL AND {1} != ''
49 AND %s != ''48 """.format(
50 """ % (openupgrade.get_legacy_name('name'),49 'name',
51 note_column, note_column, note_column))50 openupgrade.get_legacy_name('note')))
52 for (invoice_line_id, name, note) in cr.fetchall():51 for (invoice_line_id, name, note) in cr.fetchall():
53 prefix = (name + '\n') if name else ''52 name = name + '\n' if name else ''
54 invoice_line_obj.write(53 invoice_line_obj.write(
55 cr, SUPERUSER_ID, [invoice_line_id],54 cr, SUPERUSER_ID, [invoice_line_id],
56 {'name': prefix + note})55 {'name': name + note})
5756
58def lock_closing_reconciliations(cr, pool):57def lock_closing_reconciliations(cr, pool):
59 """58 """
6059
=== modified file 'account/migrations/7.0.1.1/pre-migration.py'
--- account/migrations/7.0.1.1/pre-migration.py 2013-09-09 20:56:30 +0000
+++ account/migrations/7.0.1.1/pre-migration.py 2013-09-20 00:42:11 +0000
@@ -30,7 +30,6 @@
30 ],30 ],
31 'account_invoice_line':31 'account_invoice_line':
32 [32 [
33 ('name', None),
34 ('note', None),33 ('note', None),
35 ],34 ],
36 'account_cashbox_line':35 'account_cashbox_line':

Subscribers

People subscribed via source and target branches