Merge lp:~openerp-dev/openobject-server/6.0-opw-383697-skh into lp:openobject-server/6.0

Proposed by Somesh Khare
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 3597
Proposed branch: lp:~openerp-dev/openobject-server/6.0-opw-383697-skh
Merge into: lp:openobject-server/6.0
Diff against target: 13 lines (+2/-1)
1 file modified
bin/addons/base/ir/ir_sequence.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.0-opw-383697-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+95335@code.launchpad.net

Description of the change

Hello,

[Fix]: When we change the company for the user in multi-company environment, the sequence should also change.

Scenario: If we have 3 companies company1, copmpany2 and company3 and assigned the companies to each users (eg: admin : company1, user1: company2, user2: company3), and we have configured separate sequence for 'Purchase Order' to each company. Now change the company of the admin user from company 1 to company2 and see that It still shows the sequence of the previous company when creating the new Purchase order.

This branch fixes this issue. Kindly review this branch and please share your view on it.

Thanks.

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

I would like to have a double check on this for any functional regression. to me it seems ok.
Xavier(xal) can you please review this ?

Thanks,

review: Approve

Unmerged revisions

3597. By Somesh Khare

[FIX] ir.sequence: When change company for the users sequence should also change (Ref: Case 383697)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/base/ir/ir_sequence.py'
2--- bin/addons/base/ir/ir_sequence.py 2011-07-04 07:00:20 +0000
3+++ bin/addons/base/ir/ir_sequence.py 2012-03-01 11:21:17 +0000
4@@ -75,7 +75,8 @@
5
6 def get_id(self, cr, uid, sequence_id, test='id', context=None):
7 assert test in ('code','id')
8- company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
9+ user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
10+ company_ids = [user_company]
11 cr.execute('''SELECT id, number_next, prefix, suffix, padding
12 FROM ir_sequence
13 WHERE %s=%%s