_symbol_f = _symbol_set
_symbol_set = (_symbol_c, _symbol_f)
_symbol_get = None
-
# used to hide a certain field type in the list of field types
_deprecated = False
+ # used for automatic logging system if mail installed (should be 'on_change' or 'always')
+ _track_visibility = False
- def __init__(self, string='unknown', required=False, readonly=False, domain=None, context=None, states=None, priority=0, change_default=False, size=None, ondelete=None, translate=False, select=False, manual=False, tracked=False, **args):
+ def __init__(self, string='unknown', required=False, readonly=False, domain=None, context=None, states=None, priority=0, change_default=False, size=None, ondelete=None, translate=False, select=False, manual=False, track_visibility=False, **args):
"""
The 'manual' keyword argument specifies if the field is a custom one.
self.help = args.get('help', '')
self.priority = priority
self.change_default = change_default
- self.ondelete = ondelete.lower() if ondelete else None # defaults to 'set null' in ORM
+ self.ondelete = ondelete.lower() if ondelete else None # defaults to 'set null' in ORM
self.translate = translate
self._domain = domain
self._context = context
self.select = select
self.manual = manual
self.selectable = True
- self.tracked = tracked # Automatic logging system if mail installed
+ self._track_visibility = track_visibility
self.group_operator = args.get('group_operator', False)
self.groups = False # CSV list of ext IDs of groups that can access this field
- self.deprecated = False # Optional deprecation warning
+ self.deprecated = False # Optional deprecation warning
for a in args:
if args[a]:
setattr(self, a, args[a])
-
+
def restart(self):
pass
_description = None
_needaction = False
+ # Automatic logging system if mail installed
+ # _track = {
+ # 'field': {
+ # 'module.subtype_xml': lambda self, cr, uid, obj, context=None: obj.state == done,
+ # 'module.subtype_xml2': lambda self, cr, uid, obj, context=None: obj.state != done,
+ # },
+ # 'field2': {
+ # ...
+ # },
+ # }
+ # where
+ # :param string field: field name
+ # :param module.subtype_xml: xml_id of a mail.message.subtype (i.e. mail.mt_comment)
+ # :param obj: is a browse_record
+ # :param function lambda: returns whether the tracking should record using this subtype
+ _track = {}
+
# dict of {field:method}, with method returning the (name_get of records, {id: fold})
# to include in the _read_group, if grouped on this field
_group_by_full = {}