summaryrefslogtreecommitdiff
path: root/addons/note/controllers
AgeCommit message (Collapse)Author
2019-11-25[IMP] mail: better prevent activity type removal and add a fallback mechanismVictor Feyens
Current activity types master data cannot be unlinked through a quite harsh override of unlink using xml id existence, introduced at 2602642a78dff6c15d615fadf4c55a6b6ca315df. Some of them are real master data, other could be unlinked if users want it. Finally custom activity types may cause errors when removed if used in some side models like server actions or automated actions. To allow more flexibility we remove the removal constraint and implement a fallback mechanism. It is implemented in mail.activity.mixin when calling activity_schedule(xmlid, ...). If the given xmlid is not found _default_activity_type() specifies the default activity to use. It can be overridden in modules if some specific behavior is wanted. e.g. def _default_activity_type(self): """Define a default fallback activity type when xml id not found only used in in activity_schedule() for now. """ try: return self.env.ref('mail.mail_activity_data_todo') except Exception: return False In this commit we also * restrict deletion of activity type (hr.plan and ir.actions.server); * fallback on default activity type if xmlid ref not found in activity_schedule; * correct calls to activity_schedule and replace some manual creation calls by activity_schedule; Task ID 1961156 PR #39013 Related: odoo/enterprise#6238 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Co-authored-by: Victor Feyens <vfe@odoo.com> Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2018-04-09[REF] mail, note: move reminder feature from mail to noteDharmang Soni
This commit refactors f488dc58c37fdc7fd49df759165de641e213444b that added reminder feature in activities. After merging it was suggested specifications were not correct and it has been decided to move the whole reminder feature in note. Reminders are now notes instead of activities. Now when having note appµ systray proposes to create a note / reminder. A note.note record is created with info given by the user. If a date is given in the systray quick create then an activity is scheduled on this note. This means user can create records in activity systray that are not activities but notes used as reminders. Those will use the first availableµ note column for the user. As reminders are now notes the support of activities not linked to any document is removed, as well as archiving activities and tests linked to that behavior. This commit has been not carefully tested nor in-depth reviewied. It is considered as too important for the upcoming freeze. This closes task ID 1833628. Closes #24129 . Many thanks to @dpr-odoo for its quick development and good work on this task.