summaryrefslogtreecommitdiff
path: root/addons/test_mail/data
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2017-12-05 15:02:14 +0100
committerThibault Delavallée <tde@odoo.com>2017-12-12 15:46:37 +0100
commitcde06d5f5c7cbbe11366f6bb39f825172d8fe097 (patch)
tree4277b3f1ec3cc0c5cf050221a8151d414a709cb5 /addons/test_mail/data
parent56ae134bb223d16da712f5dcfe0d9a221feb5d72 (diff)
[IMP] test_mail: move some data into demo and update tests accordingly
Creating data directly in tests was done when tests were located in mail module to avoid creating real data or demo. Now that mail tests have their own module we can create demo data and use them in tests. It is simpler to have demo data for things like subtype and email templates to ease understanding and reuse.
Diffstat (limited to 'addons/test_mail/data')
-rw-r--r--addons/test_mail/data/subtype_demo.xml28
-rw-r--r--addons/test_mail/data/template_demo.xml24
2 files changed, 52 insertions, 0 deletions
diff --git a/addons/test_mail/data/subtype_demo.xml b/addons/test_mail/data/subtype_demo.xml
new file mode 100644
index 00000000000..20a486aace8
--- /dev/null
+++ b/addons/test_mail/data/subtype_demo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <record id="st_mail_test_full_umbrella_upd" model="mail.message.subtype">
+ <field name="name">Umbrella Changed Subtype</field>
+ <field name="description">Umbrella Changed</field>
+ <field name="res_model">mail.test.full</field>
+ <field name="default" eval="True"/>
+ <field name="internal" eval="False"/>
+ </record>
+
+ <record id="st_mail_test_default" model="mail.message.subtype">
+ <field name="name">Umbrella Default Subtype</field>
+ <field name="res_model">mail.test</field>
+ <field name="default" eval="True"/>
+ <field name="internal" eval="False"/>
+ </record>
+ <!-- when subscribing to mail.test umbrella, delegate to mail.test.full child -->
+ <record id="st_mail_test_child_full" model="mail.message.subtype">
+ <field name="name">Umbrella Child Full Subtype</field>
+ <field name="res_model">mail.test</field>
+ <field name="parent_id" eval="ref('test_mail.st_mail_test_full_umbrella_upd')"/>
+ <field name="relation_field">umbrella_id</field>
+ <field name="default" eval="False"/>
+ <field name="internal" eval="False"/>
+ </record>
+
+</odoo>
diff --git a/addons/test_mail/data/template_demo.xml b/addons/test_mail/data/template_demo.xml
new file mode 100644
index 00000000000..35bdbedd7a2
--- /dev/null
+++ b/addons/test_mail/data/template_demo.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="mail_test_full_tracking_tpl" model="mail.template">
+ <field name="name">Mail Test Full: Tracking Template</field>
+ <field name="subject">Test Template</field>
+ <field name="partner_to">${object.customer_id.id | safe}</field>
+ <field name="body_html" type="xml"><p>Hello ${object.name}</p></field>
+ <field name="model_id" ref="test_mail.model_mail_test_full"/>
+ <field name="auto_delete" eval="True"/>
+ </record>
+
+ <record id="mail_test_tpl" model="mail.template">
+ <field name="name">Mail Test: Template</field>
+ <field name="subject">Post on ${object.name}</field>
+ <field name="partner_to">${object.customer_id.id}</field>
+ <field name="body_html" type="xml"><p>Adding stuff on ${object.name}</p></field>
+ <field name="model_id" ref="test_mail.model_mail_test"/>
+ <field name="auto_delete" eval="True"/>
+ </record>
+
+ <template id="mail_test_full_tracking_view">
+ <p><span t-esc="object.name"/> datetime has been updated to <span t-esc="object.datetime"/></p>
+ </template>
+</odoo>