[FIX] stock, point_of_sale: required='True' replaced by required=True in barcode_nomenclature_id field definition and _get_default_nomenclature function refactored

Conflicts:
	addons/point_of_sale/point_of_sale.py
This commit is contained in:
Aaron Bohy
2014-11-26 12:11:59 +01:00
committed by Frédéric van der Essen
parent d6ea949993
commit 58fb939436
2 changed files with 4 additions and 8 deletions
+2 -4
View File
@@ -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')
+2 -4
View File
@@ -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': '/',