diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 360a36c436f..f48f800d178 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -91,7 +91,7 @@ class pos_config(osv.osv): 'group_by' : fields.boolean('Group Journal Items', help="Check this if you want to group the Journal Items by Product while closing a Session"), 'pricelist_id': fields.many2one('product.pricelist','Pricelist', required=True), 'company_id': fields.many2one('res.company', 'Company', required=True), - 'barcode_nomenclature_id': fields.many2one('barcode.nomenclature','Barcode Nomenclature', help='A barcode nomenclature', required="True"), + 'barcode_nomenclature_id': fields.many2one('barcode.nomenclature','Barcode Nomenclature', help='A barcode nomenclature', required=True), 'group_pos_manager_id': fields.many2one('res.groups','Point of Sale Manager Group', help='This field is there to pass the id of the pos manager group to the point of sale client'), 'group_pos_user_id': fields.many2one('res.groups','Point of Sale User Group', help='This field is there to pass the id of the pos user group to the point of sale client'), } @@ -174,9 +174,7 @@ class pos_config(osv.osv): def _get_default_nomenclature(self, cr, uid, context=None): nom_obj = self.pool.get('barcode.nomenclature') res = nom_obj.search(cr, uid, [], limit=1, context=context) - if res and res[0]: - return nom_obj.browse(cr, uid, res[0], context=context).id - return False + return res and res[0] or False def _get_group_pos_manager(self, cr, uid, context=None): group = self.pool.get('ir.model.data').get_object_reference(cr,uid,'point_of_sale','group_pos_manager') diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 64aa3e97444..9285cd2532b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -819,15 +819,13 @@ class stock_picking(osv.osv): 'stock.picking': (lambda self, cr, uid, ids, ctx: ids, ['move_lines'], 10), 'stock.move': (_get_pickings, ['group_id', 'picking_id'], 10), }), - 'barcode_nomenclature_id': fields.many2one('barcode.nomenclature','Barcode Nomenclature', help='A barcode nomenclature', required="True"), + 'barcode_nomenclature_id': fields.many2one('barcode.nomenclature','Barcode Nomenclature', help='A barcode nomenclature', required=True), } def _get_default_nomenclature(self, cr, uid, context=None): nom_obj = self.pool.get('barcode.nomenclature') res = nom_obj.search(cr, uid, [], limit=1, context=context) - if res and res[0]: - return nom_obj.browse(cr, uid, res[0], context=context).id - return False + return res and res[0] or False _defaults = { 'name': '/',