diff options
| author | Christophe Matthieu <chm@openerp.com> | 2012-10-17 09:31:46 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2012-10-17 09:31:46 +0200 |
| commit | 23e20e95d41d5435cf3e5bfd136a6f52efa8a80f (patch) | |
| tree | 1969e768754adbcb6976a8b32c3eb5d35e778ac4 /addons/document/document.py | |
| parent | e8bd522f6be7fdeb1b7c916838193d7516833121 (diff) | |
| parent | 8a38ee944e02d6cd6cb18b87b962b67e510906a9 (diff) | |
[MERGE] from trunk
bzr revid: chm@openerp.com-20121017073146-9m5s2hffeekmj068
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index b94222fa11c..37a0219d143 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -36,8 +36,7 @@ DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['roo class document_file(osv.osv): _inherit = 'ir.attachment' - _rec_name = 'datas_fname' - + _rec_name = 'name' def _attach_parent_id(self, cr, uid, ids=None, context=None): """Migrate ir.attachments to the document module. @@ -149,6 +148,13 @@ class document_file(osv.osv): _sql_constraints = [ # filename_uniq is not possible in pure SQL ] + + def onchange_file(self, cr, uid, ids, datas_fname=False, context=None): + res = {'value':{}} + if datas_fname: + res['value'].update({'name': datas_fname}) + return res + def check(self, cr, uid, ids, mode, context=None, values=None): """Check access wrt. res_model, relax the rule of ir.attachment parent |
