diff --git a/addons/point_of_sale/__terp__.py b/addons/point_of_sale/__terp__.py
index 153584f6a26..95228bb044c 100644
--- a/addons/point_of_sale/__terp__.py
+++ b/addons/point_of_sale/__terp__.py
@@ -62,6 +62,7 @@ Main features :
'wizard/pos_payment_report_user.xml',
'wizard/pos_payment_report.xml',
'wizard/pos_payment.xml',
+ 'wizard/pos_scan_product_view.xml',
'pos_report.xml',
'pos_wizard.xml',
'pos_view.xml',
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index f5ce8368bbe..312c9f4726b 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -68,7 +68,7 @@
-->
-
+
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index 82d9ea9409a..67729a6a895 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -21,7 +21,7 @@
##############################################################################
#import wizard_pos_payment
-import wizard_default_journal
+
import wizard_scan_product
import wizard_return
@@ -50,6 +50,7 @@ import pos_payment_report_user
import pos_payment_report_date
import pos_payment_report
import pos_payment
+import pos_scan_product
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_scan_product.py b/addons/point_of_sale/wizard/pos_scan_product.py
new file mode 100644
index 00000000000..5998f50b0f7
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_scan_product.py
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
+
+
+
+class pos_scan_product(osv.osv_memory):
+ _name = 'pos.scan.product'
+ _description = 'Scan product'
+ _columns = {
+ 'gencod': fields.char('Barcode',size=13,required= True)
+ }
+ def scan(self, cr, uid, ids, context):
+ """
+ To get the gencod and scan product
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun gencod
+ """
+
+ data=self.read(cr, uid, ids)[0]
+ record_id = context and context.get('active_id',False)
+ result =self. pool.get('pos.order.line')._scan_product(cr, uid, data['gencod'], 1, record_id)
+ return {'gencod': False}
+
+
+
+pos_scan_product()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_scan_product_view.xml b/addons/point_of_sale/wizard/pos_scan_product_view.xml
new file mode 100644
index 00000000000..3957c6c0415
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_scan_product_view.xml
@@ -0,0 +1,34 @@
+
+
+
+
+ Scan product
+ pos.scan.product
+ form
+
+
+
+
+
+
+
+ Scan product
+ ir.actions.act_window
+ pos.scan.product
+ form
+ form
+ new
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/wizard_default_journal.py b/addons/point_of_sale/wizard/wizard_default_journal.py
deleted file mode 100644
index bfe59251f45..00000000000
--- a/addons/point_of_sale/wizard/wizard_default_journal.py
+++ /dev/null
@@ -1,128 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import pooler
-
-
-def _get_default_journal_selection(self, cr, uid, context):
- pool = pooler.get_pool(cr.dbname)
- obj = pool.get('account.journal')
- ids = obj.search(cr, uid, [('type', '=', 'cash')])
- res = obj.read(cr, uid, ids, ['id', 'name'], context)
- res = [(r['id'], r['name']) for r in res]
- res.insert(0, ('', ''))
- return res
-
-default_journal_form = '''
-'''
-
-default_journal_fields = {
- 'default_journal': {'string': 'Default journal', 'type': 'selection',
- 'selection': _get_default_journal_selection,
- },
- 'default_journal_rebate': {'string': 'Default rebate journal', 'type': 'selection',
- 'selection': _get_default_journal_selection,
- },
- 'default_journal_gift': {'string': 'Default gift journal', 'type': 'selection',
- 'selection': _get_default_journal_selection,
- },
-}
-
-
-class wizard_default_journal(wizard.interface):
-
- def _set_default_journal(self, cr, uid, data, context):
-
- def _update_default_journal_config(journal_type, journal_code, journal_descr, journal_codes, data):
- default_journal_id = data.get('form', {}).get(journal_type) or None
- dico = dict(name=journal_descr, code=journal_code, journal_id=default_journal_id)
- if default_journal_id:
- if journal_code in journal_codes:
- ids = [obj.id for obj in objs if obj.code == journal_code]
- pos_config_journal.write(cr, uid, ids, dico, context)
- else:
- pos_config_journal.create(cr, uid, dico, context)
- else:
- ids = [obj.id for obj in objs if obj.code == journal_code]
- pos_config_journal.write(cr, uid, ids, dico, context)
-
- pool = pooler.get_pool(cr.dbname)
- pos_config_journal = pool.get('pos.config.journal')
- ids = pos_config_journal.search(cr, uid, [])
- objs = pos_config_journal.browse(cr, uid, ids)
- journal_codes = [str(obj.code) for obj in objs]
-
- _update_default_journal_config('default_journal', 'DEFAULT', 'Default journal', journal_codes, data)
- _update_default_journal_config('default_journal_rebate', 'REBATE', 'Default rebate journal', journal_codes, data)
- _update_default_journal_config('default_journal_gift', 'GIFT', 'Default gift journal', journal_codes, data)
-
- return {}
-
- def _get_defaults(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- pos_config_journal = pool.get('pos.config.journal')
- ids = pos_config_journal.search(cr, uid, [])
- objs = pos_config_journal.browse(cr, uid, ids)
- journal_codes = {}
- for obj in objs:
- journal_codes[obj.code] = int(obj.journal_id.id)
-
- form = data['form']
- form['default_journal'] = journal_codes.get('DEFAULT') or False
- form['default_journal_rebate'] = journal_codes.get('REBATE') or False
- form['default_journal_gift'] = journal_codes.get('GIFT') or False
-
- return form
-
- states = {
- 'init': {
- 'actions': [_get_defaults],
- 'result': {
- 'type': 'form',
- 'arch': default_journal_form,
- 'fields': default_journal_fields,
- 'state': [
- ('end', 'Cancel'),
- ('set_default_journal', 'Define default journals')
- ]
- }
- },
- 'set_default_journal': {
- 'actions': [_set_default_journal],
- 'result': {
- 'type': 'state',
- 'state': "end",
- }
- },
- }
-
-wizard_default_journal('pos.config.journal')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/wizard_scan_product.py b/addons/point_of_sale/wizard/wizard_scan_product.py
deleted file mode 100644
index 40a8a5b1246..00000000000
--- a/addons/point_of_sale/wizard/wizard_scan_product.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
-# Copyright (c) 2008 Sylëam Info Services. (http://www.syleam.fr) All Rights Reserved.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import pooler
-import wizard
-from osv import osv
-
-form_gencod = """
-
-"""
-
-fields_gencod = {
- 'gencod': {'string': 'Barcode',
- 'type': 'char',
- 'size': 13,
- 'required': True}
-}
-
-
-def _scan(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- result = pool.get('pos.order.line')._scan_product(cr, uid, data['form']['gencod'], 1, data['id'])
- return {'gencod': False}
-
-def _pre_init(self, cr, uid, data, context):
- return {'gencod': False}
-
-class pos_scan_product(wizard.interface):
- states = {
- 'init' : {'actions' : [_pre_init],
- 'result' : {
- 'type': 'form',
- 'arch': form_gencod,
- 'fields': fields_gencod,
- 'state': [('end','Cancel','gtk-cancel'),
- ('add', 'Add', 'gtk-ok', True)],
- }
- },
- 'add' : {'actions' : [_scan],
- 'result' : {
- 'type': 'state',
- 'state': 'init',
- }
- }
- }
-
-pos_scan_product('pos.scan_product')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/pos_sales_user.py b/addons/pos_sales_user.py
deleted file mode 100644
index 35b83148bbd..00000000000
--- a/addons/pos_sales_user.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved
-# $Id$
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields
-from osv import osv
-import time
-import ir
-from mx import DateTime
-import datetime
-import pooler
-from tools import config
-import wizard
-import netsvc
-
-
-sale_forecast_res_form= """
-
-"""
-
-sale_forecast_res_field= {
- 'date_start': {'string':'Start Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'date_end': {'string':'End Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'user_id': {'string': 'Salesman', 'type': 'many2many', 'relation': 'res.users', 'required': True},
-
-}
-
-
-class wizard_pos_sales_user(wizard.interface):
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : sale_forecast_res_form,
- 'fields' : sale_forecast_res_field,
- 'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
- },
- 'print_report' : {
- 'actions' : [],
- 'result' : {'type' : 'print',
- 'report':'pos.sales.user',
- 'state' : 'end'}
- },
- }
-wizard_pos_sales_user('pos.sales.user')
\ No newline at end of file