diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py
index afd96f59b08..111702c2e74 100644
--- a/addons/point_of_sale/__openerp__.py
+++ b/addons/point_of_sale/__openerp__.py
@@ -62,8 +62,9 @@ Main features :
'wizard/pos_payment_report.xml',
'wizard/pos_payment.xml',
'wizard/pos_scan_product_view.xml',
+ 'wizard/pos_return_view.xml',
'pos_report.xml',
- 'pos_wizard.xml',
+ # 'pos_wizard.xml',
'pos_view.xml',
'pos_sequence.xml',
'posrule_data.xml',
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index b72848e2131..e9829addbda 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -64,8 +64,8 @@
-
+
diff --git a/addons/point_of_sale/pos_wizard.xml b/addons/point_of_sale/pos_wizard.xml
index 805739168f0..4a321d7787f 100644
--- a/addons/point_of_sale/pos_wizard.xml
+++ b/addons/point_of_sale/pos_wizard.xml
@@ -1,11 +1,3 @@
-
-
-
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index cdfd3f9fb20..d8a4b93e3a2 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -19,7 +19,7 @@
# along with this program. If not, see .
#
##############################################################################
-import wizard_return
+
import pos_add_product
import pos_confirm
import pos_discount
@@ -39,6 +39,7 @@ import pos_payment_report_date
import pos_payment_report
import pos_payment
import pos_scan_product
+import pos_return
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py
index 34769be78e9..b977f901eec 100644
--- a/addons/point_of_sale/wizard/pos_add_product.py
+++ b/addons/point_of_sale/wizard/pos_add_product.py
@@ -61,7 +61,27 @@ class add_product(osv.osv_memory):
'views': False,
'type': 'ir.actions.act_window',
}
+ def close_action(self, cr, uid, ids, context):
+ record_id = context and context.get('record_id', False)
+ order_obj= self.pool.get('pos.order')
+ order_line_obj= self.pool.get('pos.order.line')
+ obj=order_obj.browse(cr,uid, record_id)
+ order_obj.write(cr,uid,[record_id],{'state':'done'})
+ if obj.amount_total != obj.amount_paid:
+ return {
+ 'name': _('Make Payment'),
+ 'context ':context and context.get('record_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 {}
add_product()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_add_product.xml b/addons/point_of_sale/wizard/pos_add_product.xml
index 5d380624f0d..f465f97f097 100644
--- a/addons/point_of_sale/wizard/pos_add_product.xml
+++ b/addons/point_of_sale/wizard/pos_add_product.xml
@@ -12,8 +12,8 @@
-
+
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
index 8e25f3f0797..3c608e452fa 100644
--- a/addons/point_of_sale/wizard/pos_payment.py
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -43,7 +43,7 @@ class pos_make_payment(osv.osv_memory):
@return: A dictionary which of fields with values.
"""
res = super(pos_make_payment, self).default_get(cr, uid, fields, context=context)
- record_id = context and context.get('active_id',False)
+ record_id = context and context.get('record_id',False)
j_obj = self.pool.get('account.journal')
company_id = self.pool.get('res.users').browse(cr,uid,uid).company_id.id
journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
@@ -81,7 +81,7 @@ class pos_make_payment(osv.osv_memory):
def view_init(self, cr, uid, fields_list, context=None):
res = super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
+ record_id = context and context.get('record_id', False) or False
order = self.pool.get('pos.order').browse(cr, uid, record_id)
if not order.lines:
raise osv.except_osv('Error!','No order lines defined for this sale ')
@@ -103,8 +103,7 @@ class pos_make_payment(osv.osv_memory):
res = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
if record_id:
order = self.pool.get('pos.order').browse(cr, uid, record_id)
- amount = order.amount_total - order.amount_paid
- if amount==0.0:
+ if order.amount_total == order.amount_paid:
res['arch'] = """