[FIX]sale: Update context as it was none in method and was not able to translate raised exception

bzr revid: mma@tinyerp.com-20121102130317-kmuxgk7vjdneq0da
This commit is contained in:
Mayur Maheshwari (OpenERP)
2012-11-02 18:33:17 +05:30
parent 173c3e4756
commit 907c983760
+6
View File
@@ -265,6 +265,9 @@ class sale_order(osv.osv):
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context=None):
if context is None:
context = {}
context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
if not pricelist_id:
return {}
value = {
@@ -601,6 +604,9 @@ class sale_order(osv.osv):
}
def action_wait(self, cr, uid, ids, context=None):
if context is None:
context = {}
context.update({'lang': self.pool.get('res.users').context_get(cr, uid, context)['lang']})
for o in self.browse(cr, uid, ids):
if not o.order_line:
raise osv.except_osv(_('Error!'),_('You cannot confirm a sale order which has no line.'))