Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

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

Odebírat

Get notified when there's activity on this post

This question has been flagged
hrPayrollQuickstartSF-ExpertsV17.0
3 Odpovědi
3207 Zobrazení
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
Zrušit
Avatar
Emilio Rodríguez De la Fuente (erdf)
Autor Nejlepší odpověď

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
Zrušit
Ray Carnes (ray)

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

Avatar
Matthew Messner
Nejlepší odpověď

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
Zrušit
Avatar
Arseniy Finberg
Nejlepší odpověď

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
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Alternating Working Schedules in Odoo! Vyřešeno
hr Quickstart SF-Experts WorkingSchedule
Avatar
1
úno 25
3287
In recruitment App V17.0 ¿what is the main difference between Recruiter and Interviewer? Vyřešeno
hr Quickstart SF-Experts Recruitment
Avatar
Avatar
2
říj 24
2633
In Time Off, How can I check the Time Off balances of my employees? Vyřešeno
hr Quickstart SF-Experts TimeOff
Avatar
1
dub 24
3343
Traceability of tardiness in employees Vyřešeno
hr Attendances Quickstart SF-Experts
Avatar
1
dub 24
2246
What are the New Releases for Fleet V17.1? Vyřešeno
fleet hr Quickstart SF-Experts
Avatar
Avatar
2
dub 24
2097
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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