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

Compute the days that employee spend service the company (current date -Hiring Date)

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
codesaascomputepayrollodoo13Rules
3 Replies
4405 Tampilan
Avatar
Ahmed Naji

Hello Guys I am using Odoo  13  enterprise and I  am trying to compute the number of days that an employee spent serving the company to use it in the calculation payroll that will calculate the number of days that an employee spends working for a company based on the Hiring date and current date.

I don't know the python code that I can use to do a rule in the payslip calculation or to create a field in the employee view screen that computes the current working days (up to date automatically)
hope that someone can point me in the right direction

0
Avatar
Buang
Avatar
Jainesh Shah(Aktiv Software)
Jawaban Terbai

Hello Ahmed Naji,

You should try this for get employee spends days in company with 2 way depends on data.

Option 1)
If you create new functionality with a fresh database or you don't have any records in the employee, then you can calculate days such a way like below.

from datetime import date

hiring_date = fields.Date(string='Hiring Date' , default=lambda self: date.today())
spend_day = fields.Integer('Spend Days', compute='_compute_days')

def _compute_days(self):
for record in self:
record.spend_day = (date.today() - record.hiring_date).days

Option 2)
If you are using database with already employee data, then you can calculate days such a way like below.

from datetime import date

hiring_date = fields.Date(string='Hiring Date')
spend_day = fields.Integer('Spend Days', compute='_compute_days')

def _compute_days(self):
for record in self:
record.spend_day = (date.today() - record.hiring_date).days if record.hiring_date else 0

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

1
Avatar
Buang
Ahmed Naji
Penulis

Hello Jainesh Shah,

Thank you for replying to my post. I am using Odoo SaaS so I don't have access to the server backend.so I don't know how I can apply this code from the user interface. I only can do custom fields and do the computing in the advanced property in the user interface.so if you know of a way or how to do it, I will really appreciate it
Thank you in advance

Faris Fathurrahman

in which model should I put it into?

Avatar
Scott Ball
Jawaban Terbai

Hi Ahmed, 

What was the solution you found? 

0
Avatar
Buang
Avatar
Ahmed Naji
Penulis Jawaban Terbai

Thank you for everyone try to help 


I solve this by myself.


0
Avatar
Buang
Faris Fathurrahman

may we know, how did you solve it?

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
Can I develop custom modules on the SaaS offer (OpenERP Online)?
code modification saas
Avatar
Avatar
Avatar
Avatar
3
Mar 15
12049
How to call a server action depending on Activity State change
Rules
Avatar
Avatar
2
Nov 24
2480
In odoo studio - Transform positive value Field into negative value Field Diselesaikan
compute
Avatar
Avatar
2
Mar 24
2762
.update() method not updating values
code
Avatar
0
Sep 23
2580
Is the Xml-RPC API available on OpenERP Online?
saas
Avatar
Avatar
Avatar
2
Agu 23
22608
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