diff options
| author | Thibault Delavallée <tde@openerp.com> | 2014-01-06 14:57:00 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-01-06 14:57:00 +0100 |
| commit | 49c0b7a82003a889edc19cb189d0d6d0ebda2c5f (patch) | |
| tree | d24c9d3fe3baad3ba06f11d4bf334e2504fb6092 /addons/document | |
| parent | c4c268c902a134efdf0f097053c9b28d6b14417c (diff) | |
| parent | ced63415b7319e12fb9d31a3e370850278f697c1 (diff) | |
[MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140106135700-rt0g44w5xmpbtxiu
Diffstat (limited to 'addons/document')
| -rw-r--r-- | addons/document/document.py | 5 | ||||
| -rw-r--r-- | addons/document/i18n/he.po | 758 | ||||
| -rw-r--r-- | addons/document/report/document_report.py | 2 | ||||
| -rw-r--r-- | addons/document/test/document_test2.yml | 17 |
4 files changed, 779 insertions, 3 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index 5fc62578b1d..eb51ad5ac57 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -32,6 +32,7 @@ import psycopg2 import openerp from openerp import tools +from openerp import SUPERUSER_ID from openerp.osv import fields, osv from openerp.osv.orm import except_orm import openerp.report.interface @@ -322,7 +323,7 @@ class document_directory(osv.osv): ressource_parent_type_id=vals.get('ressource_parent_type_id',False) ressource_id=vals.get('ressource_id',0) if op=='write': - for directory in self.browse(cr, uid, ids): + for directory in self.browse(cr, SUPERUSER_ID, ids): if not name: name=directory.name if not parent_id: @@ -336,7 +337,7 @@ class document_directory(osv.osv): if len(res): return False if op=='create': - res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)]) + res = self.search(cr, SUPERUSER_ID, [('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)]) if len(res): return False return True diff --git a/addons/document/i18n/he.po b/addons/document/i18n/he.po new file mode 100644 index 00000000000..644f64141fd --- /dev/null +++ b/addons/document/i18n/he.po @@ -0,0 +1,758 @@ +# Hebrew translation for openobject-addons +# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-12-21 17:05+0000\n" +"PO-Revision-Date: 2013-12-30 18:49+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Hebrew <he@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-12-31 04:47+0000\n" +"X-Generator: Launchpad (build 16877)\n" + +#. module: document +#: field:document.directory,parent_id:0 +msgid "Parent Directory" +msgstr "" + +#. module: document +#: code:addons/document/document.py:350 +#, python-format +msgid "Directory name contains special characters!" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Search Document Directory" +msgstr "" + +#. module: document +#: help:document.directory,resource_field:0 +msgid "" +"Field to be used as name on resource directories. If empty, the \"name\" " +"will be used." +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Group By..." +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Modification" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Resources" +msgstr "" + +#. module: document +#: field:document.directory,file_ids:0 +#: view:report.document.user:0 +msgid "Files" +msgstr "" + +#. module: document +#: field:document.directory.content.type,mimetype:0 +msgid "Mime Type" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "March" +msgstr "" + +#. module: document +#: field:document.directory.dctx,expr:0 +msgid "Expression" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,company_id:0 +msgid "Company" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_directory_content +msgid "Directory Content" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "My Document(s)" +msgstr "" + +#. module: document +#: model:ir.ui.menu,name:document.menu_document_management_configuration +msgid "Document Management" +msgstr "" + +#. module: document +#: help:document.directory.dctx,expr:0 +msgid "" +"A python expression used to evaluate the field.\n" +"You can use 'dir_id' for current dir, 'res_id', 'res_model' as a reference " +"to the current record, in dynamic folders" +msgstr "" + +#. module: document +#: help:document.directory.dctx,field:0 +msgid "The name of the field." +msgstr "" + +#. module: document +#: code:addons/document/document.py:340 +#: code:addons/document/document.py:345 +#, python-format +msgid "Directory name must be unique!" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Filter on my documents" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +#: field:ir.attachment,index_content:0 +msgid "Indexed Content" +msgstr "" + +#. module: document +#: help:document.directory,resource_find_all:0 +msgid "" +"If true, all attachments that match this resource will be located. If " +"false, only ones that have this as parent." +msgstr "" + +#. module: document +#: view:document.directory:0 +#: model:ir.actions.act_window,name:document.action_document_directory_form +#: model:ir.ui.menu,name:document.menu_document_directories +msgid "Directories" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_report_document_user +msgid "Files details by Users" +msgstr "" + +#. module: document +#: field:document.directory,resource_find_all:0 +msgid "Find all resources" +msgstr "" + +#. module: document +#: selection:document.directory,type:0 +msgid "Folders per resource" +msgstr "" + +#. module: document +#: field:document.directory.content,suffix:0 +msgid "Suffix" +msgstr "" + +#. module: document +#: field:report.document.user,change_date:0 +msgid "Modified Date" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "Knowledge Application Configuration" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +#: field:ir.attachment,partner_id:0 +msgid "Partner" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.act_res_partner_document +#: model:ir.actions.act_window,name:document.zoom_directory +msgid "Related Documents" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,help:document.action_document_file_form +msgid "" +"<p class=\"oe_view_nocontent_create\">\n" +" Click to create a new document. \n" +" </p><p>\n" +" The Documents repository gives you access to all attachments, " +"such\n" +" as mails, project documents, invoices etc.\n" +" </p>\n" +" " +msgstr "" + +#. module: document +#: code:addons/document/document.py:340 +#: code:addons/document/document.py:345 +#: code:addons/document/document.py:350 +#, python-format +msgid "ValidateError" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_ir_actions_report_xml +msgid "ir.actions.report.xml" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_document_file_form +#: model:ir.ui.menu,name:document.menu_document_doc +#: model:ir.ui.menu,name:document.menu_document_files +msgid "Documents" +msgstr "" + +#. module: document +#: field:document.directory,ressource_type_id:0 +msgid "Resource model" +msgstr "" + +#. module: document +#: field:report.document.file,file_size:0 +#: field:report.document.user,file_size:0 +msgid "File Size" +msgstr "" + +#. module: document +#: field:document.directory.content.type,name:0 +#: field:ir.attachment,file_type:0 +msgid "Content Type" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,type:0 +msgid "Type" +msgstr "" + +#. module: document +#: sql_constraint:ir.attachment:0 +msgid "The filename must be unique in a directory !" +msgstr "" + +#. module: document +#: code:addons/document/document.py:110 +#: code:addons/document/document.py:310 +#, python-format +msgid "%s (copy)" +msgstr "" + +#. module: document +#: help:document.directory,ressource_type_id:0 +msgid "" +"Select an object here and there will be one folder per record of that " +"resource." +msgstr "" + +#. module: document +#: help:document.directory,domain:0 +msgid "" +"Use a domain if you want to apply an automatic filter on visible resources." +msgstr "" + +#. module: document +#: constraint:document.directory:0 +msgid "Error! You cannot create recursive directories." +msgstr "" + +#. module: document +#: field:document.directory,resource_field:0 +msgid "Name field" +msgstr "" + +#. module: document +#: field:document.directory,dctx_ids:0 +msgid "Context fields" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:report.document.user,type:0 +msgid "Directory Type" +msgstr "" + +#. module: document +#: field:document.directory.content,report_id:0 +msgid "Report" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "July" +msgstr "" + +#. module: document +#: field:document.directory.content.type,code:0 +msgid "Extension" +msgstr "" + +#. module: document +#: field:document.directory,content_ids:0 +msgid "Virtual Files" +msgstr "" + +#. module: document +#: code:addons/document/document.py:576 +#, python-format +msgid "Error at doc write!" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Generated Files" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "" +"When executing this wizard, it will configure your directories automatically " +"according to modules installed." +msgstr "" + +#. module: document +#: field:document.directory.content,directory_id:0 +#: field:document.directory.dctx,dir_id:0 +#: model:ir.actions.act_window,name:document.action_document_file_directory_form +#: view:ir.attachment:0 +#: field:ir.attachment,parent_id:0 +#: model:ir.model,name:document.model_document_directory +#: field:report.document.user,directory:0 +msgid "Directory" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Security" +msgstr "" + +#. module: document +#: field:document.directory,write_uid:0 +#: field:ir.attachment,write_uid:0 +msgid "Last Modification User" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_files_by_user_graph +#: view:report.document.user:0 +msgid "Files by User" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "on" +msgstr "" + +#. module: document +#: field:document.directory,domain:0 +msgid "Domain" +msgstr "" + +#. module: document +#: field:document.directory,write_date:0 +#: field:ir.attachment,write_date:0 +msgid "Date Modified" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_report_document_file +msgid "Files details by Directory" +msgstr "" + +#. module: document +#: view:report.document.user:0 +msgid "All users files" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_size_month +#: view:report.document.file:0 +msgid "File Size by Month" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "December" +msgstr "" + +#. module: document +#: selection:document.directory,type:0 +msgid "Static Directory" +msgstr "" + +#. module: document +#: field:report.document.file,month:0 +#: field:report.document.user,month:0 +msgid "Month" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Define words in the context, for all child directories and files" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Static" +msgstr "" + +#. module: document +#: field:report.document.user,user:0 +msgid "unknown" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,user_id:0 +#: view:ir.attachment:0 +#: field:ir.attachment,user_id:0 +#: field:report.document.user,user_id:0 +msgid "Owner" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "PDF Report" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Contents" +msgstr "" + +#. module: document +#: field:document.directory,create_date:0 +#: field:report.document.user,create_date:0 +msgid "Date Created" +msgstr "" + +#. module: document +#: help:document.directory.content,include_name:0 +msgid "" +"Check this field if you want that the name of the file to contain the record " +"name.\n" +"If set, the directory will have to be a resource one." +msgstr "" + +#. module: document +#: view:document.configuration:0 +#: model:ir.actions.act_window,name:document.action_config_auto_directory +msgid "Configure Directories" +msgstr "" + +#. module: document +#: field:document.directory.content,include_name:0 +msgid "Include Record Name" +msgstr "" + +#. module: document +#: field:ir.actions.report.xml,model_id:0 +msgid "Model Id" +msgstr "" + +#. module: document +#: help:document.directory,ressource_tree:0 +msgid "" +"Check this if you want to use the same tree structure as the object selected " +"in the system." +msgstr "" + +#. module: document +#: help:document.directory,ressource_id:0 +msgid "" +"Along with Parent Model, this ID attaches this folder to a specific record " +"of Parent Model." +msgstr "" + +#. module: document +#. openerp-web +#: code:addons/document/static/src/js/document.js:6 +#, python-format +msgid "Attachment(s)" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "August" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Dynamic context" +msgstr "" + +#. module: document +#: sql_constraint:document.directory:0 +msgid "Directory cannot be parent of itself!" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "June" +msgstr "" + +#. module: document +#: field:document.directory,group_ids:0 +msgid "Groups" +msgstr "" + +#. module: document +#: field:document.directory.content.type,active:0 +msgid "Active" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "November" +msgstr "" + +#. module: document +#: help:document.directory,ressource_parent_type_id:0 +msgid "" +"If you put an object here, this directory template will appear bellow all of " +"these objects. Such directories are \"attached\" to the specific model or " +"record, just like attachments. Don't put a parent directory if you select a " +"parent model." +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Definition" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "October" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Seq." +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_all_document_tree1 +msgid "All Users files" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "January" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Document Directory" +msgstr "" + +#. module: document +#: sql_constraint:document.directory:0 +msgid "The directory name must be unique !" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Attachments" +msgstr "" + +#. module: document +#: field:document.directory,create_uid:0 +msgid "Creator" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "" +"OpenERP's Document Management System supports mapping virtual folders with " +"documents. The virtual folder of a document can be used to manage the files " +"attached to the document, or to print and download any report. This tool " +"will create directories automatically according to modules installed." +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_files_by_month_graph +#: view:report.document.user:0 +msgid "Files by Month" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "September" +msgstr "" + +#. module: document +#: field:document.directory.content,prefix:0 +msgid "Prefix" +msgstr "" + +#. module: document +#: field:document.directory,child_ids:0 +msgid "Children" +msgstr "" + +#. module: document +#: field:document.directory,ressource_id:0 +msgid "Resource ID" +msgstr "" + +#. module: document +#: field:document.directory.dctx,field:0 +msgid "Field" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_directory_dctx +msgid "Directory Dynamic Context" +msgstr "" + +#. module: document +#: field:document.directory,ressource_parent_type_id:0 +msgid "Parent Model" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "" +"These groups, however, do NOT apply to children directories, which must " +"define their own groups." +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "May" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "For each entry here, virtual files will appear in this folder." +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_ir_attachment +msgid "ir.attachment" +msgstr "" + +#. module: document +#: view:report.document.user:0 +msgid "Users File" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_configuration +msgid "Directory Configuration" +msgstr "" + +#. module: document +#: help:document.directory,type:0 +msgid "" +"Each directory can either have the type Static or be linked to another " +"resource. A static directory, as with Operating Systems, is the classic " +"directory that can contain a set of files. The directories linked to systems " +"resources automatically possess sub-directories for each of resource types " +"defined in the parent directory." +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "February" +msgstr "" + +#. module: document +#: field:document.directory,name:0 +msgid "Name" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Fields" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +msgid "April" +msgstr "" + +#. module: document +#: field:report.document.file,nbr:0 +#: field:report.document.user,nbr:0 +msgid "# of Files" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_directory_content_type +msgid "Directory Content Type" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "" +"Only members of these groups will have access to this directory and its " +"files." +msgstr "" + +#. module: document +#. openerp-web +#: code:addons/document/static/src/js/document.js:17 +#, python-format +msgid "%s (%s)" +msgstr "" + +#. module: document +#: field:document.directory.content,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: document +#: field:document.directory.content,name:0 +msgid "Content Name" +msgstr "" + +#. module: document +#: field:report.document.user,datas_fname:0 +msgid "File Name" +msgstr "" + +#. module: document +#: field:document.directory,ressource_tree:0 +msgid "Tree Structure" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "res_config_contents" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_document_directory_tree +#: model:ir.ui.menu,name:document.menu_document_directories_tree +msgid "Directories' Structure" +msgstr "" + +#. module: document +#: field:report.document.user,name:0 +msgid "Year" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_storage +msgid "Storage Media" +msgstr "" + +#. module: document +#: field:document.directory.content,extension:0 +msgid "Document Type" +msgstr "" diff --git a/addons/document/report/document_report.py b/addons/document/report/document_report.py index c9df78e4272..a4133f46387 100644 --- a/addons/document/report/document_report.py +++ b/addons/document/report/document_report.py @@ -31,7 +31,7 @@ class report_document_user(osv.osv): 'name': fields.char('Year', size=64,readonly=True), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), - 'user_id':fields.integer('Owner', readonly=True), + 'user_id': fields.many2one('res.users', 'Owner', readonly=True), 'user': fields.related('user_id', 'name', type='char', size=64, readonly=True), 'directory': fields.char('Directory',size=64,readonly=True), 'datas_fname': fields.char('File Name',size=64,readonly=True), diff --git a/addons/document/test/document_test2.yml b/addons/document/test/document_test2.yml index beff61d4d0f..0c6345ef6c4 100644 --- a/addons/document/test/document_test2.yml +++ b/addons/document/test/document_test2.yml @@ -59,6 +59,23 @@ ids = self.search(cr, uid, [('res_model', '=', 'res.country'), ('res_id', '=', ref("base.za"))]) assert ids == [ ref("attach_3rd")], ids - + I test that I can't create duplicate directories (even when duplicates are hidden by a record rule) +- + !python {model: document.directory}: | + duplicate_detected = False + from openerp.osv.osv import except_osv + try: + demo_uid = ref('base.user_demo') + dir_vals = { + 'name': 'Testing (will be deleted!)', + 'parent_id': ref('document.dir_root') + } + new_dir_id = self.create(cr, demo_uid, dir_vals, context=None) + self.unlink(cr, uid, [new_dir_id], context=None) + except except_osv, e: + duplicate_detected = e.value == u'Directory name must be unique!' + assert duplicate_detected is True, 'Failed to detect duplicate directory' +- I delete the attachments - !python {model: ir.attachment}: | |
