Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)