add exception on SO when no partner

bzr revid: nel@tinyerp.com-20090123130736-mmbwyibbn2lo9o7j
This commit is contained in:
Najlaâ EL KHAYAT 2009-01-23 14:07:36 +01:00
parent bd0148a496
commit 8e3e534bef
1 changed files with 2 additions and 0 deletions

View File

@ -851,6 +851,8 @@ class sale_order_line(osv.osv):
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False):
if not pricelist:
raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\nPlease set one partner before choosing a product.'))
warning={}
product_uom_obj = self.pool.get('product.uom')
partner_obj = self.pool.get('res.partner')