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. 41
      fetchmail_attach_from_folder/view/fetchmail_server.xml
  2. 6
      fetchmail_attach_from_folder/wizard/attach_mail_manually.py
  3. 28
      fetchmail_attach_from_folder/wizard/attach_mail_manually.xml

41
fetchmail_attach_from_folder/view/fetchmail_server.xml

@ -24,26 +24,27 @@
<field name="match_algorithm" /> <field name="match_algorithm" />
<field name="mail_field" /> <field name="mail_field" />
</tree> </tree>
<form col="6">
<field name="path" />
<field name="model_id" />
<field name="model_field" />
<field name="match_algorithm" />
<field name="mail_field" />
<newline />
<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" />
<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" />
</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" />
</group>
</group>
</form> </form>
</field> </field>
</group> </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)) msgid, folder.path, this.server))
continue 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, this.folder_id.server_id.attach_mail(connection,
mail.object_id.id, this.folder_id, mail_message, mail.object_id.id, this.folder_id, mail_message,

28
fetchmail_attach_from_folder/wizard/attach_mail_manually.xml

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

Loading…
Cancel
Save