diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 4d277d216c8..1cf7ab1de69 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -48,8 +48,9 @@
-
+
+
diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py
index 601c3d3f305..a44ab52f1c9 100644
--- a/addons/point_of_sale/wizard/pos_add_product.py
+++ b/addons/point_of_sale/wizard/pos_add_product.py
@@ -76,21 +76,22 @@ class add_product(osv.osv_memory):
context = {}
record_id = context and context.get('active_id', False)
order_obj= self.pool.get('pos.order')
+ this = self.browse(cr, uid, ids[0], context)
+ order_obj.add_product(cr, uid, record_id, this.product_id.id, this.quantity, context=context)
+
obj = order_obj.browse(cr, uid, record_id, context=context)
order_obj.write(cr, uid, [record_id], {'state': 'done'}, context=context)
- if obj.amount_total != obj.amount_paid:
- return {
- 'name': _('Make Payment'),
- 'context': context and context.get('active_id', False),
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'pos.make.payment',
- 'view_id': False,
- 'target': 'new',
- 'views': False,
- 'type': 'ir.actions.act_window',
- }
- return {}
+ return {
+ 'name': _('Make Payment'),
+ 'context': context and context.get('active_id', False),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'pos.make.payment',
+ 'view_id': False,
+ 'target': 'new',
+ 'views': False,
+ 'type': 'ir.actions.act_window',
+ }
add_product()
diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py
index abeadfc9931..c0e37d84ef3 100644
--- a/addons/point_of_sale/wizard/pos_return.py
+++ b/addons/point_of_sale/wizard/pos_return.py
@@ -340,8 +340,11 @@ class add_product(osv.osv_memory):
date_cur=time.strftime('%Y-%m-%d %H:%M:%S')
uom_obj = self.pool.get('product.uom')
return_boj=self.pool.get('pos.return')
- return_id=return_boj.search(cr,uid,[])
- data=return_boj.read(cr,uid,return_id,[])[0]
+ return_id = return_boj.search(cr,uid,[])
+ data = {}
+ if return_id:
+ data = return_boj.read(cr,uid,return_id,[])[0]
+
wf_service = netsvc.LocalService("workflow")
self_data = self.read(cr, uid, ids)[0]
order_obj.add_product(cr, uid, active_ids[0], self_data['product_id'], self_data['quantity'], context=context)