[FIX]sale_crm: update context
bzr revid: pat@tinyerp.com-20120619121016-quk5kem1eud7ddro
This commit is contained in:
@@ -520,7 +520,8 @@ class EDIMixin(object):
|
||||
'datas': result,
|
||||
'datas_fname': file_name,
|
||||
'res_model': self._name,
|
||||
'res_id': record.id},
|
||||
'res_id': record.id,
|
||||
'type': 'binary'},
|
||||
context=context)
|
||||
|
||||
def _edi_import_attachments(self, cr, uid, record_id, edi_document, context=None):
|
||||
|
||||
@@ -763,14 +763,17 @@ class sale_order(osv.osv):
|
||||
'''
|
||||
This function opens a window to compose an email, with the edi sale template message loaded by default
|
||||
'''
|
||||
print "\n =--===== context -==>", context
|
||||
assert len(ids) == 1, 'This option should only be used for a single id at a time'
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
template = mod_obj.get_object_reference(cr, uid, 'sale', 'email_template_edi_sale')
|
||||
print "\n\ntemplate.......", template, "\n"
|
||||
template_id = template and template[1] or False
|
||||
res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')
|
||||
res_id = res and res[1] or False
|
||||
ctx = dict(context, active_model='sale.order', active_id=ids[0])
|
||||
ctx.update({'mail.compose.template_id': template_id})
|
||||
print "\n =--===== cont -==>", ctx
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
|
||||
@@ -107,7 +107,6 @@ class crm_make_sale(osv.osv_memory):
|
||||
new_ids.append(new_id)
|
||||
message = _("Opportunity has been <b>converted</b> to the quotation <em>%s</em>.") % (sale_order.name)
|
||||
case.message_append_note(body=message)
|
||||
|
||||
if make.close:
|
||||
case_obj.case_close(cr, uid, data)
|
||||
if not new_ids:
|
||||
|
||||
Reference in New Issue
Block a user