[FIX] purchase: solved issue of PO not goes in sent state

bzr revid: cha@tinyerp.com-20121123062618-r3klopmt0b3czczt
This commit is contained in:
Ajay Chauhan (OpenERP) 2012-11-23 11:56:18 +05:30
parent 698f50daca
commit 17bb9448ba
2 changed files with 10 additions and 1 deletions

View File

@ -44,7 +44,7 @@
% if object.partner_ref:
&nbsp;&nbsp;Your reference: ${object.partner_ref}<br />
% endif
% if object.user_id:
% if object.validator:
&nbsp;&nbsp;Your contact: <a href="mailto:${object.validator.email or ''}?subject=Order%20${object.name}">${object.validator.name}</a>
% endif
</p>

View File

@ -1168,4 +1168,13 @@ class product_template(osv.osv):
product_template()
class mail_compose_message(osv.osv):
_inherit = 'mail.compose.message'
def send_mail(self, cr, uid, ids, context=None):
context = context or {}
if context.get('default_model') == 'purchase.order' and context.get('default_res_id'):
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'purchase.order', context['default_res_id'], 'send_rfq', cr)
return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: