From 5418e395731507f1ac2bd06642aeb05d4c481fea Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Fri, 7 Jun 2013 15:31:29 +0530 Subject: [PATCH] [IMP]make warehouse required true and improve warning when there is no warehouse define for current company bzr revid: sgo@tinyerp.com-20130607100129-vyvxbhbckakc7kr6 --- addons/sale_stock/sale_stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 9c71382af17..8fcf6fc47a7 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -70,7 +70,7 @@ class sale_order(osv.osv): company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id warehouse_ids = self.pool.get('stock.warehouse').search(cr, uid, [('company_id','=',company_id)], context=context) if not warehouse_ids: - raise osv.except_osv(_('Error!'), _('There is no default location for the current user\'s company!')) + raise osv.except_osv(_('Error!'), _('There is no warehouse defined for the current company!')) return warehouse_ids[0] # This is False @@ -140,7 +140,7 @@ class sale_order(osv.osv): 'picking_ids': fields.one2many('stock.picking.out', 'sale_id', 'Related Picking', readonly=True, help="This is a list of delivery orders that has been generated for this sales order."), 'shipped': fields.boolean('Delivered', readonly=True, help="It indicates that the sales order has been delivered. This field is updated only after the scheduler(s) have been launched."), 'picked_rate': fields.function(_picked_rate, string='Picked', type='float'), - 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'), + 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',required=True), 'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sales order will automatically create the invoice proposition (draft invoice).\ You have to choose if you want your invoice based on ordered ", required=True, readonly=True, states={'draft': [('readonly', False)]}),