Merge lp:~openerp-dev/openobject-server/6.0-opw-10420-ira into lp:openobject-server/6.0
Proposed by
Ila Rana(Open ERP)
Status: | Merged |
---|---|
Approved by: | Jay Vora (Serpent Consulting Services) |
Approved revision: | 3457 |
Merged at revision: | 3460 |
Proposed branch: | lp:~openerp-dev/openobject-server/6.0-opw-10420-ira |
Merge into: | lp:openobject-server/6.0 |
Diff against target: |
22 lines (+3/-3) 1 file modified
bin/addons/base/ir/ir_sequence.py (+3/-3) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-server/6.0-opw-10420-ira |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Leonardo Pistone (community) | Needs Fixing | ||
Ila Rana(Open ERP) (community) | Needs Resubmitting | ||
Olivier Dony (Odoo) | Needs Information | ||
Review via email: mp+66546@code.launchpad.net |
Description of the change
Using point_of_sale module we can't open cash register if journal user belonging to parent company and journal sequence have child company. so to access child_company journal I have made changes in ir_sequance.py file. So if user have parent company and journal sequence belonging to child company he can easily access.
To post a comment you must log in.
Hi,
I understand that it makes sense to allow a user to increment sequences in other companies if he is currently allowed to "see" these other companies.
Indeed, the typical case is when the user is in the parent company, and wants to use a sequence from a child company.
However, the rule to know what companies a user is currently allowed to see is not hardcoded, it is not "current or children", it is defined by the ir.rules on the Company object.
Therefore, don't you think a better way to determine the list of allowed companies is to do a normal res_company. search( []) as the current user? company_ ids = self.pool. get('res. company' ).search( cr, uid, [], context=context)
i.e. simplify the code with just:
visible_
and pass "tuple( visible_ company_ ids)" to the SQL query.
What do you think?
Thanks!