summaryrefslogtreecommitdiff
path: root/addons/mail/validation.py
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2019-02-04 06:18:08 +0000
committerMartin Geubelle <mge@odoo.com>2019-05-03 10:19:40 +0000
commitb2de618f9ff9969ff0644f3be10752f23d9738dc (patch)
treea7f54bb16273f3b626a96d363e0f54bf19bb4ba3 /addons/mail/validation.py
parentb29d4da037fbf73717cccdfcdf76d96e5b1b009b (diff)
[IMP] base,mail: allow to customize the activity view
The activity view has been greatly improved to allow to customize it more easily. It works quite similarly to the kanban view, defining `<field>` tags at the top and using these fields in the `<template>` section. The template name used to define the activity cards is `activity-box`. Note that these activity cards are rendered using `KanbanRecord` widget (this has implied that ActivityView inherits from `BasicView`). Also note that the view validation has been moved in base to include the common grammar. Task 1894990
Diffstat (limited to 'addons/mail/validation.py')
-rw-r--r--addons/mail/validation.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/addons/mail/validation.py b/addons/mail/validation.py
deleted file mode 100644
index 743c40f66dc..00000000000
--- a/addons/mail/validation.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-import logging
-import os
-
-from lxml import etree
-
-from odoo.loglevels import ustr
-from odoo.tools import misc, view_validation
-
-_logger = logging.getLogger(__name__)
-
-_activity_validator = None
-@view_validation.validate('activity')
-def schema_activity(arch):
- """ Check the activity view against its schema
-
- :type arch: etree._Element
- """
- global _activity_validator
-
- if _activity_validator is None:
- with misc.file_open(os.path.join('mail', 'views', 'activity.rng')) as f:
- _activity_validator = etree.RelaxNG(etree.parse(f))
-
- if _activity_validator.validate(arch):
- return True
-
- for error in _activity_validator.error_log:
- _logger.error(ustr(error))
- return False