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 do I link the Timesheets app with Payroll to calculate the salaries of my hourly workers?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
hrPayrollQuickstartSF-ExpertsV17.0
3 Replies
3203 Tampilan
Avatar
Emilio Rodríguez De la Fuente (erdf)

Hello Odooverse! 

I want to use Payroll to start registering my company's payroll. Nevertheless, some hourly workers register their worked time in the Timesheets App, and Payroll does not consider Timesheets as a work entry source. Is there a way to do it? I am using this salary structure:


As you observe is not too complex:

However, I want it to be calculated from the timesheet records instead of calculating the worked time based on the work entry sources (attendance, planning, or working schedule).

0
Avatar
Buang
Avatar
Emilio Rodríguez De la Fuente (erdf)
Penulis Jawaban Terbai

Hello Emilio! 

The answer to this question could be as detailed as the business case, depending on case by case. So, to achieve this, you need to create a new salary rule or modify an existing one. 

The computation should be based on Python Code: 

hours = 0   

Line explanation: setting the variable hours to 0.


lines = payslip.env[ 'account.analytic.line' ].search( [ ('employee_id' , '=', payslip.employee_id.id), ('validated_status', '=', 'validate'), ('date', '>=', payslip.date_from), ('date', '


Line explanation:  This code retrieves all the analytic lines (account.analytic.line) for the employee on the payslip that has been validated and is within the current payroll period.


  • payslip.env['account.analytic.line']:  This accesses the account.analytic.line model, which refers to the analytic lines or timesheet records in Odoo.
  • .search: The search() function looks for records that meet the criteria specified in the list of tuples (search criteria).
  • ('employee_id', '=', payslip.employee_id.id): Filters the analytic lines to get only those associated with the specific employee that appears on the payslip (payslip.employee_id.id).
  • ('validated_status', '=', 'validate'): Filters the analytic lines to get only those that have been validated, meaning they have been approved or confirmed.
  • ('date', '>=', payslip.date_from): Filters the analytic lines to get only those that were recorded starting from the payslip start date (payslip.date_from).
  • ('date', ': Filters the analytic lines to get only those that were recorded up to the payslip end date (payslip.date_to).


for line in lines:

    hours += line.unit_amount

result_qty = hours

result = contract.hourly_wage

Explanation: The for loop iterates over each analytic line stored in "Lines," so each "Line" represents a record of time worked by the employee. Then, the code sums all the hours and inputs the total hours in result_qty, which will result in the hourly wage in the employee contract.

Disclaimer: the code may depend on what or how you want to impact your payroll calculations.

Before applying my solution, please think about other important factors that may be relevant to your payroll calculation: 

  • As you may have seen, this does not generate work entries such as overtime. When someone works more than the agreed-upon amount, you may need to create another salary rule to calculate that. 
  • And if Time Off generates Timesheets, consider this when applying this solution.

Disclaimer: This is only a general solution to the business case. Additional specifications are needed to cover it in more detail, which may apply depending on the specific case, as I mentioned earlier.

4
Avatar
Buang
Ray Carnes (ray)

On Earth 76483 I already answered this, but yours is better.

Avatar
Matthew Messner
Jawaban Terbai

Is it possible that someone could walk through how to actually implement this? I'm not code savvy and I am not sure if I am making the rule correctly. It seems very odd that Odoo does not have this built into payroll. Asking contractors to Check In to attendance and fill out timesheets so we can tract project hours is unreasonable and cumbersome. 

I just need hours worked and logged in timesheets to be able to be tracked as Work Entries and be added to Payslips. 

EDIT:

This process does work with some caveats. 

 After making a new Rule by adding the code to the Python Computation, the rule needs to be added to a Salary Structure. Within a new pay slip you can Compute Sheet in the Salary Computation tab. 

This will give you the hours pulled from the timesheets. As mentioned in the other answers, it pulls time indiscriminately, so any hours that are logged will be added. This is an issue if a worker is logging hours that they are not to be paid for. 

Another issue is that these wages are not record as Basic Wages and will not show up in the Payslip reports or the Payslip List. This is an issue when reconciling money in Accounts. 



0
Avatar
Buang
Avatar
Arseniy Finberg
Jawaban Terbai

Actual salary rule code, working on odoo 17 (based on upper comment with slight edits)

hours = 0   

lines = payslip.env['account.analytic.line'].search([

    ('employee_id', '=', payslip.employee_id.id),

    ('validated_status', '=', 'validate'),

    ('date', '>=', payslip.date_from),

    ('date', '<=', payslip.date_to)  # Corrected the condition here

])

for line in lines:

    hours += line.unit_amount

result_qty = hours

result = contract.hourly_wage

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
Alternating Working Schedules in Odoo! Diselesaikan
hr Quickstart SF-Experts WorkingSchedule
Avatar
1
Feb 25
3285
In recruitment App V17.0 ¿what is the main difference between Recruiter and Interviewer? Diselesaikan
hr Quickstart SF-Experts Recruitment
Avatar
Avatar
2
Okt 24
2633
In Time Off, How can I check the Time Off balances of my employees? Diselesaikan
hr Quickstart SF-Experts TimeOff
Avatar
1
Apr 24
3343
Traceability of tardiness in employees Diselesaikan
hr Attendances Quickstart SF-Experts
Avatar
1
Apr 24
2246
What are the New Releases for Fleet V17.1? Diselesaikan
fleet hr Quickstart SF-Experts
Avatar
Avatar
2
Apr 24
2097
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