summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index e2fa2cecd1e..b5d0080d816 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -38,7 +38,6 @@ class document_file(osv.osv):
_inherit = 'ir.attachment'
_rec_name = 'name'
-
def _attach_parent_id(self, cr, uid, ids=None, context=None):
"""Migrate ir.attachments to the document module.
@@ -149,7 +148,14 @@ class document_file(osv.osv):
_sql_constraints = [
# filename_uniq is not possible in pure SQL
]
- def _check_duplication(self, cr, uid, vals, ids=None, op='create'):
+
+ 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_duplication(self, cr, uid, vals, ids=[], op='create'):
name = vals.get('name', False)
parent_id = vals.get('parent_id', False)
res_model = vals.get('res_model', False)