[MERGE] Merge with trunk-cal-jke

Add options allowed to be used in calendar's view.
 > Some needs to be checked by orm to know if the field is well a valid parameter and well passing
 > Some needs only to be checked at launch (only added RNG)
Imp to not send email from demo data. (Before, we only exclude the mail from test data)
 > don't send mail to admin@example.com or demo@example.com
 > Done with ODO

bzr revid: jke@openerp.com-20140114160141-g34stpdxdg3qepim
This commit is contained in:
jke-openerp 2014-01-14 17:01:41 +01:00
commit 204b279a89
4 changed files with 26 additions and 12 deletions

View File

@ -411,6 +411,7 @@ class ir_mail_server(osv.osv):
email_to = message['To'] email_to = message['To']
email_cc = message['Cc'] email_cc = message['Cc']
email_bcc = message['Bcc'] email_bcc = message['Bcc']
smtp_to_list = filter(None, tools.flatten(map(extract_rfc2822_addresses,[email_to, email_cc, email_bcc]))) smtp_to_list = filter(None, tools.flatten(map(extract_rfc2822_addresses,[email_to, email_cc, email_bcc])))
assert smtp_to_list, "At least one valid recipient address should be specified for outgoing emails (To/Cc/Bcc)" assert smtp_to_list, "At least one valid recipient address should be specified for outgoing emails (To/Cc/Bcc)"

View File

@ -647,6 +647,15 @@
<rng:optional><rng:attribute name="date_stop" /></rng:optional> <rng:optional><rng:attribute name="date_stop" /></rng:optional>
<rng:optional><rng:attribute name="day_length" /></rng:optional> <rng:optional><rng:attribute name="day_length" /></rng:optional>
<rng:optional><rng:attribute name="date_delay" /></rng:optional> <rng:optional><rng:attribute name="date_delay" /></rng:optional>
<rng:optional><rng:attribute name="all_day" /></rng:optional>
<rng:optional><rng:attribute name="event_open_popup" /></rng:optional>
<rng:optional><rng:attribute name="attendee" /></rng:optional>
<rng:optional><rng:attribute name="color_is_attendee" /></rng:optional>
<rng:optional><rng:attribute name="avatar_model" /></rng:optional>
<rng:optional><rng:attribute name="avatar_title" /></rng:optional>
<rng:optional><rng:attribute name="use_contacts" /></rng:optional>
<rng:optional><rng:attribute name="quick_add" /></rng:optional>
<rng:optional><rng:attribute name="display" /></rng:optional>
<rng:optional><rng:attribute name="type" /></rng:optional> <rng:optional><rng:attribute name="type" /></rng:optional>
<rng:optional><rng:attribute name="mode" /></rng:optional> <rng:optional><rng:attribute name="mode" /></rng:optional>
<rng:oneOrMore> <rng:oneOrMore>

View File

@ -59,7 +59,6 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
def load_test(module_name, idref, mode): def load_test(module_name, idref, mode):
cr.commit() cr.commit()
try: try:
threading.currentThread().testing = True
_load_data(cr, module_name, idref, mode, 'test') _load_data(cr, module_name, idref, mode, 'test')
return True return True
except Exception: except Exception:
@ -67,7 +66,6 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
'module %s: an exception occurred in a test', module_name) 'module %s: an exception occurred in a test', module_name)
return False return False
finally: finally:
threading.currentThread().testing = False
if tools.config.options['test_commit']: if tools.config.options['test_commit']:
cr.commit() cr.commit()
else: else:
@ -104,12 +102,18 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
init mode. init mode.
""" """
for filename in _get_files_of_kind(kind): try:
_logger.info("module %s: loading %s", module_name, filename) if kind in ('demo', 'test'):
noupdate = False threading.currentThread().testing = True
if kind in ('demo', 'demo_xml') or (filename.endswith('.csv') and kind in ('init', 'init_xml')): for filename in _get_files_of_kind(kind):
noupdate = True _logger.info("module %s: loading %s", module_name, filename)
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report) noupdate = False
if kind in ('demo', 'demo_xml') or (filename.endswith('.csv') and kind in ('init', 'init_xml')):
noupdate = True
tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
finally:
if kind in ('demo', 'test'):
threading.currentThread().testing = False
if status is None: if status is None:
status = {} status = {}

View File

@ -1009,7 +1009,7 @@ class BaseModel(object):
continue continue
sm = f.store sm = f.store
if sm is True: if sm is True:
sm = {self._name: (lambda self, cr, uid, ids, c={}: ids, None, 10, None)} sm = {self._name: (lambda self, cr, uid, ids, c={}: ids, None, f.priority, None)}
for object, aa in sm.items(): for object, aa in sm.items():
if len(aa) == 4: if len(aa) == 4:
(fnct, fields2, order, length) = aa (fnct, fields2, order, length) = aa
@ -1785,7 +1785,7 @@ class BaseModel(object):
children = False children = False
views = {} views = {}
for f in node: for f in node:
if f.tag in ('form', 'tree', 'graph', 'kanban'): if f.tag in ('form', 'tree', 'graph', 'kanban', 'calendar'):
node.remove(f) node.remove(f)
ctx = context.copy() ctx = context.copy()
ctx['base_model_name'] = self._name ctx['base_model_name'] = self._name
@ -1829,7 +1829,7 @@ class BaseModel(object):
in_tree_view = node.tag == 'tree' in_tree_view = node.tag == 'tree'
elif node.tag == 'calendar': elif node.tag == 'calendar':
for additional_field in ('date_start', 'date_delay', 'date_stop', 'color'): for additional_field in ('date_start', 'date_delay', 'date_stop', 'color', 'all_day','attendee'):
if node.get(additional_field): if node.get(additional_field):
fields[node.get(additional_field)] = {} fields[node.get(additional_field)] = {}
@ -2023,7 +2023,7 @@ class BaseModel(object):
return False return False
view = etree.Element('calendar', string=self._description) view = etree.Element('calendar', string=self._description)
etree.SubElement(view, 'field', self._rec_name_fallback(cr, user, context)) etree.SubElement(view, 'field', name=self._rec_name_fallback(cr, user, context))
if self._date_name not in self._columns: if self._date_name not in self._columns:
date_found = False date_found = False