Merge lp:~openerp-dev/openobject-addons/trunk-bug-726092-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Merged
Merged at revision: 4659
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-726092-ara
Merge into: lp:openobject-addons
Diff against target: 33 lines (+7/-3)
1 file modified
account/account_cash_statement.py (+7/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-726092-ara
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
OpenERP buildbot (community) Disapprove
Review via email: mp+53813@code.launchpad.net

Description of the change

Hello,

Fix: #726092 [6-stab] journal sequence not respected

Thanks,
ara

To post a comment you must log in.
Revision history for this message
OpenERP buildbot (openerp-buildbot) wrote :

product/test/product_report.yml: 'int' object is unsubscriptable
account/test/account_fiscalyear_close_state.yml: 'int' object is unsubscriptable
project/test/test_project_delegation.yml: 'int' object is unsubscriptable
project_long_term/test/test_schedule_phases_case1.yml: 'int' object is unsubscriptable
account_invoice_layout/test/account_invoice_layout_report.yml: 'int' object is unsubscriptable

review: Disapprove
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_cash_statement.py'
2--- account/account_cash_statement.py 2011-03-03 08:52:22 +0000
3+++ account/account_cash_statement.py 2011-03-17 13:36:38 +0000
4@@ -320,6 +320,7 @@
5 """ Changes statement state to Running.
6 @return: True
7 """
8+ obj_seq = self.pool.get('ir.sequence')
9 if context is None:
10 context = {}
11 statement_pool = self.pool.get('account.bank.statement')
12@@ -329,15 +330,18 @@
13 raise osv.except_osv(_('Error !'), (_('User %s does not have rights to access %s journal !') % (statement.user_id.name, statement.journal_id.name)))
14
15 if statement.name and statement.name == '/':
16- number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement')
17+ if statement.journal_id.sequence_id:
18+ c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id}
19+ st_number = obj_seq.get_id(cr, uid, statement.journal_id.sequence_id.id, context=c)
20+ else:
21+ st_number = obj_seq.get(cr, uid, 'account.cash.statement')
22 vals.update({
23- 'name': number
24+ 'name': st_number
25 })
26
27 vals.update({
28 'date': time.strftime("%Y-%m-%d %H:%M:%S"),
29 'state': 'open',
30-
31 })
32 self.write(cr, uid, [statement.id], vals, context=context)
33 return True

Subscribers

People subscribed via source and target branches

to all changes: