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 make a domain based on today date.

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
odooDomain
3 Replies
7070 Tampilan
Avatar
Abdul Qoudouss

Hello every one. Please, can someone helps me ? i created automate actions based on time condition which is at the next date of preventive maintenance. This automate actions is permit to create a record. But it seems that, this automate actions not worked at this specifically date. so i want to put a domain in order to works at the next date of preventive maintenance which is will be compared to the today date. How do i handle this ? Please.

i make this in domain [["next_action_date","=",context_today()]] but i got error

0
Avatar
Buang
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi,

First of all: we cannot provide the domain like you have given.
Currently, It is not possible to set a dynamic domain for the date field in the domain filter.
But, It doesn't matter. You can do it easily with the python code.
If you need to create the maintenance request for the equipments by just comparing the Date of the next preventive maintenance(next_action_date) with current date, you can do it using a scheduled action with code given below(Model: maintenance.equipment, Execute Every: 1 Days):

utc_date_now = datetime.datetime.now()
user_date_now = utc_date_now.astimezone(timezone(user.tz)).date()
equipments_for_maintenance = model.sudo().search([('next_action_date', '=', user_date_now)])
for equipment in equipments_for_maintenance:
env['maintenance.request'].create({
'name': 'Preventive Maintenance - ' + equipment.name,
'equipment_id': equipment.id,
'maintenance_type': 'preventive',
'request_date': equipment.next_action_date,
'schedule_date': equipment.next_action_date,
'duration': record.maintenance_duration
# add the values to the fields in 'maintenance.request'
})

If you need to do the same when we create/ update the Date of the next preventive maintenance(next_action_date), you can create an automated action with the code given below(Model: maintenance.equipment, Trigger: On Creation & Update, Trigger Fields: Date of the next preventive maintenance, Before Update Domain: [], Apply on: [], Action To Do: Execute Python Code):

utc_date_now = datetime.datetime.now()
user_date_now = utc_date_now.astimezone(timezone(user.tz)).date()
if records:
for record in records:
if record.next_action_date == user_date_now:
env['maintenance.request'].create({
'name': 'Preventive Maintenance - ' + record.name,
'equipment_id': record.id,
'maintenance_type': 'preventive',
'request_date': record.next_action_date,
'schedule_date': record.next_action_date,
'duration': record.maintenance_duration
# add the values to the fields in 'maintenance.request'
})





Regards

0
Avatar
Buang
Abdul Qoudouss
Penulis

Thanks a lot . I realy appreciate. But in m'y case , i create automate action whish create request maintenance at the date of thé next préventive maintenance because Odoo generates New request maintenance all Times. So i don't understand the reason. If u Can explain to me, the scheduled action of Odoo on the preventive request maintenance whish is implanted on the System by défault. Thanks very much

Cybrosys Techno Solutions Pvt.Ltd

The function _cron_generate_requests() is used with the scheduled action(Maintenance: generate preventive maintenance requests) in which the equipments are searched with the domain [('period', '>', 0)]. Then for those equipments, Odoo checks existing maintenance requests, where the maintenance type is 'Preventive', the request is created for the given equipment, the stage of request is not a completed stage, and the request date is the Date of the next preventive maintenance of the equipment. If there is no existing maintenance request, a new one is created using the method: _create_new_request(equipment.next_action_date).
That is, the default scheduled action of Odoo creates maintenance requests for all the maintenance equipment where the Preventive Maintenance Frequency or Days between each preventive maintenance(period) is greater than 0. It doesn't compare the Date of the next preventive maintenance with the current date.
Note: If you are adding the scheduled action or the automated action given here(don't add both), please disable the default one.

Abdul Qoudouss
Penulis

Thanks a lot ! i really appreciate ur assistance. It is now, very clear !

Avatar
Abdul Qoudouss
Penulis Jawaban Terbai

See.


0
Avatar
Buang
Avatar
Pratyush Ratan
Jawaban Terbai

Hey, 

You can try this one,

[('next_action_date','=',fields.Date.today())]

0
Avatar
Buang
Abdul Qoudouss
Penulis

Thanks for ur support. but its not worked. I use Odoo online so i have to make a domain by interface user.
I'll share u pic. Thanks

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
IOT Box URL Changing Diselesaikan
odoo Domain iot
Avatar
Avatar
2
Mei 21
6283
(!!C-o-p-a!!)¿Cómo comunicarse con Copa Airlines en Panamá?
odoo
Avatar
0
Nov 25
211
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
Nov 25
3320
(#iberia#)¿Cómo llamar a Iberia desde Panamá?
odoo
Avatar
0
Okt 25
391
How to import product variants with my own external id when using dynamic creation mode Diselesaikan
odoo
Avatar
Avatar
2
Agu 25
3869
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