跳至內容
選單
此問題已被標幟
3660 瀏覽次數

I want to access all files from many2many field. I don't want to save the files in the db, thats why is store=False


assets_uploader = fields.Many2many(comodel_name='ir.attachment', string='Assets upload', attachment=True, store=False)


<button string="Upload"  type="object" name="upload_asset" context="{'assets_uploader': assets_uploader}" />

 

def upload_asset(self):      

        for file in self._context.get('assets_uploader'):

            print(file)


Is there a solution?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
11月 19
5143
2
11月 24
2580
2
6月 20
11402
2
11月 18
6102
0
3月 23
2129