Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4136 มุมมอง

Hello EveryOne I want to get path of file imported this field declared like this

attachment_ids = fields.Many2many('ir.attachment', string='Files')
file = fields.Binary('file',string='file')
@api.multi
def get_path_file(self):
    path =""
    path = pathof(self.file)# here i want to get the path
    shutil.copy2(path+name_of_file, '/desktop/folder_copy')

in onchange or any method when i make a breakpoint i want to get path like this

( /home/Desktop/backup/files/myfile.pdf) from any system (linux ,windows ,MacOs)

NB : Odoo 12 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 20
4870
2
ก.ค. 24
14123
3
ก.พ. 25
3571
0
พ.ค. 24
46
1
เม.ย. 24
3360