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

self search based on field

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
selfself.env.search
2 Replies
13201 Tampilan
Avatar
Bassam Alsibai

iam trying to add scheduled action to add leave allocation for each employee who dose not  have running leave 


i make the below script 


class scheduler_demo(models.Model):
_name =
'scheduler.demo'


def _daily_leaves(self):

test =
self.env['hr.employee'].sudo().search([])
for t in test.ids:
holidays =
self.env['hr.employee'].sudo().search([
(
'id', '=', t),
('current_leave_id', '=', '1')
])
for line in holidays.ids:
leave =
self.env['hr.holidays'].create({
'employee_id': line,
'holiday_status_id': '1',
'type': 'add',
'holiday_type': 'employee',
'number_of_days_temp': '8'
})
leave.action_approve()
if leave.double_validation:
leave.action_validate()
i received the below error

2019-01-19 09:26:31,848 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:31,957 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,081 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,193 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,302 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,440 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,549 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,665 26852 ERROR test4q odoo.osv.expression: Non-stored field hr.employee.current_leave_id cannot be searched. 2019-01-19 09:26:32,835 26852 INFO test4q werkzeug: 127.0.0.1 - - [19/Jan/2019 09:26:32] "POST /web/dataset/call_button HTTP/1.1" 200 - 2019-01-19 09:26:32,865 26852 INFO test4q werkzeug: 127.0.0.1 - - [19/Jan/2019 09:26:32] "POST /web/dataset/call_kw/ir.cron/search_read HTTP/1.1" 200 - 2019-01-19 09:26:33,163 26852 INFO test4q werkzeug: 127.0.0.1 - - [19/Jan/2019 09:26:33] "POST /web/menu/load_needaction HTTP/1.1" 200 - 2019-01-19 09:26:33,184 26852 INFO test4q werkzeug: 127.0.0.1 - - [19/Jan/2019 09:26:33] "POST /web/dataset/search_read HTTP/1.1" 200 - 2019-01-19 09:26:35,098 26852 INFO ? odoo.addons.bus.models.bus: Bus.loop listen imbus on db postgres

0
Avatar
Buang
Harsh

Hello Bassam Alsibai,

I m encountering same issue can you help me out in same ? Because my field has to be non storede

Avatar
Volodymyr
Jawaban Terbai

Hi, 

Yes, you cannot use non-stored fields in search domain, so if you need to use this code, you need to make a current_leave_id to be stored one - just inherit hr.employee and add store=True in the current_leave_id field declaration.

PS: if you like the answer - please upvote it! Thanks! :)

2
Avatar
Buang
Bassam Alsibai
Penulis

Thanks Volodymyr ,

your answer was right abut it didn't work form me because this field has to be non-stored field ,

i solved this issue in diffrent way

Avatar
ImConfused
Jawaban Terbai

How did you solve it?


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
self.env.search and self.env.search_count need to match every value Diselesaikan
self.env.search
Avatar
Avatar
1
Sep 21
19355
Using self.env to go over all module record and create new record in another module Diselesaikan
self loop self.pool.get self.env.search
Avatar
Avatar
2
Jan 19
15739
Calling field in method of another object Diselesaikan
inherit self objects self.env.search
Avatar
Avatar
1
Jun 18
8131
Can't self.env.search with Officer role
record_rules self.env.search
Avatar
1
Mar 22
2601
Where to learn more about self.env? Diselesaikan
odoo self.env.search
Avatar
Avatar
1
Agu 24
6574
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