Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Regarding one2many field

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
errorone2manylistunhashable
2 Replies
7395 Tampilan
Avatar
Krishna

I was trying to add a one2many field..but its giving the following error.

Server Traceback (most recent call last):
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\openerp\addons\web\session.py", line 89, in send
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\netsvc.py", line 292, in dispatch_rpc
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\osv.py", line 188, in execute_kw
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\osv.py", line 131, in wrapper
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\osv.py", line 197, in execute
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\osv.py", line 185, in execute_cr
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\orm.py", line 3604, in read
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\orm.py", line 3724, in _read_flat
 File "C:\Program Files\OpenERP 7.0-20130627-231102\Server\server\.\openerp\osv\fields.py", line 538, in get
TypeError: unhashable type: 'list'

any idea??? Please answer..

0
Avatar
Buang
Qutechs, Ahmed M.Elmubarak

hello, can you put some lines of the code ...

Qutechs, Ahmed M.Elmubarak

is the sale.order model inherited or customized, if customized, if it contains m2o field called 'order_line' from 'hotel.sale.line'?

Krishna
Penulis

yaah..I have added m2o field in sale.order model

Krishna
Penulis

code is....'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}), 'sale_line':fields.many2one('hotel.sale.line','order_lines'),

Avatar
Krishna
Penulis Jawaban Terbai

in .py file

class hotel_sale_line(osv.osv):
    _name = 'hotel.sale.line'
    _description = "Sale Line"
    _columns ={          
       'folio_id':fields.many2one('hotel.folio'),
        'order_lines':fields.one2many('sale.order','order_line','Sales Order'),
}

and in .xml file---

<separator string="Sale Order Lines" colspan="4"/> 
<field name="sale_lines" colspan="4" nolabel="1"> 
<form string="Sales Order">
 <separator string="Sales Order"/>
 <field name="order_lines" select="1" colspan="4" nolabel="1"/>
 </form> <tree string="Sales Order Lines" editable="bottom"> 
 <field name="order_lines"/>
 </tree>
 </field>
0
Avatar
Buang
Simplify it!

I am not sure what you want to do, but all the concept is wrong. If you are inheriting the sales.order then you don't have to create another model, you have to add some fields to sale.order. If you are creating a new model then you can't have the order.lines because sale.order is already using that. If you want to add sale.order to your model you have to have 2 fields that relate them. a many2one and one2many, then its going to work

Krishna
Penulis

I am new to openerp. So, Please can you post one example for that.Thanks for your help.

Qutechs, Ahmed M.Elmubarak

@Krishna please check this like https://doc.openerp.com/v6.0/developer/2_5_Objects_Fields_Methods/field_type.html/ for one2many field, and as @Grover said please tell us what do you aim to do, is it your own customized module , or you want to inherit the sale module

Krishna
Penulis

ok..i want to add the sale order line in my custom module then what should I have to do for that?

Krishna
Penulis

using my code..i can see the sale order form from sales module..everything is working fine..but when i confirm my whole form then it gives error of such type.that i have shown you..So where is problem i can't undestand???

Abhishek H Menon

Please don't put direct link to the existing models in openerp, it is a bad practise. Instead of that inherit an existing class here it is sale.order, and add your required fields you want to display additionally and along with that, give a many2one id inorder to create an inverse relationship with the former model that is here it is hotel.sale.line. then onlye you can create a one2many relationship. But at first you have to define the inherited hotel.sale.line after that define sale.order in your custom module, Thanks

Avatar
Abhishek H Menon
Jawaban Terbai
from osv import fields,osv
    class hotel_sale_line(osv.osv):
        _name='hotel.sale.line'
        _description='Hotel Sale'
        _columns= {
             'folio_id':fields.many2one('hotel.folio'),
             'order_lines':fields.one2many('sale.order','order_line','Sales Order'),
             }
    hotel_sale_line()

    class sale_order(osv.osv):
        _inherit='sale.order'
        _columns={
            'order_line': fields.many2one('hotel.sale.line','Order')
            }   
    sale_order()
0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
TypeError: unhashable type: 'list' | Odoo 9
error list unhashable v9
Avatar
Avatar
2
Jun 21
4513
One2Many field not records more than one value
error one2many
Avatar
0
Des 17
4747
unhashable type: 'list' -many2many
list many2many unhashable
Avatar
1
Des 17
6974
Odoo15 error with one2many field write method
error one2many writeMethod v15
Avatar
Avatar
1
Apr 23
3070
How append the values in one2many field in odoo10? Diselesaikan
one2many list dictionary odoo10
Avatar
Avatar
2
Nov 21
33874
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik 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