Somesh Khare(OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/6.0-opw-383697-skh into
lp:openobject-server/6.0.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-383697-skh/+merge/95335
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.
--
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-383697-skh/+merge/95335
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/6.0-opw-383697-skh.
=== modified file 'bin/addons/base/ir/ir_sequence.py'
--- bin/addons/base/ir/ir_sequence.py 2011-07-04 07:00:20 +0000
+++ bin/addons/base/ir/ir_sequence.py 2012-03-01 11:21:17 +0000
@@ -75,7 +75,8 @@
def get_id(self, cr, uid, sequence_id, test='id', context=None):
assert test in ('code','id')
- company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
+ user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
+ company_ids = [user_company]
cr.execute('''SELECT id, number_next, prefix, suffix, padding
FROM ir_sequence
WHERE %s=%%s
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp