From b3c7cc90350353b85f7defe12f6e1aafbfbed851 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Wed, 26 May 2010 19:07:20 +0530 Subject: [IMP]: document: Improvement for view and add group by ,filter bzr revid: ksa@tinyerp.co.in-20100526133720-bito6krfl60a6zud --- addons/document/document.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 2b2ac2f7587..be9087f246c 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -91,8 +91,14 @@ class document_file(osv.osv): 'store_fname': fields.char('Stored Filename', size=200), 'res_model': fields.char('Attached Model', size=64), #res_model 'res_id': fields.integer('Attached ID'), #res_id + # 'res_name': fields.function(_name_get_resname, type='char', string='Resource Name', method=True), 'partner_id':fields.many2one('res.partner', 'Partner', select=1), 'title': fields.char('Resource Title', size=64), + 'type':fields.selection([ + ('url','URL'), + ('binary','Binary'), + + ],'Type', help="Type is used to separate URL and binary File"), } def __get_def_directory(self, cr, uid, context=None): -- cgit v1.2.3 From 51770be47b3073a8917bbc9b853d95d18431db2e Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Thu, 27 May 2010 16:44:23 +0530 Subject: [IMP]: document: [task-786] Review ir_attachment object,apply changes in base/ir and document module bzr revid: ksa@tinyerp.co.in-20100527111423-m2b3wrx02jcuxvy9 --- addons/document/document.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index be9087f246c..39f4efffdba 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -88,12 +88,11 @@ class document_file(osv.osv): 'create_uid': fields.many2one('res.users', 'Creator', readonly=True), 'store_method': fields.selection([('db', 'Database'), ('fs', 'Filesystem'), ('link', 'Link')], "Storing Method"), 'datas': fields.function(_data_get, method=True, fnct_inv=_data_set, string='File Content', type="binary", nodrop=True), + 'url': fields.char('File URL',size=64), 'store_fname': fields.char('Stored Filename', size=200), 'res_model': fields.char('Attached Model', size=64), #res_model 'res_id': fields.integer('Attached ID'), #res_id - # 'res_name': fields.function(_name_get_resname, type='char', string='Resource Name', method=True), 'partner_id':fields.many2one('res.partner', 'Partner', select=1), - 'title': fields.char('Resource Title', size=64), 'type':fields.selection([ ('url','URL'), ('binary','Binary'), @@ -161,7 +160,6 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context=None): if not context: context = {} - vals['title'] = vals['name'] vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False) if not vals['parent_id']: vals['parent_id'] = self.pool.get('document.directory')._get_root_directory(cr,uid, context) @@ -174,8 +172,6 @@ class document_file(osv.osv): result = obj_model.read(cr, uid, [vals['res_id']], ['name', 'partner_id', 'address_id'], context=context) if len(result): obj = result[0] - if obj.get('name', False): - vals['title'] = (obj.get('name', ''))[:60] if obj_model._name == 'res.partner': vals['partner_id'] = obj['id'] elif obj.get('address_id', False): -- cgit v1.2.3