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 set different values of a field?

ติดตาม

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

คำถามนี้ถูกตั้งค่าสถานะ
javascriptopenerp7
2 ตอบกลับ
1256 มุมมอง
อวตาร
Abdelwahed

Hi can anyone answer me please

I use self.field_manager.set_values to modify a value of a field that i have created in openerp but what i want to know is:

Can we set different values of a field in openerp in the same time??!!

Please i need help.

 

 
0
อวตาร
ละทิ้ง
Emanuel Cino

What do you want to achieve, can you explain what you are doing ? Because it's not logical to set different values to a same field. Maybe you need to have a relational field of type one2many which can link to several records. But again, if you explain more what you are trying to do maybe we can better help finding a solution.

OdooBot
 Bonjour;
Je vous explique.
Je suis entrain de créer un nouveau widget qui charge un fichier.csv cote client et je lui fais du traitement. Puis le résultat de ce traitement je veux l'enregistrer dans la base.
De plus, le résultat est selui d'une boucle for et exactement c'est un json donc plusieurs json à la fin de la boucle.
Maintenant je veux enregistrer chaque json dans la base plus précisemment dans le field concerné. Ainsi, j'aurais plusieurs lignes pour ce field . Si je fais "self.field_manager.set_values({
                        "horraire_data":self.x,
                        });" je ne vais enregistrer que le dernier résultat de la boucle for.
SVP aidez-moi :/
 
--Cordialement;
Abdelwahèd Rihène ingénieur Génie Informatique 
Ecole Nationale des Ingénieurs de Tunis
Tél: +216 21 22 49 98
Never a Failure Always A Lesson !!
         Be the change you want to see in the world


De : Emanuel Cino <ecino@compassion.ch>
À : Abdelwahed <abdelwahed_rihene@yahoo.fr>
Envoyé le : Mercredi 11 mars 2015 11h44
Objet : Re: How to set different values of a field?

What do you want to achieve, can you explain what you are doing ? Because it's not logical to set different values to a same field. Maybe you need to have a relational field of type one2many which can link to several records. But again, if you explain more what you are trying to do maybe we can better help finding a solution.
--
Emanuel Cino
Sent by Odoo S.A. using Odoo about Forum Post How to set different values of a field?


OdooBot
hi i am so sorry because ihave sent you an email in french :/
i explain to you i have a new widget that uploads a csv file then it reads it to create a result which is a result of a loop that means multiple lines like this :
 {"days":[{"day":"1","hours":"10","nature":"T"},{"day":"2","hours":"20","nature":"T"},{"day":"3","hours":"30","nature":"T"},{"day":"4","hours":"40","nature":"T"}]}
 {"days":[{"day":"1","hours":"11","nature":"T"},{"day":"2","hours":"21","nature":"T"},{"day":"3","hours":"31","nature":"T"},{"day":"4","hours":"41","nature":"T"}]}
 {"days":[{"day":"1","hours":"12","nature":"T"},{"day":"2","hours":"22","nature":"T"},{"day":"3","hours":"32","nature":"T"},{"day":"4","hours":"42","nature":"T"}]}
{"days":[{"day":"1","hours":"13","nature":"T"},{"day":"2","hours":"23","nature":"T"},{"day":"3","hours":"33","nature":"T"},{"day":"4","hours":"43","nature":"T"}]}
 {"days":[{"day":"1","hours":"14","nature":"T"},{"day":"2","hours":"24","nature":"T"},{"day":"3","hours":"34","nature":"T"},{"day":"4","hours":"44","nature":"T"}]}
I use
self.field_manager.set_values({
                        "horraire_data":self.jsonjsmmme,
     });
to modify the value of horraire_data which is a field i have created in openerp but what i want to do is to send all the result to horraire_data which means to create multiple lines (diffrent values) of the field in my data base please can you help me??!!
May be i should use the _.each of underscore.js please i need an answer
 
--Cordialement;
Abdelwahèd Rihène ingénieur Génie Informatique 
Ecole Nationale des Ingénieurs de Tunis
Tél: +216 21 22 49 98
Never a Failure Always A Lesson !!
         Be the change you want to see in the world


