Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

How to import csv file on odoo

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
xmlqwebjsodooV8
3 ตอบกลับ
11692 มุมมอง
อวตาร
Rihene

Hello friends!!

I have tried this for you!!

Who can help me enrich this code as a work team ;)

XML:

< class="oe_web_example_message">Press to upload!/h3>

<p class="oe_web_example_file">

<input type="file" id="fileUpload" name="file" />

<button>entire file</button>

</p>

<p class="oe_web_example_filesa" id="dvCSV">

<textarea name="dvCSVs" rows="4" cols="50"></textarea>

</p>

</div>

</templates>

Js:


openerp.test_paie = function (instance)

{

var QWeb = instance.web.qweb;

var _t = instance.web._t;

instance.seetek_paie.Mywidget = instance.web.form.FormWidget.extend(instance.web.form.ReinitializeWidgetMixin,{

template : "seetek_paie.Mywidget",

events: {

'click .oe_web_example_file button': 'Upload',

},

Upload: function () {

var fileUpload = document.getElementById("fileUpload");

var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.csv|.txt)$/;

if (regex.test(fileUpload.value.toLowerCase())) {

if (typeof (FileReader) != "undefined") {

var reader = new FileReader();

var tabResult = new Array();

reader.onload = function (e) {

var table = document.createElement("table");

var rows = e.target.result.split("\n");

var y = new Array();

var matricule = new Array();

for (var i = 0; i < (rows.length - 1); i++) {

var row = table.insertRow(-1);

var cells = rows[i].split(",");

if (cells[0] != 0)

{ var mat = cells[0];}

console.log("La" + i + "ème matricule est \n"+ mat);

if (cells[0]!= "")

{matricule.push(cells[0]);}

// Affiche doc

for (var j = 0; j < cells.length; j++) {

var cell = row.insertCell(-1);

cell.innerHTML = cells[j];

}

}

console.log(matricule);

var days = new Array();

var heures = new Array();

for (var i = 1; i < rows.length; i++) {

var row = table.insertRow(-1);

var cells = rows[i].split(",");

days = rows[0].split(",");

var obj = {};

var obj2 = {};

for (var j = 0; j < cells.length; j++) {

obj2[j] = cells[j];

}

obj[i] = obj2;

heures.push(obj);

}

var my_jsons_days;

var my_jsons_days_all = new Array();

var oups;

for (var i = 0; i < (rows.length - 2); i++) {

var my_jsons_days_all_temp = new Array();

for (var dd = 1; dd < days.length; dd++) {

var z;

if (heures[i][i+1][dd] > 0) { z = 'T';} else {z = 'A'; }

my_jsons_days = {"day":days[dd],"hours":heures[i][i+1][dd],"nature":z};

my_jsons_days_all_temp.push(my_jsons_days);

}

oups = {"days": my_jsons_days_all_temp};

var jsonStrssEM = JSON.stringify(oups);

console.log(jsonStrssEM);

var node = document.createElement("LI");

var textnode = document.createTextNode(jsonStrssEM);

node.appendChild(textnode);

document.getElementById("myList2").appendChild(node);

}

var dvCSV = document.getElementById("dvCSV");

dvCSV.innerHTML = "";

dvCSV.appendChild(table);

}

reader.readAsText(fileUpload.files[0]);

} else {

alert("This browser does not support HTML5.");

}

} else {

alert("Please upload a valid CSV file.");

}

},


});

instance.web.form.custom_widgets.add('momo1', 'instance.test_paie.Mywidget');

};

Ihave tried it to upload a csv file and then make some treatment.

I didnt finish it yet you can use it and change it as you want ;)

1
อวตาร
ละทิ้ง
PY

Hello. First, use the code markup, and indent your code, please. Then, why doing a widget, when you can import csv files through the regular interface ? Did you read the documentation ?

Akhil P Sivan

Hi Drees, I have did custom modules to import the csv of bank statements, bill of materials (based on some conditions) etc. For both odoo 8 and 7. I did using a wizard and file object to read content from csv and functions to write the content to database. I can help you, if you have any doubts: akhilpsivan@outlook.com. And PY, if you want to check some conditions or do some process before importing data, its not possible through regular interface.

Rihene
ผู้เขียน

can you post your code to use

อวตาร
superpan86
คำตอบที่ดีที่สุด

Do you have to add the widget or something in your "columns" from your .py file?Or in your __openerp__.py?

In the xml file it would be something like this: <field name="name"  widget="MyWidget" />?


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

In the __openerp__.py file, you have to add attributes like this:


js': ['static/src/js/xxxxx.js'],

'css': ['static/src/css/xxxxxx.css'],

'qweb': ['static/src/xml/xxxxxxx.xml'],

Like in this link:

http://openerp-web-v7.readthedocs.org/en/latest/module.html

0
อวตาร
ละทิ้ง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
how to pass data from Qweb to javascript in odoo 12.
xml qweb event js
อวตาร
0
มิ.ย. 21
3667
How to modify the position of the <tr> tags in reports under Accounting Reports and Journal in Odoo 8?
xml qweb odooV8 qweb-report
อวตาร
0
ต.ค. 16
4316
Hide base module button with inheritance แก้ไขแล้ว
xml hide js odooV8
อวตาร
1
พ.ค. 16
5703
odoo17 qweb boolean t-if condition in xml not working as expected
xml qweb boolean odooV8 odoo17
อวตาร
อวตาร
1
ม.ค. 25
1849
Is it possible to include client_order_ref in a picking report? แก้ไขแล้ว
xml qweb picking report odooV8
อวตาร
อวตาร
อวตาร
3
ก.ค. 23
7992
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • Github
  • Runbot
  • การแปล
บริการ
  • โฮสติ้ง odoo.sh เซิร์ฟเวอร์
  • การสนับสนุน
  • อัปเกรด
  • การพัฒนาที่กำหนดเอง
  • การศึกษา
  • ค้นหานักบัญชี
  • ค้นหาพาร์ทเนอร์
  • ร่วมเป็นพาร์ทเนอร์
เกี่ยวกับเรา
  • บริษัทของเรา
  • ทรัพย์สินในรูปของเครื่องหมายการค้า
  • ติดต่อเรา
  • งาน
  • ระบบการจัดงานอีเวนต์
  • พอดแคสต์
  • บล็อก
  • ลูกค้า
  • กฎหมาย • ความเป็นส่วนตัว
  • ความปลอดภัย
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo เป็นชุดแอปธุรกิจแบบเปิดที่ครอบคลุมทุกความต้องการของบริษัทของคุณ อาธิ CRM eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ Odoo คือการใช้งานที่ง่ายดายและผสานการทำงานอย่างสมบูรณ์แบบในเวลาเดียวกัน

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now