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

How to receive value from wizard before saving it

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
wizardodoo12
1 Balas
7305 Tampilan
Avatar
Michael

Hi,

I'm creating a wizard to write the refuse reason for Applicant (hr.applicant). I want receive the value of the fields on wizard form before it be saved. Is there any way to do it?

Code to open wizard

@api.multi
def archive_applicant_sure(self):
return {
'name': _('Update Your Refuse Reason'),
'type': 'ir.actions.act_window',
'view_mode': 'form',
'view_type': 'form',
'res_model': 'hr.applicant',
'target': 'new',
'view_id': self.env.ref('icoeuro_hr.hr_applicant_interview_refuse_wizard', False).id,
'res_id': self.id,
}

Wizard form

<!-- Refuse wizard -->
<record model="ir.ui.view" id="hr_applicant_interview_refuse_wizard">
<field name="name">hr.applicant.refuse.wizard.form</field>
<field name="model">hr.applicant</field>
<field name="arch" type="xml">
<form>
<group string="Refuse Reason">
<field name="refuse_reason" nolabel="1" required="1"/>
</group>
<footer>
<button string="Save" type="object" name="archive_applicant" class="oe_highlight"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>

The function that I want to receive the value

@api.multi
def archive_applicant(self, form):
print(form)
# self._context.get('refuse_reason')
if form.get('refuse_reason'):
self.action_applicant_refuse(form.get('refuse_reason'))
else:
raise UserError(_('You must type some reason'))
return {'type': 'ir.actions.act_window_close'}

Now, when I click "Save" in wizard form Odoo execute the write function then archive_applicant and the form parameter do not receive the field value. I know we can use other solution but if we have a way to do this, I think we can apply it to some other case

0
Avatar
Buang
Avatar
leconte.clement@orange.fr
Jawaban Terbai

Hello,

First of all I don't think you create a wizard in any way. You are calling a custom view (but it's not a wizard) based on hr.applicant which is a persistant model and not at all a transient model.

Second I think write method will be called after your method "archive_applicant", as your return the method that closes the view at the end of this method.

Third, I don't know how you want to get the value from field "refuse_reason" by calling the dict method get() on the "form" parameter, since it should return metadata, but maybe that's something I still have to learn and I don't know about.

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
Prevent wizard from being closed odoo 12
wizard odoo12
Avatar
Avatar
Avatar
2
Sep 20
6784
How to take records from wizards to form in odoo?
wizard form odoo12
Avatar
Avatar
2
Sep 23
5427
what is the best way to display a generated list from a method into odoo wizard view to be ready for printing?
wizard passing odoo12
Avatar
Avatar
2
Sep 22
5003
How to pass wizard data to report.py?
wizard pivot odoo12
Avatar
0
Jan 21
3997
How to find the sum of all record in the wizard and display in float field in odoo12 Diselesaikan
wizard compute odoo12
Avatar
Avatar
1
Des 19
5965
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