X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=addons%2Fpoint_of_sale%2Fpoint_of_sale.py;fp=addons%2Fpoint_of_sale%2Fpoint_of_sale.py;h=d30d754ff241e81a23a91721bbac8e1a295ca861;hb=785e3a243ae3d5d66b35d598e4f032b83131dc29;hp=abae5f6ccc3f70c78867aa3c36dafd74c72b0b28;hpb=9ef27d334d732e609f77f1146778eaba1c801ee7;p=odoo%2Fodoo.git diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index abae5f6..d30d754 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -22,6 +22,7 @@ import logging import time import uuid +import sets from openerp import tools, models from openerp.osv import fields, osv @@ -1466,25 +1467,14 @@ class barcode_rule(models.Model): _inherit = 'barcode.rule' def _get_type_selection(self): - types = super(barcode_rule,self)._get_type_selection() - - new_types = [ - ('weight','Weighted Product'), - ('price','Priced Product'), - ('discount','Discounted Product'), - ('client','Client'), - ('cashier','Cashier') - ] - - for (key, value) in new_types: - add = True - for (key2, value2) in types: - if key == key2: - add = False - break - if add: - types += [(key, value)] - - return types + types = sets.Set(super(barcode_rule,self)._get_type_selection()) + types.update([ + ('weight','Weighted Product'), + ('price','Priced Product'), + ('discount','Discounted Product'), + ('client','Client'), + ('cashier','Cashier') + ]) + return list(types) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: