diff options
| author | rpa (Open ERP) <rpa@tinyerp.com> | 2010-12-16 11:23:48 +0530 |
|---|---|---|
| committer | rpa (Open ERP) <rpa@tinyerp.com> | 2010-12-16 11:23:48 +0530 |
| commit | 7d5e28fbb8d49b8a2825bfdd525938d99574e234 (patch) | |
| tree | c1e90a7757ef2b3fee2190a44a4f7d448707d23b /addons/document | |
| parent | 953a15d2a7391370414462402198780b06d45243 (diff) | |
| parent | 4e307d022c8fbdba848b8a4f57d668a4b6bd036f (diff) | |
[MERGE]: Merge with lp:~openerp-dev/openobject-addons/trunk-dev-addons2
bzr revid: rpa@tinyerp.com-20101216055348-7yrvv48hjq15grv9
Diffstat (limited to 'addons/document')
| -rw-r--r-- | addons/document/directory_content.py | 4 | ||||
| -rw-r--r-- | addons/document/directory_report.py | 4 | ||||
| -rw-r--r-- | addons/document/document.py | 12 | ||||
| -rw-r--r-- | addons/document/document_directory.py | 10 | ||||
| -rw-r--r-- | addons/document/document_storage.py | 10 | ||||
| -rw-r--r-- | addons/document/i18n/document.pot | 23 | ||||
| -rw-r--r-- | addons/document/wizard/document_configuration.py | 2 |
7 files changed, 38 insertions, 27 deletions
diff --git a/addons/document/directory_content.py b/addons/document/directory_content.py index 685df7910f3..e690e50d4b4 100644 --- a/addons/document/directory_content.py +++ b/addons/document/directory_content.py @@ -44,7 +44,7 @@ class document_directory_content(osv.osv): _name = 'document.directory.content' _description = 'Directory Content' _order = "sequence" - def _extension_get(self, cr, uid, context={}): + def _extension_get(self, cr, uid, context=None): cr.execute('select code,name from document_directory_content_type where active') res = cr.fetchall() return res @@ -112,7 +112,7 @@ class document_directory_content(osv.osv): def process_read(self, cr, uid, node, context=None): if node.extension != '.pdf': raise Exception("Invalid content: %s" % node.extension) - report = self.pool.get('ir.actions.report.xml').browse(cr, uid, node.report_id) + report = self.pool.get('ir.actions.report.xml').browse(cr, uid, node.report_id, context=context) srv = netsvc.Service._services['report.'+report.report_name] ctx = node.context.context.copy() ctx.update(node.dctx) diff --git a/addons/document/directory_report.py b/addons/document/directory_report.py index 88a95a1705b..6eb18dae850 100644 --- a/addons/document/directory_report.py +++ b/addons/document/directory_report.py @@ -26,7 +26,7 @@ class ir_action_report_xml(osv.osv): _name="ir.actions.report.xml" _inherit ="ir.actions.report.xml" - def _model_get(self, cr, uid, ids, name, arg, context): + def _model_get(self, cr, uid, ids, name, arg, context=None): res = {} model_pool = self.pool.get('ir.model') for data in self.read(cr, uid, ids, ['model']): @@ -39,7 +39,7 @@ class ir_action_report_xml(osv.osv): res[data.get('id')] = False return res - def _model_search(self, cr, uid, obj, name, args, context={}): + def _model_search(self, cr, uid, obj, name, args, context=None): if not len(args): return [] model_id= args[0][2] diff --git a/addons/document/document.py b/addons/document/document.py index e3d810668b4..7e575f38a37 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -38,7 +38,9 @@ class document_file(osv.osv): def _get_filestore(self, cr): return os.path.join(DMS_ROOT_PATH, cr.dbname) - def _data_get(self, cr, uid, ids, name, arg, context): + def _data_get(self, cr, uid, ids, name, arg, context=None): + if context is None: + context = {} fbrl = self.browse(cr, uid, ids, context=context) nctx = nodes.get_node_context(cr, uid, context={}) # nctx will /not/ inherit the caller's context. Most of @@ -59,7 +61,7 @@ class document_file(osv.osv): # # This code can be improved # - def _data_set(self, cr, uid, id, name, value, arg, context): + def _data_set(self, cr, uid, id, name, value, arg, context=None): if not value: return True fbro = self.browse(cr, uid, id, context=context) @@ -139,7 +141,7 @@ class document_file(osv.osv): if 'name' not in default: name = self.read(cr, uid, [id])[0]['name'] default.update({'name': name + " (copy)"}) - return super(document_file, self).copy(cr, uid, id, default, context) + return super(document_file, self).copy(cr, uid, id, default, context=context) def write(self, cr, uid, ids, vals, context=None): result = False @@ -222,7 +224,7 @@ class document_file(osv.osv): cr.commit() # ? return result - def __get_partner_id(self, cr, uid, res_model, res_id, context): + def __get_partner_id(self, cr, uid, res_model, res_id, context=None): """ A helper to retrieve the associated partner from any res_model+id It is a hack that will try to discover if the mentioned record is clearly associated with a partner record. @@ -246,7 +248,7 @@ class document_file(osv.osv): # rolled back) and then unlink the files. The list wouldn't exist # after we discard the objects ids = self.search(cr, uid, [('id','in',ids)]) - for f in self.browse(cr, uid, ids, context): + for f in self.browse(cr, uid, ids, context=context): # TODO: update the node cache par = f.parent_id storage_id = None diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 9412527db22..2a3f54f53ba 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -143,7 +143,7 @@ class document_directory(osv.osv): _parent(dir_id, path) return path - def _check_recursion(self, cr, uid, ids): + def _check_recursion(self, cr, uid, ids, context=None): level = 100 while len(ids): cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')') @@ -175,8 +175,6 @@ class document_directory(osv.osv): """ Return a node object for the given uri. This fn merely passes the call to node_context """ - if not context: - context = {} return nodes.get_node_context(cr, uid, context).get_uri(cr, uri) @@ -198,7 +196,7 @@ class document_directory(osv.osv): else: raise ValueError("dir node for %s type", dbro.type) - def _prepare_context(self, cr, uid, nctx, context): + def _prepare_context(self, cr, uid, nctx, context=None): """ Fill nctx with properties for this database @param nctx instance of nodes.node_context, to be filled @param context ORM context (dict) for us @@ -212,7 +210,7 @@ class document_directory(osv.osv): """ return - def get_dir_permissions(self, cr, uid, ids, context=None ): + def get_dir_permissions(self, cr, uid, ids, context=None): """Check what permission user 'uid' has on directory 'id' """ assert len(ids) == 1 @@ -237,7 +235,7 @@ class document_directory(osv.osv): default ={} name = self.read(cr, uid, [id])[0]['name'] default.update({'name': name+ " (copy)"}) - return super(document_directory,self).copy(cr, uid, id, default, context) + return super(document_directory,self).copy(cr, uid, id, default, context=context) def _check_duplication(self, cr, uid, vals, ids=[], op='create'): name=vals.get('name',False) diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py index aa2edb6b411..b61b7fd65fc 100644 --- a/addons/document/document_storage.py +++ b/addons/document/document_storage.py @@ -422,9 +422,7 @@ class document_storage(osv.osv): optionally, fil_obj could point to the browse object of the file (ir.attachment) """ - if not context: - context = {} - boo = self.browse(cr, uid, id, context) + boo = self.browse(cr, uid, id, context=context) if not boo.online: raise IOError(errno.EREMOTE, 'medium offline') @@ -439,7 +437,7 @@ class document_storage(osv.osv): """ if context is None: context = {} - boo = self.browse(cr, uid, id, context) + boo = self.browse(cr, uid, id, context=context) if not boo.online: raise IOError(errno.EREMOTE, 'medium offline') @@ -540,9 +538,7 @@ class document_storage(osv.osv): This function MUST be used from an ir.attachment. It wouldn't make sense to store things persistently for other types (dynamic). """ - if not context: - context = {} - boo = self.browse(cr, uid, id, context) + boo = self.browse(cr, uid, id, context=context) if fil_obj: ira = fil_obj else: diff --git a/addons/document/i18n/document.pot b/addons/document/i18n/document.pot index 06b565da5d4..b6930af2047 100644 --- a/addons/document/i18n/document.pot +++ b/addons/document/i18n/document.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 6.0.0-rc1\n" "Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2010-12-03 15:43:29+0000\n" -"PO-Revision-Date: 2010-12-03 15:43:29+0000\n" +"POT-Creation-Date: 2010-12-15 15:05:16+0000\n" +"PO-Revision-Date: 2010-12-15 15:05:16+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -203,6 +203,11 @@ 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 #: field:report.files.partner,partner:0 @@ -251,8 +256,8 @@ msgid "Storage" msgstr "" #. module: document -#: field:document.directory,ressource_type_id:0 -msgid "Resource model" +#: view:document.configuration:0 +msgid "Configure Resource Directory" msgstr "" #. module: document @@ -303,6 +308,11 @@ msgid "Stored Filename" msgstr "" #. module: document +#: field:document.directory,ressource_type_id:0 +msgid "Resource model" +msgstr "" + +#. module: document #: view:document.directory:0 #: field:report.document.user,type:0 msgid "Directory Type" @@ -630,6 +640,11 @@ msgid "Integrated Document Management System" msgstr "" #. module: document +#: view:document.configuration:0 +msgid "Choose the following Resouces to auto directory configuration." +msgstr "" + +#. module: document #: view:ir.attachment:0 msgid "Attached To" msgstr "" diff --git a/addons/document/wizard/document_configuration.py b/addons/document/wizard/document_configuration.py index a497eb6af90..26ce8652599 100644 --- a/addons/document/wizard/document_configuration.py +++ b/addons/document/wizard/document_configuration.py @@ -34,7 +34,7 @@ class document_configuration(osv.osv_memory): def execute(self, cr, uid, ids, context=None): conf_id = ids and ids[0] or False - conf = self.browse(cr, uid, conf_id, context) + conf = self.browse(cr, uid, conf_id, context=context) dir_pool = self.pool.get('document.directory') data_pool = self.pool.get('ir.model.data') model_pool = self.pool.get('ir.model') |
