Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
13.0413CE
2862 Vistes
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
Descartar
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
Autor

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!

Registrar-se
Related Posts Respostes Vistes Activitat
Odoo 13 CE - payslip rule error
13.04 13CE
Avatar
0
de febr. 22
1980
how to fix error in manufacturing
manufacturing 13.04 13 13CE
Avatar
Avatar
1
de març 21
3046
Records disappearing from odoo 13.
13 13CE
Avatar
0
de gen. 22
2232
Updating base for 13CE how to? Solved
upgrade 13CE
Avatar
Avatar
2
de maig 21
2342
Python update invoice to paid
python 13.04
Avatar
0
de febr. 21
3095
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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