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

Hello,

When the user select the CSV file, I want to parse it and insert data in the field 'data', how I can do that ?

Thanks

 

    _name = "object"

    _columns = {

        'file_data': fields.binary('File to import', required=True),
        'file_fname': fields.char('Filename', size=128, required=True),

        'data': fields.one2many('data.import', 'data', required=True),

    }

 

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

any help please !

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Mos,

Following link could help you. The code is about xlrd library but you can use csv library instead and modify the code as per your need.

Import products from excel.

อวตาร
ละทิ้ง