Browse Source

[IMP] adjust view definitions to 7.0

[FIX] use mail_thread.message_parse in wizard
pull/2/head
Holger Brunn 11 years ago
parent
commit
32dddd04d5
  1. 19
      fetchmail_attach_from_folder/view/fetchmail_server.xml
  2. 6
      fetchmail_attach_from_folder/wizard/attach_mail_manually.py
  3. 12
      fetchmail_attach_from_folder/wizard/attach_mail_manually.xml

19
fetchmail_attach_from_folder/view/fetchmail_server.xml

@ -24,26 +24,27 @@
<field name="match_algorithm" />
<field name="mail_field" />
</tree>
<form col="6">
<form version="7.0">
<header>
<button type="object" name="button_attach_mail_manually" string="Attach mail manually" icon="gtk-redo" />
</header>
<group>
<group>
<field name="path" />
<field name="model_id" />
<field name="model_field" />
<field name="match_algorithm" />
<field name="mail_field" />
<newline />
</group>
<group>
<field name="delete_matching" />
<field name="flag_nonmatching" />
<field name="match_first" />
<field name="msg_state" />
<field name="model_order" attrs="{'readonly': [('match_first','==',False)], 'required': [('match_first','==',True)]}" />
<field name="domain" />
<newline />
<label />
<label />
<label />
<label />
<label />
<button type="object" name="button_attach_mail_manually" string="Attach mail manually" icon="gtk-redo" />
</group>
</group>
</form>
</field>
</group>

6
fetchmail_attach_from_folder/wizard/attach_mail_manually.py

@ -85,8 +85,10 @@ class attach_mail_manually(TransientModel):
msgid, folder.path, this.server))
continue
mail_message = self.pool.get('mail.message').parse_message(
msgdata[0][1], this.folder_id.server_id.original)
mail_message = self.pool.get('mail.thread').message_parse(
cr, uid, msgdata[0][1],
save_original=this.folder_id.server_id.original,
context=context)
this.folder_id.server_id.attach_mail(connection,
mail.object_id.id, this.folder_id, mail_message,

12
fetchmail_attach_from_folder/wizard/attach_mail_manually.xml

@ -6,20 +6,22 @@
<field name="model">fetchmail.attach.mail.manually</field>
<field name="arch" type="xml">
<form col="4" version="7.0" string="Attach mail manually">
<sheet>
<group>
<field name="folder_id" />
<field name="mail_ids" nolabel="1" colspan="4">
<tree editable="top">
<tree editable="top" create="0">
<field name="subject" />
<field name="date" />
<field name="object_id" />
</tree>
</field>
<label string="" />
<label string="" />
<button special="cancel" string="Cancel" icon="gtk-cancel" />
<button string="Save" type="object" name="attach_mails" icon="gtk-ok" />
</group>
</sheet>
<footer>
<button string="Save" type="object" name="attach_mails" icon="gtk-ok" />
<button special="cancel" string="Cancel" icon="gtk-cancel" />
</footer>
</form>
</field>
</record>

Loading…
Cancel
Save