From e848ed0cf4133f3c0827e81d13527dd1dbfa07e6 Mon Sep 17 00:00:00 2001 From: "ron@tinyerp.com" <> Date: Tue, 12 Oct 2010 11:56:08 +0530 Subject: [PATCH] [IMP] ::Documents->Shared Repository:enlarge the FTP server field,Documents-> descending by date and tooltip change and fix bug on my document filter button::Reporting->Document Dashboard->group by year/Month and default user_id context remove bzr revid: ron@tinyerp.com-20101012062608-nvlyu9qag6zeyh5h --- addons/document/board_document_view.xml | 6 ++-- addons/document/document.py | 7 ++-- addons/document/document_directory.py | 20 ++++++------ addons/document/document_view.xml | 6 ++-- addons/document/report/document_report.py | 8 +++-- .../document/report/document_report_view.xml | 32 +++++++------------ .../document_ftp/test/document_ftp_test2.yml | 2 +- .../document_ftp/wizard/ftp_browse_view.xml | 2 +- .../document_ftp/wizard/ftp_configuration.py | 2 +- addons/hr_timesheet/hr_timesheet_view.xml | 1 + addons/project/report/project_report.py | 2 +- 11 files changed, 41 insertions(+), 47 deletions(-) diff --git a/addons/document/board_document_view.xml b/addons/document/board_document_view.xml index 2bfc5a6f200..7ba8c498271 100644 --- a/addons/document/board_document_view.xml +++ b/addons/document/board_document_view.xml @@ -16,9 +16,7 @@ - + view_mode="tree,form"/> + /> ). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -44,13 +44,13 @@ class document_directory(osv.osv): 'child_ids': fields.one2many('document.directory', 'parent_id', 'Children'), 'file_ids': fields.one2many('ir.attachment', 'parent_id', 'Files'), 'content_ids': fields.one2many('document.directory.content', 'directory_id', 'Virtual Files'), - 'type': fields.selection([ + 'type': fields.selection([ ('directory','Static Directory'), ('ressource','Folders per resource'), ], 'Type', required=True, select=1, help="Defines directory's behaviour."), - + '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.'), @@ -95,13 +95,13 @@ class document_directory(osv.osv): return objid.browse(cr, uid, mid, context=context).res_id except Exception: 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', - 'ressource_id': lambda *a: 0, + 'ressource_id': lambda *a: 0, 'storage_id': _get_def_storage, 'resource_find_all': True, } @@ -151,7 +151,7 @@ class document_directory(osv.osv): _constraints = [ (_check_recursion, 'Error! You can not create recursive Directories.', ['parent_id']) ] - + def __init__(self, *args, **kwargs): super(document_directory, self).__init__(*args, **kwargs) @@ -172,7 +172,7 @@ class document_directory(osv.osv): """ if not context: context = {} - + return nodes.get_node_context(cr, uid, context).get_uri(cr, uri) def get_dir_permissions(self, cr, uid, ids ): @@ -180,7 +180,7 @@ class document_directory(osv.osv): """ assert len(ids) == 1 id = ids[0] - + cr.execute( "SELECT count(dg.item_id) AS needs, count(ug.uid) AS has " \ " FROM document_directory_group_rel dg " \ " LEFT OUTER JOIN res_groups_users_rel ug " \ @@ -197,7 +197,7 @@ class document_directory(osv.osv): Return a tuple (node_dir, remaining_path) """ return (nodes.node_database(context=ncontext), uri) - + def copy(self, cr, uid, id, default=None, context=None): if not default: default ={} diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 13e4cff02d4..aa4d94382ee 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -291,7 +291,7 @@ @@ -333,7 +333,7 @@ ir.attachment form - Documents give your access to all attached documents; it's a repository of all attached documents (mails, documents attached to a project, etc.) + The Documents repository gives you access to all attachments, such as mails, project documents, invoices etc. - '') inner join res_users u on (f.user_id=u.id) - group by to_char(f.create_date, 'YYYY'), to_char(f.create_date, 'MM'),d.name,f.parent_id,d.type,f.create_date,f.user_id,f.file_size,u.name,d.type,f.write_date + group by to_char(f.create_date, 'YYYY'), to_char(f.create_date, 'MM'),d.name,f.parent_id,d.type,f.create_date,f.user_id,f.file_size,u.name,d.type,f.write_date,f.datas_fname ) """) report_document_user() + + class report_files_partner(osv.osv): _name = "report.files.partner" _description = "Files details by Partners" @@ -86,7 +90,7 @@ class report_files_partner(osv.osv): to_char(date_trunc('month', f.create_date),'MM') AS month, SUM(f.file_size) AS file_size, p.name AS partner - + FROM ir_attachment f LEFT JOIN res_partner p ON (f.partner_id=p.id) WHERE f.datas_fname IS NOT NULL diff --git a/addons/document/report/document_report_view.xml b/addons/document/report/document_report_view.xml index d0ba1303a39..b9a1652388c 100644 --- a/addons/document/report/document_report_view.xml +++ b/addons/document/report/document_report_view.xml @@ -10,6 +10,7 @@ + @@ -25,10 +26,11 @@ - - - - + + + + + @@ -60,8 +62,8 @@ All Users files report.document.user form - tree - {'search_default_user': 'user_id'} + tree,form + {'group_by': ['name','month']} @@ -112,30 +114,18 @@ - - - - - - - - - - - - Files by Resource Type report.document.user - + form - tree + graph,tree @@ -150,7 +140,7 @@ - + report.document.user.tree diff --git a/addons/document_ftp/test/document_ftp_test2.yml b/addons/document_ftp/test/document_ftp_test2.yml index 32434962ba2..53d5a2b78bf 100644 --- a/addons/document_ftp/test/document_ftp_test2.yml +++ b/addons/document_ftp/test/document_ftp_test2.yml @@ -196,7 +196,7 @@ !python {model: ir.attachment}: | from document_ftp import test_easyftp as te ftp = te.get_ftp_folder(cr, uid, self, 'Documents') - ftp.mkd("Test-Folder2") + ftp.mkd("Test-Folder3") # TODO move - I remove the 'Test-Folder3' diff --git a/addons/document_ftp/wizard/ftp_browse_view.xml b/addons/document_ftp/wizard/ftp_browse_view.xml index 7a52c1fd291..90182b70e0d 100644 --- a/addons/document_ftp/wizard/ftp_browse_view.xml +++ b/addons/document_ftp/wizard/ftp_browse_view.xml @@ -8,7 +8,7 @@
- +