def write(self, cr, uid, ids, vals, context=None): if vals.get('image',False): s3 = s3client(self) image_url=s3.upload(cr,uid,vals.get('image'),vals.get('file_name','image.png')) vals['image_url']=image_url return super(born_content, self).write(cr, uid, ids, vals, context=context)
def create(self, cr, uid, vals, context=None): if context is None: context = {} if vals.get('image',False): s3 =s3client(self) image_url=s3.upload(cr,uid,vals.get('image'),vals.get('file_name','image.png')) vals['image_url']=image_url #本地保存 return super(born_content, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context=None): if vals.get('image', False): s3 = s3client(self) image_url = s3.upload(cr, uid, vals.get('image'), vals.get('file_name', 'image.png')) vals['image_url'] = image_url return super(born_content, self).write(cr, uid, ids, vals, context=context)
def create(self, cr, uid, vals, context=None): if context is None: context = {} if vals.get('image', False): s3 = s3client(self) image_url = s3.upload(cr, uid, vals.get('image'), vals.get('file_name', 'image.png')) vals['image_url'] = image_url #本地保存 return super(born_content, self).create(cr, uid, vals, context=context)