[IMP] Improve code in py.

bzr revid: bth@tinyerp.com-20130218083052-9ja7p7wqn9dn2s4s
This commit is contained in:
Bhumi Thakkar (Open ERP)
2013-02-18 14:00:52 +05:30
parent 83879211f3
commit 88e8efcc12
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -248,7 +248,7 @@ class purchase_order(osv.osv):
def create(self, cr, uid, vals, context=None):
if vals.get('name','/')=='/':
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'purchase.order') or '/'
context = dict(context, mail_create_nolog=True)
context.update({ 'mail_create_nolog' : True })
order = super(purchase_order, self).create(cr, uid, vals, context=context)
self.message_post(cr, uid, [order], body=_("RFQ <b>Created</b>"), context=context)
return order
@@ -792,7 +792,7 @@ class purchase_order(osv.osv):
order_data['order_line'] = [(0, 0, value) for value in order_data['order_line'].itervalues()]
# create the new order
context = dict(context, mail_create_nolog=True)
context.update({ 'mail_create_nolog' : True })
neworder_id = self.create(cr, uid, order_data)
self.message_post(cr, uid, [neworder_id], body=_("RFQ <b>Created</b>"), context=context)
orders_info.update({neworder_id: old_ids})
@@ -132,7 +132,7 @@ class purchase_requisition(osv.osv):
if supplier.id in filter(lambda x: x, [rfq.state <> 'cancel' and rfq.partner_id.id or None for rfq in requisition.purchase_ids]):
raise osv.except_osv(_('Warning!'), _('You have already one %s purchase order for this partner, you must cancel this purchase order to create a new quotation.') % rfq.state)
location_id = requisition.warehouse_id.lot_input_id.id
context = dict(context, mail_create_nolog=True)
context.update({ 'mail_create_nolog' : True })
purchase_id = purchase_order.create(cr, uid, {
'origin': requisition.name,
'partner_id': supplier.id,