diff options
| author | P. Christeas <p_christ@hol.gr> | 2010-07-13 13:29:58 +0300 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2010-07-13 13:29:58 +0300 |
| commit | 2d3d861a3e4317a71fb58307ac9d8a2866c6999c (patch) | |
| tree | 9882431388772815dd94afb4470b0d93eded8f2b /addons/document/document_directory.py | |
| parent | 403a71fbaab7a8b607934347ccf6e7309f875f1a (diff) | |
Document directory: "find_all" field for resource dirs.
A (mis-)feature of the previous code was that in resource directories, it
would only list attachments that would have those dirs as parents. This
means that we couldn't have another categorisation, that would yield some
of the same attachments.
bzr revid: p_christ@hol.gr-20100713102958-nk40nckc41uxyzri
Diffstat (limited to 'addons/document/document_directory.py')
| -rw-r--r-- | addons/document/document_directory.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 0685f5c08ff..f5b9202fc8e 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -57,6 +57,9 @@ class document_directory(osv.osv): 'ressource_type_id': fields.many2one('ir.model', 'Resource model', help="Select an object here and there will be one folder per record of that resource."), 'resource_field': fields.many2one('ir.model.fields', 'Name field', help='Field to be used as name on resource directories. If empty, the "name" will be used.'), + 'resource_find_all': fields.boolean('Find all resources', required=True, + help="If true, all attachments that match this resource will " \ + " be located. If false, only ones that have this as parent." ), 'ressource_parent_type_id': fields.many2one('ir.model', 'Parent Model', help="If you put an object here, this directory template will appear bellow all of these objects. " \ "Don't put a parent directory if you select a parent model."), @@ -103,6 +106,7 @@ class document_directory(osv.osv): 'type': lambda *args: 'directory', 'ressource_id': lambda *a: 0, 'storage_id': _get_def_storage, + 'resource_find_all': True, } _sql_constraints = [ ('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !'), |
