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
    • Discuss
    • 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
    • Manajemen Properti
    • 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
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

Server Action not found: AttributeError: 'my.model' object has no attribute 'action_create_inventory_from_selection'

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
actiondevelopmentsever_action
2 Replies
552 Tampilan
Avatar
Parker D

Hello there :)

I am trying to add an action to a simple app I've made. 

Therefore I have added a method to my class:

class RollsManagement(models.Model):
_name = 'rollsmanagement.roll'
_description = 'Managing rolls'
_order = 'sequence'
_rec_name = 'name'
...

simply like this:

...
def action_create_inventory_from_selection(self):
​....

In my XML I've added the action like this:

    <record id="action_roll_inventory_import" model="ir.actions.server">
<field name="name">Create Inventory from Rolls</field>
<field name="model_id" ref="model_rollsmanagement_roll"/>
<field name="binding_model_id" ref="model_rollsmanagement_roll"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
action = model.action_create_inventory_from_selection()
</field>
</record>

My action appears when I've selected one or more data entries (rolls) in the drop down button "Actions" and when I click it, it ends in this error:

File "ir.actions.server(660,)", line 1, in <module>
AttributeError: 'rollsmanagement.roll' object has no attribute 'action_create_inventory_from_selection'

I have the strong feeling, I am missing something essential, maybe simple even. The model is there and working as always but somehow it seems that I cannot call the action the right way. Two LLMs are already at the end of their knowledge, it seems. Does anyone have a hint?

PS: If you're interested, my app lists some special rolls and simple information about them. I try to make an action that sums up their square meters and put that into the inventory adjustment. 

0
Avatar
Buang
Codesphere Tech

Hello,
Remove binding_model_id and write with decorator as below:
@api.model
def action_create_inventory_from_selection(self):

Let me know if it is not working.

Parker D
Penulis

Hi @Codesphere Tech :) Thanks, but still the same: "AttributeError: 'rollsmanagement.roll' object has no attribute 'action_create_inventory_from_selection'".

Avatar
Parker D
Penulis Jawaban Terbai

I am sorry everybody, I was tricked by the caching of my docker container and it's test environment. Thank you to you anyway and your recommendations were helpful! Maybe this will be as well for someone.

0
Avatar
Buang
Avatar
Kunjan Patel
Jawaban Terbai
Hello Parker D,
I hope you are doing well

The method exists but Odoo can't find it. This is a module loading issue, not XML.
Solution:
1. Restart Odoo server (required for Python changes)
2. Upgrade module: Apps → Your Module → Upgrade (or ./odoo-bin -u your_module -d your_db)
3. Verify method indentation is inside the class
4. Check models/__init__.py imports your file
5. Use records (not model) in the XML

I hope this information helps you.

Thanks & Regards,
Kunjan Patel
0
Avatar
Buang
Parker D
Penulis

Thank you Kunjan Patel, but both, records and record have the identical result: "AttributeError: 'rollsmanagement.roll' object has no attribute 'action_create_inventory_from_selection'".

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
¿Cómo llamar a BoA desde celular?
action development
Avatar
0
Nov 25
2
How does social media affect students?
action development chrome
Avatar
0
Feb 26
7
>>~0176}}}]¿Cuál es el número 1 800 284 2622?
action development contribution
Avatar
0
Feb 26
69
Convert Consumable Product to Storable Product تحويل حالة المنتجات الى قابل للتخزين Diselesaikan
action development configuration
Avatar
Avatar
1
Nov 25
459
How can I automatically send an email to customers when their order is confirmed in Odoo? I want to make sure they receive a confirmation without doing it manually every time. Diselesaikan
action development configuration
Avatar
1
Sep 25
7737
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
  • Karir
  • 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 Svenska ภาษาไทย 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