diff --git a/addons/document/document.py b/addons/document/document.py index 5d3075f7a4a..aa893b617c3 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -98,6 +98,7 @@ class document_file(osv.osv): ('binary','Binary'), ],'Type', help="Type is used to separate URL and binary File"), + 'company_id': fields.many2one('res.company', 'Company'), } def __get_def_directory(self, cr, uid, context=None): @@ -105,6 +106,7 @@ class document_file(osv.osv): return dirobj._get_root_directory(cr, uid, context) _defaults = { + 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'ir.attachment', context=c), 'user_id': lambda self, cr, uid, ctx:uid, 'file_size': lambda self, cr, uid, ctx:0, 'store_method': lambda *args: 'db', diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 1d0bbf3ed7c..961073ad434 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -60,6 +60,7 @@ class document_directory(osv.osv): 'ressource_tree': fields.boolean('Tree Structure', help="Check this if you want to use the same tree structure as the object selected in the system."), 'dctx_ids': fields.one2many('document.directory.dctx', 'dir_id', 'Context fields'), + 'company_id': fields.many2one('res.company', 'Company'), } @@ -92,6 +93,7 @@ class document_directory(osv.osv): return None _defaults = { + 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'document.directory', context=c), 'user_id': lambda self,cr,uid,ctx: uid, 'domain': lambda self,cr,uid,ctx: '[]', 'type': lambda *args: 'directory', diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index ad56a50d06e..31d3c45f28c 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -85,6 +85,7 @@ + @@ -226,7 +227,8 @@ - + + @@ -291,11 +293,15 @@ help="Filter on my Attachment" /> + + + + @@ -319,6 +325,7 @@ + Documents ir.actions.act_window ir.attachment Document