[IMP] email_template :- change string in user_id field and get action id using get_id method.
bzr revid: ysa@tinyerp.com-20110215125114-7100vv8hf8q61wan
This commit is contained in:
parent
5dafdee3cb
commit
35c054d352
|
@ -179,8 +179,11 @@ This is useful for CRM leads for example"),
|
|||
if context is None:
|
||||
context = {}
|
||||
action_obj = self.pool.get('ir.actions.act_window')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
for template in self.browse(cr, uid, ids, context=context):
|
||||
src_obj = template.model_id.model
|
||||
model_data_id = data_obj._get_id(cr, uid, 'email_template', 'email_template_send_wizard_form')
|
||||
res_id = data_obj.browse(cr, uid, model_data_id, context=context).res_id
|
||||
vals['ref_ir_act_window'] = action_obj.create(cr, uid, {
|
||||
'name': template.name,
|
||||
'type': 'ir.actions.act_window',
|
||||
|
@ -189,7 +192,7 @@ This is useful for CRM leads for example"),
|
|||
'view_type': 'form',
|
||||
'context': "{'src_model':'%s','template_id':'%d','src_rec_id':active_id,'src_rec_ids':active_ids}" % (src_obj, template.id),
|
||||
'view_mode':'form,tree',
|
||||
'view_id': self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'email_template.send.wizard.form')], context=context)[0],
|
||||
'view_id': res_id,
|
||||
'target': 'new',
|
||||
'auto_refresh':1
|
||||
}, context)
|
||||
|
|
|
@ -306,7 +306,7 @@ class email_message(osv.osv):
|
|||
attachment_obj = self.pool.get('ir.attachment')
|
||||
smtp_server_obj = self.pool.get('email.smtp_server')
|
||||
if not ids:
|
||||
filters = [('folder', '=', 'outbox'), ('state', '!=', 'sending')]
|
||||
filters = [('folder', '=', 'outbox'), ('state', '!=', 'waiting')]
|
||||
if 'filters' in context:
|
||||
filters.extend(context['filters'])
|
||||
ids = self.search(cr, uid, filters, context=context)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<group colspan="4" col="6">
|
||||
<field name="name" widget="char" size="512"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id" string="Owner"/>
|
||||
<field name="user_id" string="User"/>
|
||||
<field name="partner_id" readonly="1" />
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
|
@ -73,7 +73,7 @@
|
|||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="email_from"/>
|
||||
<field name="user_id" string="Owner"/>
|
||||
<field name="user_id" string="User"/>
|
||||
<field name="message_id" string="Message" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="folder"/>
|
||||
|
@ -100,13 +100,13 @@
|
|||
<filter icon="terp-gtk-stop" string="Exception" domain="[('state','=','exception')]"/>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="user_id" string="Owner"/>
|
||||
<field name="user_id" string="User"/>
|
||||
<field name="partner_id" string="Partner Name"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." groups="base.group_extended">
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Ower" name="Ower" icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Thread" icon="terp-mail-" domain="[]" context="{'group_by':'message_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
|
Loading…
Reference in New Issue