This commit adds tools methods related to activities in the mail.activity mixin. It gives to models inheriting from the activity mixin an easy-to-use API to schedule, unlink or mark activities as done. Purpose of those methods is to avoid having people manually managing activities in the code to hide the technical details of the activities model, notably access rights or activity types. A field is added on activity model to indicate they have been generated automatically. This way when rescheduling or unlinking based on some specific activity types we do not change user-created activities. Those methods include scheduling activities, changing their dates, marking them as done or unlinking them. Future commits will use those methods in various addons to automatically generate activities based on workflow we want to implement. This commit also adds tests for the newly added code. Future commits should probably have a look at activity security and add some tests cases to check it is correctly taken into account. It is considered a bit out of scope for this task. Thanks to @jem-odoo for its in-depth review of this commit. Well thanks for other commits also.
24 lines
1.1 KiB
XML
24 lines
1.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="mail_act_test_todo" model="mail.activity.type">
|
|
<field name="name">Do Stuff</field>
|
|
<field name="summary">Really?! Wow! A superpowers drug you can just rub onto your skin?</field>
|
|
<field name="category">default</field>
|
|
<field name="res_model_id" ref="test_mail.model_mail_test_activity"/>
|
|
</record>
|
|
<record id="mail_act_test_meeting" model="mail.activity.type">
|
|
<field name="name">Meet People</field>
|
|
<field name="summary">You'd think it would be something you'd have to freebase. Noooooo!</field>
|
|
<field name="category">default</field>
|
|
<field name="res_model_id" ref="test_mail.model_mail_test_activity"/>
|
|
</record>
|
|
<record id="mail_act_test_call" model="mail.activity.type">
|
|
<field name="name">Call People</field>
|
|
<field name="summary">Then throw her in the laundry room, which will hereafter be referred to as "the brig".</field>
|
|
<field name="category">default</field>
|
|
<field name="res_model_id" ref="test_mail.model_mail_test_activity"/>
|
|
</record>
|
|
|
|
</odoo>
|