diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 4c73a11ab4e..98ddeb9dae7 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1356,19 +1356,6 @@ class pos_order_line(osv.osv): 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } -class ean_wizard(osv.osv_memory): - _name = 'pos.ean_wizard' - _columns = { - 'ean13_pattern': fields.char('Reference', size=13, required=True, translate=True), - } - def sanitize_ean13(self, cr, uid, ids, context): - for r in self.browse(cr,uid,ids): - ean13 = openerp.addons.product.product.sanitize_ean13(r.ean13_pattern) - m = context.get('active_model') - m_id = context.get('active_id') - self.pool[m].write(cr,uid,[m_id],{'barcode':ean13}) - return { 'type' : 'ir.actions.act_window_close' } - class pos_category(osv.osv): _name = "pos.category" _description = "Public Category" diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 1a20ebfcd17..70a5dbdb55f 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -528,14 +528,6 @@ - - Edit Ean - pos.ean_wizard - new - form - form - - product.template.form.inherit product.template @@ -550,28 +542,6 @@ - - product.template.only.form.inherit.ean - product.template - - - - - - - - - product.form.inherit.ean - product.product - - - - - - - - product.template.tree.inherit product.template @@ -977,27 +947,6 @@ parent="menu_point_root" name="Dashboard" id="menu_pos_dashboard" sequence="1"/> - - pos.ean_wizard - pos.ean_wizard - - - - Enter a reference, it will be converted - automatically to a valid EAN number. - - - - - - - - - diff --git a/addons/point_of_sale/res_partner_view.xml b/addons/point_of_sale/res_partner_view.xml index 34448d0c1bd..6fb2b45c862 100644 --- a/addons/point_of_sale/res_partner_view.xml +++ b/addons/point_of_sale/res_partner_view.xml @@ -1,7 +1,7 @@ - + res.partner.pos.form.inherit res.partner @@ -9,11 +9,7 @@ - - - - - + diff --git a/addons/point_of_sale/res_users_view.xml b/addons/point_of_sale/res_users_view.xml index cad0d8675a5..5c60f3a4db7 100644 --- a/addons/point_of_sale/res_users_view.xml +++ b/addons/point_of_sale/res_users_view.xml @@ -24,7 +24,6 @@ - diff --git a/addons/product/product.py b/addons/product/product.py index c5397857463..61079b878e6 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -18,38 +18,6 @@ from openerp.tools.float_utils import float_round, float_compare from openerp.exceptions import UserError from openerp.exceptions import except_orm -def ean_checksum(eancode): - """returns the checksum of an ean string of length 13, returns -1 if the string has the wrong length""" - if len(eancode) != 13: - return -1 - oddsum=0 - evensum=0 - total=0 - eanvalue=eancode - reversevalue = eanvalue[::-1] - finalean=reversevalue[1:] - - for i in range(len(finalean)): - if i % 2 == 0: - oddsum += int(finalean[i]) - else: - evensum += int(finalean[i]) - total=(oddsum * 3) + evensum - - check = int(10 - math.ceil(total % 10.0)) %10 - return check - -def sanitize_ean13(ean13): - """Creates and returns a valid ean13 from an invalid one""" - if not ean13: - return "0000000000000" - ean13 = re.sub("[A-Za-z]","0",ean13); - ean13 = re.sub("[^0-9]","",ean13); - ean13 = ean13[:13] - if len(ean13) < 13: - ean13 = ean13 + '0' * (13-len(ean13)) - return ean13[:-1] + str(ean_checksum(ean13)) - #---------------------------------------------------------- # UOM #----------------------------------------------------------
- Enter a reference, it will be converted - automatically to a valid EAN number. -