De : Emanuel Cino <ecino@compassion.ch>
À : Abdelwahed <abdelwahed_rihene@yahoo.fr>
Envoyé le : Mercredi 11 mars 2015 11h44
Objet : Re: How to set different values of a field?

What do you want to achieve, can you explain what you are doing ? Because it's not logical to set different values to a same field. Maybe you need to have a relational field of type one2many which can link to several records. But again, if you explain more what you are trying to do maybe we can better help finding a solution.
--
Emanuel Cino
Sent by Odoo S.A. using Odoo about Forum Post How to set different values of a field?


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

I think you should reconsider your modelisation of data. You could define a new model representing the data that is on your json like for instance :

    class day(orm.Model):

    _name = 'horraire.day'

    _columns = {

        'day': fields.integer(...),

        'hours': fields.integer(...),

        'nature': fields.selection(...),

        'horraire_id': fields.many2one('other.object.you.use', ...)

    }

 

Now where you initially have your loop method you would do something like this, instead of your field horraire_data, you would have:

    'horraire_data': fields.one2many('horraire.day', 'horraire_id', ...)

And before and in your for loop, you would do :

    horraire_day_obj = self.pool.get('horraire.day')
    for :
        ... do your treatment ...
        
        horraire_day_obj.create(cr, uid, {
            'day': 1,
            'hours': 10,
            'nature': 'T',
            'horraire_id': ids[0] # your object_id
        }, context)
        
In this way your field 'horraire_data' will automatically link to all records 'horraire.day' attached to it.

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

Thanks  a lot for your answer but i want to know if it is possible to apply the

self.field_manager.set_values on a one2many field???

0
อวตาร
ละทิ้ง
Emanuel Cino

what is the type of your field 'horraire_data' ? char ? same question for your variable x, you put a string inside it ? if you do x = something inside your for loop, it will override the last value at each iteration. You should consider declaring x as a list, replace x = something by x.append(something) inside your for loop and then if 'horraire_data is a string, you can save your values by doing 'horraire_data': ','.join(x)

OdooBot
Hi!!!
Horraire_data is a json. I need to make many records to only one field but result contains many lines and when i click save, it will save only the last line. can self.field_manager.set_values create many records to one field please answer me.

De : Emanuel Cino <ecino@compassion.ch>
À : Abdelwahed <abdelwahed_rihene@yahoo.fr>
Envoyé le : Mercredi 11 mars 2015 14h39
Objet : Re: How to set different values of a field? (81700)

what is the type of your field 'horraire_data' ? char ? same question for your variable x, you put a string inside it ? if you do x = something inside your for loop, it will override the last value at each iteration. You should consider declaring x as a list, replace x = something by x.append(something) inside your for loop and then if 'horraire_data is a string, you can save your values by doing 'horraire_data': ','.join(x)
--
Emanuel Cino
Sent by Odoo S.A. using Odoo about Forum Post How to set different values of a field? (81700)


Emanuel Cino

No, set_values cannot create many records, if your field is of type char (type json does not exist for a OpenERP field). The only way is to create a one2many field as I explained in my answer, otherwise you have to convert your json into a string separated by commas or formatted in a way which you will be able to read afterwards. PS: Please remove the original message if you reply by e-mail, because it pollutes the thread.

สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

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

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
how to get list of users?
javascript openerp7
อวตาร
อวตาร
1
ก.ย. 15
9782
How to get classes or objects or records of openerp from javascript? แก้ไขแล้ว
javascript openerp7
อวตาร
อวตาร
2
ส.ค. 15
6148
How to fill a table from a javascript function in Openerp?
javascript openerp7
อวตาร
0
ส.ค. 15
3875
Get the selected menu in the topbar menu item ? แก้ไขแล้ว
javascript openerp7
อวตาร
อวตาร
1
มี.ค. 15
4817
self.field_manager.set_values
javascript openerp7
อวตาร
0
มี.ค. 15
854
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • 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