Merge lp:~openerp-dev/openobject-addons/7.0-opw-589810-rgo into lp:openobject-addons/7.0

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: no longer in the source branch.
Merge reported by: Martin Trigaux (OpenERP)
Merged at revision: not available
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-589810-rgo
Merge into: lp:openobject-addons/7.0
Diff against target: 18 lines (+6/-1)
1 file modified
point_of_sale/point_of_sale.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-589810-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+155987@code.launchpad.net

Description of the change

Hi,

[FIX] point_of_sale: Return products from POS previous session should be linked to current opened session, if not found an active session then raise a warning message. (Maintenance Case: 589810)

For better understanding of this issue, please refer to the issue description of lp:1123575

I've fixed this issue by linking current opened session to the return product order and if there isn't any open session found then an appropriate warning message will be shown.

Kindly review the fix.

Thanks.

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

Hello,

I have merged this but changed a bit the code.
- Done inside the for loop
- Matching on the user instead of the pos (you may refund on another pos but wants the good salesman)
- Set the date to today

Regards

revno: 9393 [merge]
revision-id: <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'point_of_sale/point_of_sale.py'
--- point_of_sale/point_of_sale.py 2013-03-18 10:53:04 +0000
+++ point_of_sale/point_of_sale.py 2013-03-28 15:02:25 +0000
@@ -772,9 +772,14 @@
772 """Create a copy of order for refund order"""772 """Create a copy of order for refund order"""
773 clone_list = []773 clone_list = []
774 line_obj = self.pool.get('pos.order.line')774 line_obj = self.pool.get('pos.order.line')
775 for order in self.browse(cr, uid, ids, context=context):775 pos_orders = self.browse(cr, uid, ids, context=context)
776 current_session = self.pool.get('pos.session').search(cr, uid, [('config_id', '=', pos_orders[0].session_id.config_id.id), ('state', '!=', 'closed')])
777 if not current_session:
778 raise osv.except_osv(_('Error!'), _('To return product(s), you need to open a session that belongs to the same "Point of Sale" as of the product(s) to be returned.'))
779 for order in pos_orders:
776 clone_id = self.copy(cr, uid, order.id, {780 clone_id = self.copy(cr, uid, order.id, {
777 'name': order.name + ' REFUND',781 'name': order.name + ' REFUND',
782 'session_id': current_session[0]
778 }, context=context)783 }, context=context)
779 clone_list.append(clone_id)784 clone_list.append(clone_id)
780785