crm: mailgate fill the history and improve menu

bzr revid: ced-76f02d339976be0c6c1962394a959ff3438945ac
This commit is contained in:
ced 2007-07-11 15:10:06 +00:00
parent fcad0f1697
commit bcf8ecf5da
2 changed files with 36 additions and 11 deletions

View File

@ -63,7 +63,7 @@
<record model="ir.actions.act_window" id="crm_case_section_act">
<field name="res_model">crm.case.section</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_section_view_form"/>
<field name="view_id" ref="crm_case_section_view_tree"/>
</record>
<menuitem name="CRM &amp; SRM/Configuration/Cases/Sections" id="menu_crm_case_section_act" action="crm_case_section_act" groups="admin"/>
@ -94,10 +94,23 @@
</form>
</field>
</record>
<record model="ir.ui.view" id="crm_case_categ_tree-view">
<field name="name">crm.case.categ.tree</field>
<field name="model">crm.case.categ</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Case Category">
<field name="name"/>
<field name="section_id"/>
<field name="probability"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="crm_case_categ-act">
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_categ-view"/>
<field name="view_id" ref="crm_case_categ_tree-view"/>
</record>
<menuitem name="CRM &amp; SRM/Configuration/Cases/Categories" id="menu_crm_case_categ-act" action="crm_case_categ-act" groups="admin"/>
@ -175,10 +188,21 @@
</form>
</field>
</record>
<record model="ir.ui.view" id="crm_case_rule_tree-view">
<field name="name">crm.case.rule.tree</field>
<field name="model">crm.case.rule</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Case Rule">
<field name="name"/>
<field name="active"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="crm_case_rule-act">
<field name="res_model">crm.case.rule</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_rule-view"/>
<field name="view_id" ref="crm_case_rule_tree-view"/>
</record>
<menuitem name="CRM &amp; SRM/Configuration/Cases/Rules" id="menu_crm_case_rule-act" action="crm_case_rule-act" groups="admin"/>
@ -326,7 +350,7 @@
<record model="ir.actions.act_window" id="crm_case_categ0-act">
<field name="res_model">crm.case</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case-view"/>
<field name="view_id" ref="crm_case_tree-view"/>
</record>
<menuitem name="CRM &amp; SRM/Cases/All Cases" id="menu_crm_case_categ0-act" action="crm_case_categ0-act"/>
@ -385,8 +409,8 @@
<record model="ir.actions.act_window" id="crm_case_history-act">
<field name="res_model">crm.case.history</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="crm_case_history-view"/>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm_case_history_tree-view"/>
</record>
<menuitem name="CRM &amp; SRM/Cases/Cases Actions" id="menu_crm_case_history-act_main" groups="admin"/>
<menuitem name="CRM &amp; SRM/Cases/Cases Actions/All Actions" id="menu_crm_case_history-act" action="crm_case_history-act" groups="admin"/>
@ -489,7 +513,7 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem name="CRM &amp; SRM/Configuration" groups="admin"/>
<menuitem name="CRM &amp; SRM/Configuration/Segmentations/Segmentations rules" id="menu_crm_segmentation-act" action="crm_segmentation-act"/>
<menuitem name="CRM &amp; SRM/Configuration/Segmentations/Segmentations rules" id="menu_crm_segmentation-act" action="crm_segmentation_tree-act"/>
<menuitem name="CRM &amp; SRM/Automatic Segmentations" id="menu_crm_segmentation_tree-act" action="crm_segmentation_tree-act"/>
<act_window name="Opened cases"

View File

@ -79,7 +79,8 @@ class email_parser(object):
'email_from': self._decode_header(msg['From']),
'email_cc': self._decode_header(msg['Cc'] or ''),
'canal_id': self.canal_id,
'user_id': False
'user_id': False,
'history_line': [(0, 0, {'description': message['body'], 'email': msg['From'] })],
}
try:
data.update(self.partner_get(self._decode_header(msg['From'])))
@ -147,8 +148,8 @@ class email_parser(object):
def msg_user(self, msg, id):
body = self.msg_body_get(msg)
data = {
'description': '> '+body['body'].replace('\n','\n> '),
'email_last': body['body']
'email_last': body['body'],
'history_line': [(0, 0, {'description': body['body'], 'email': msg['From']})],
}
# handle email body commands (ex: Set-State: Draft)
@ -211,8 +212,8 @@ class email_parser(object):
self.rpc('crm.case', act, [id])
body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n')))
data = {
'description': body2,
'email_last': body,
'history_line': [(0, 0, {'description': body, 'email': msg['From']})],
}
self.rpc('crm.case', 'write', [id], data)
return id