[FIX] procurement: fixed a context not present in a method.

bzr revid: tde@openerp.com-20120601145924-r9rkl58ohv4wdjyu
This commit is contained in:
Thibault Delavallée 2012-06-01 16:59:24 +02:00
parent 11d6850f16
commit bdcd825c72
1 changed files with 3 additions and 3 deletions

View File

@ -289,14 +289,14 @@ class procurement_order(osv.osv):
return False
if not procurement.product_id.seller_ids:
message = _('No supplier defined for this product !')
self.message_append_note(cr, uid, [procurement.id], body=message, context=context)
self.message_append_note(cr, uid, [procurement.id], body=message)
cr.execute('update procurement_order set message=%s where id=%s', (message, procurement.id))
return False
partner = procurement.product_id.seller_id #Taken Main Supplier of Product of Procurement.
if not partner:
message = _('No default supplier defined for this product')
self.message_append_note(cr, uid, [procurement.id], body=message, context=context)
self.message_append_note(cr, uid, [procurement.id], body=message)
cr.execute('update procurement_order set message=%s where id=%s', (message, procurement.id))
return False
if user.company_id and user.company_id.partner_id:
@ -306,7 +306,7 @@ class procurement_order(osv.osv):
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
if not address_id:
message = _('No address defined for the supplier')
self.message_append_note(cr, uid, [procurement.id], body=message, context=context)
self.message_append_note(cr, uid, [procurement.id], body=message)
cr.execute('update procurement_order set message=%s where id=%s', (message, procurement.id))
return False
return True