diff options
| author | ced <> | 2007-07-11 15:10:06 +0000 |
|---|---|---|
| committer | ced <> | 2007-07-11 15:10:06 +0000 |
| commit | bcf8ecf5da76c81cb3c680559d4a5d702cdf9a7b (patch) | |
| tree | da1925eb8bc85b1f1bf4121df615d9dc1aff8c62 | |
| parent | fcad0f1697a726b4cae095e09e334bcf1e1207a0 (diff) | |
crm: mailgate fill the history and improve menu
bzr revid: ced-76f02d339976be0c6c1962394a959ff3438945ac
| -rw-r--r-- | addons/crm/crm_view.xml | 38 | ||||
| -rwxr-xr-x | addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py | 9 |
2 files changed, 36 insertions, 11 deletions
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index 843dc966085..19a030921fb 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -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 & 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 & 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 & 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 & 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 & SRM/Cases/Cases Actions" id="menu_crm_case_history-act_main" groups="admin"/> <menuitem name="CRM & 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 & SRM/Configuration" groups="admin"/> - <menuitem name="CRM & SRM/Configuration/Segmentations/Segmentations rules" id="menu_crm_segmentation-act" action="crm_segmentation-act"/> + <menuitem name="CRM & SRM/Configuration/Segmentations/Segmentations rules" id="menu_crm_segmentation-act" action="crm_segmentation_tree-act"/> <menuitem name="CRM & SRM/Automatic Segmentations" id="menu_crm_segmentation_tree-act" action="crm_segmentation_tree-act"/> <act_window name="Opened cases" diff --git a/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py b/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py index 247337a8294..52e5bf6c001 100755 --- a/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py +++ b/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py @@ -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 |
