From d2cb81281449f500743dab06257f2ea848b2b3e7 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 23 Jun 2010 17:23:49 +0530 Subject: [PATCH] [IMP] document: add new field company_id in document and directory model bzr revid: hmo@tinyerp.com-20100623115349-ik8webt0myj6l43l --- addons/document/document.py | 2 ++ addons/document/document_directory.py | 2 ++ addons/document/document_view.xml | 9 ++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) 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 712d189a1d2..3d3559e94e9 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 form