Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Odoo 13 CE - when generating payslip batch i got this error

Subscribe

Get notified when there's activity on this post

This question has been flagged
13.0413CE
2853 Views
Avatar
libre

Hello, When I want to calculate the payslips in batches, I receive this error message below.


File "C:\Program Files (x86)\Odoo 13.0\server\odoo\fields.py", line 3681, in __get__ raise ValueError("Expected singleton: %s" % record) ValueError: Expected singleton: hr.employee(2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2365, 2364, 2366, 2367, 2369, 2370, 2371, 2368, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2380, 2382, 2381, 2432, 2383, 2384, 2388, 2389, 2390, 2385, 2386, 2387, 2391, 2392, 764, 2394, 2433, 2395, 2400, 2401, 2402, 2403, 2404, 2396, 2398, 2397, 2399, 2405, 2406, 2407, 2408, 2410, 2409, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2434)



Can you bring me a solution to this problem?
I use hr_payroll_community from Cybrosys Techno Solutions


Thank you for advance


0
Avatar
Discard
Waleed Mohsen (CorTex IT Solutions)

The latest version for the hr_payroll_community module is 13.0.1.5.3, make sure you have the upgrade your module and give it a try?

GEClick SL

I updated the module, but I still meet the same mistake. Is it possible to give me the directial link to the download of the update 13.0.1.5.3? thank you in advance

 

De : CorTex IT Solutions Ltd <notifications@mail.odoo.com>
Envoyé : lundi 21 février 2022 15:35
À : libre <emac@geclick.gq>
Objet : Re: Odoo 13 CE - when generating payslip batch i got this error

 

View Forum Post

Odoo S.A.


The latest version for the hr_payroll_community module is 13.0.1.5.3, make sure you have the upgrade your module and give it a try?

Sent by Odoo S.A. using Odoo.

libre
Author

this is the error :
File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\hr_payroll_account_community\wizard\hr_payroll_payslips_by_employees.py", line 12, in compute_sheet return super(HrPayslipEmployees, self.with_context(journal_id=journal_id)).compute_sheet() File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\hr_payroll_community\wizard\hr_payroll_payslips_by_employees.py", line 40, in compute_sheet payslips.compute_sheet() ** File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\dev_hr_loan\models\hr_payslip.py", line 24, in compute_sheet [('employee_id', '=', self.employee_id.id), ('loan_id.state', '=', 'done'), ('is_paid', '=', False),('date','<=',self.date_to)]) File "C:\Program Files (x86)\Odoo 13.0\server\odoo\fields.py", line 3681, in get raise ValueError("Expected singleton: %s" % record) ValueError: Expected singleton: hr.employee(2357, 2432)**

the code of loand it this :
----------------------------loan code ----------------------------------
class hr_payslip(models.Model):
_inherit = 'hr.payslip'

installment_ids = fields.Many2many('installment.line',string='Installment Lines')
installment_amount = fields.Float('Installment Amount',compute='get_installment_amount')
installment_int = fields.Float('Installment Amount',compute='get_installment_amount')

def compute_sheet(self):

installment_ids = self.env['installment.line'].search(
[('employee_id', '=', self.employee_id.id), ('loan_id.state', '=', 'done'), ('is_paid', '=', False),('date','<=',self.date_to)])
if installment_ids:
self.installment_ids = [(6, 0, installment_ids.ids)]
return super(hr_payslip,self).compute_sheet()

---------------------code hr_payroll_ payslip_employee --------------------------
# -*- coding: utf-8 -*-

from odoo import api, fields, models, _
from odoo.exceptions import UserError

class HrPayslipEmployees(models.TransientModel):
_name = 'hr.payslip.employees'
_description = 'Generate payslips for all selected employees'

employee_ids = fields.Many2many('hr.employee', 'hr_employee_group_rel', 'payslip_id', 'employee_id', 'Employees')

def compute_sheet(self):
payslips = self.env['hr.payslip']
[data] = self.read()
active_id = self.env.context.get('active_id')
if active_id:
[run_data] = self.env['hr.payslip.run'].browse(active_id).read(['date_start', 'date_end', 'credit_note'])
from_date = run_data.get('date_start')
to_date = run_data.get('date_end')
if not data['employee_ids']:
raise UserError(_("You must select employee(s) to generate payslip(s)."))
for employee in self.env['hr.employee'].browse(data['employee_ids']):
slip_data = self.env['hr.payslip'].onchange_employee_id(from_date, to_date, employee.id, contract_id=False)
res = {
'employee_id': employee.id,
'name': slip_data['value'].get('name'),
'struct_id': slip_data['value'].get('struct_id'),
'contract_id': slip_data['value'].get('contract_id'),
'payslip_run_id': active_id,
'input_line_ids': [(0, 0, x) for x in slip_data['value'].get('input_line_ids')],
'worked_days_line_ids': [(0, 0, x) for x in slip_data['value'].get('worked_days_line_ids')],
'date_from': from_date,
'date_to': to_date,
'credit_note': run_data.get('credit_note'),
'company_id': employee.company_id.id,
}
payslips += self.env['hr.payslip'].create(res)
payslips.compute_sheet()
return {'type': 'ir.actions.act_window_close'}

Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Odoo 13 CE - payslip rule error
13.04 13CE
Avatar
0
Feb 22
1980
how to fix error in manufacturing
manufacturing 13.04 13 13CE
Avatar
Avatar
1
Mar 21
3041
Records disappearing from odoo 13.
13 13CE
Avatar
0
Jan 22
2231
Updating base for 13CE how to? Solved
upgrade 13CE
Avatar
Avatar
2
May 21
2341
Python update invoice to paid
python 13.04
Avatar
0
Feb 21
3093
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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