Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

How do I link the Timesheets app with Payroll to calculate the salaries of my hourly workers?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
hrPayrollQuickstartSF-ExpertsV17.0
3 Odpowiedzi
3205 Widoki
Awatar
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
Awatar
Odrzuć
Awatar
Emilio Rodríguez De la Fuente (erdf)
Autor Najlepsza odpowiedź

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
Awatar
Odrzuć
Ray Carnes (ray)

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

Awatar
Matthew Messner
Najlepsza odpowiedź

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
Awatar
Odrzuć
Awatar
Arseniy Finberg
Najlepsza odpowiedź

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
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
Alternating Working Schedules in Odoo! Rozwiązane
hr Quickstart SF-Experts WorkingSchedule
Awatar
1
lut 25
3287
In recruitment App V17.0 ¿what is the main difference between Recruiter and Interviewer? Rozwiązane
hr Quickstart SF-Experts Recruitment
Awatar
Awatar
2
paź 24
2633
In Time Off, How can I check the Time Off balances of my employees? Rozwiązane
hr Quickstart SF-Experts TimeOff
Awatar
1
kwi 24
3343
Traceability of tardiness in employees Rozwiązane
hr Attendances Quickstart SF-Experts
Awatar
1
kwi 24
2246
What are the New Releases for Fleet V17.1? Rozwiązane
fleet hr Quickstart SF-Experts
Awatar
Awatar
2
kwi 24
2097
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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