Merge lp:~openerp-dev/openobject-addons/7.0-bug-1098226-bth into lp:openobject-addons/7.0

Proposed by Bhumi Thakkar (Open ERP)
Status: Merged
Merged at revision: 9255
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-bug-1098226-bth
Merge into: lp:openobject-addons/7.0
Diff against target: 24 lines (+2/-1)
2 files modified
point_of_sale/point_of_sale.py (+1/-1)
point_of_sale/wizard/pos_session_opening.py (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-bug-1098226-bth
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+143671@code.launchpad.net

Description of the change

Hello,

       Fixed: config_id problem with pos session

To Reproduce:
1. Create 1 user and give access rights as a user in pos.
2. Login as a new created user and click on pos menu.
3. If any other user have not closed his/her session then logged user get 2 buttons [start selling and close session] else get 1 button of New Session.
4. Click on button Start Selling.

Observed: Error of could not read property 'config_id'.
Expected: User can use not used session. could start selling or closed on another user's session (must not use another users' session). As we have to create session for each user.

Thanks.

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

Hello,

Thanks for the patch.
I don't believe you need to change the error message, it's explicit enough (moreover it is grammatically correct).
The change in pos_session_opening.py is correct on the other hand.
Merged into addons 7.0 at revision 9255

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/point_of_sale.py'
2--- point_of_sale/point_of_sale.py 2012-12-06 14:56:32 +0000
3+++ point_of_sale/point_of_sale.py 2013-01-17 12:08:40 +0000
4@@ -290,7 +290,7 @@
5
6 _constraints = [
7 (_check_unicity, "You cannot create two active sessions with the same responsible!", ['user_id', 'state']),
8- (_check_pos_config, "You cannot create two active sessions related to the same point of sale!", ['config_id']),
9+ (_check_pos_config, "You cannot create two active sessions related to the same point of sale! Use not used point of sale", ['config_id']),
10 ]
11
12 def create(self, cr, uid, values, context=None):
13
14=== modified file 'point_of_sale/wizard/pos_session_opening.py'
15--- point_of_sale/wizard/pos_session_opening.py 2012-12-06 14:56:32 +0000
16+++ point_of_sale/wizard/pos_session_opening.py 2013-01-17 12:08:40 +0000
17@@ -88,6 +88,7 @@
18 session_ids = proxy.search(cr, uid, [
19 ('state', '!=', 'closed'),
20 ('config_id', '=', config_id),
21+ ('user_id', '=', uid),
22 ], context=context)
23 if session_ids:
24 session = proxy.browse(cr, uid, session_ids[0], context=context)