Merge lp:~openerp-dev/openobject-addons/6.0-opw-580868-xal into lp:openobject-addons/6.0

Proposed by Xavier ALT
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-580868-xal
Merge into: lp:openobject-addons/6.0
Diff against target: 15 lines (+4/-1)
1 file modified
account/account_move_line.py (+4/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-580868-xal
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+137772@code.launchpad.net

Description of the change

Hi,

This fix a server-side store warning when creating line from journal entry.

Steps:
1/ Create a journal entry with 3 lines. For an example:
account debit credit
512000 0 300
601700 200 0
601800 100 0

2/ Validate it
3/ Create a new journal entry with 3 lines as:
account debit credit
512000 0 200
603100 100 0
601800 50 0

4/ Click on "new" button => server raise an error

Regards,
Xavier

To post a comment you must log in.

Unmerged revisions

5366. By Xavier ALT

[FIX] account: make sure account.move.line _balance() method return a value for all requested ids, even those on account wo/ existing moves

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2012-03-06 12:36:12 +0000
3+++ account/account_move_line.py 2012-12-04 08:56:23 +0000
4@@ -375,7 +375,10 @@
5 " GROUP BY l2.id"
6
7 cr.execute(sql, [tuple(ids)])
8- return dict(cr.fetchall())
9+ result = dict(cr.fetchall())
10+ for id in ids:
11+ result.setdefault(id, 0.0)
12+ return result
13
14 def _invoice(self, cursor, user, ids, name, arg, context=None):
15 invoice_obj = self.pool.get('account.invoice')