Merge lp:~therp-nl/account-invoicing/7.0-lp1294623-invoic_id_on_analytic_line into lp:~account-core-editors/account-invoicing/7.0

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 45
Proposed branch: lp:~therp-nl/account-invoicing/7.0-lp1294623-invoic_id_on_analytic_line
Merge into: lp:~account-core-editors/account-invoicing/7.0
Diff against target: 21 lines (+9/-3)
1 file modified
account_invoice_merge/invoice.py (+9/-3)
To merge this branch: bzr merge lp:~therp-nl/account-invoicing/7.0-lp1294623-invoic_id_on_analytic_line
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Approve
Holger Brunn (Therp) code review Approve
Lara (Therp) (community) test Approve
Review via email: mp+211708@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lara (Therp) (lfreeke) :
review: Approve (test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_invoice_merge/invoice.py'
2--- account_invoice_merge/invoice.py 2014-02-07 23:16:16 +0000
3+++ account_invoice_merge/invoice.py 2014-03-19 12:18:32 +0000
4@@ -184,9 +184,15 @@
5
6 # recreate link (if any) between original analytic account line (invoice time sheet for example) and this new invoice
7 anal_line_obj = self.pool.get('account.analytic.line')
8- for new_invoice_id in invoices_info:
9- todo_ids = anal_line_obj.search(cr, uid, [('invoice_id', 'in', invoices_info[new_invoice_id])], context=context)
10- anal_line_obj.write(cr, uid, todo_ids, {'invoice_id': new_invoice_id}, context=context)
11+ if 'invoice_id' in anal_line_obj._columns:
12+ for new_invoice_id in invoices_info:
13+ todo_ids = anal_line_obj.search(
14+ cr, uid,
15+ [('invoice_id', 'in', invoices_info[new_invoice_id])],
16+ context=context)
17+ anal_line_obj.write(
18+ cr, uid, todo_ids, {'invoice_id': new_invoice_id},
19+ context=context)
20
21 return invoices_info
22

Subscribers

People subscribed via source and target branches