Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

leaves and salary calculation.

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
hr_payrollpayslipleavespython2.7
21 Respuestas
35875 Vistas
Avatar
charlesraj

hi. Any one please tell me how to reduce the salary of an employee who take leave.

eg: salary=5000

he/she take one leave in a month , then reduce rs.100 from his salary. Ie then remaining salary is 4900.How to configure this in openerp v7.0.

i assigned a salary rule (Deduction Towards Leave Availed) to salary structure.

there is a field for adding python code in this rule. how to implement my need through python code. please help..

0
Avatar
Descartar
Avatar
Maath
Mejor respuesta

Hi

You need to add salary rule to salary structure to deduct (add python code)

result=-(contract.wage/30)*worked_days.Unpaid.number_of_days

then you can deduct from salary depending on number of Unpaid leave taken by employee

and you need to put the condition for this rule (Not Always True )

result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False

Regards

3
Avatar
Descartar
Remya

I have 4 types of leaves(Sick,legal,casual,unpaid). how can i generalize this? Did i want to create 4 separate salary rule?

Maath

@Remya you can use unpaid for unpaid leave and put salary rule for it (you can put more than one salary rule as you want)

Maath

@charlesaj first you should installed holiday model and have leave (named unpaid )

charlesraj
Autor

hi.. that error conditions occured at i calculate the payslip for employee who did n't take leave. The error is like. Error!

Wrong python code defined for salary rule Deduction Towards Leave Availed (DLA).

Maath

OK , But when Employee have unpaid leave will work successfully ,you just need condition to the salary rule (Not Always True ) (the condition will check if employee have leave then apply salary rule else don't do anything ) -I have edit my answer vote up and select as correct answer if solved your problem -

Remya

yes employess with unpaid leave run succesfully..

Maath

then add condition I have Edit my answer

charlesraj
Autor

ok now the problem is ok.. for employees without have leaves.. inorder to calculate the salary deduction(for leave days) from it i use "result= (contract.wage)*worked_days.Unpaid and worked_days.Unpaid.number_of_days or False". This will return the error. any way to implement it..

charlesraj
Autor

sorry i use result= (contract.wage/30)*worked_days.Unpaid and worked_days.Unpaid.number_of_days or False

Raminder Pal Singh

Same thing can be done for Half Day leaves also. You have to create leave type as half day and use the same code (replace unpaid with half day) and divide by 2

Maath

@charlesraj use the code in my answer please and tell me what the problem you need 1- salary rule 2- condition for this salary rule

charlesraj
Autor

sir i need to calculate the deduction for the leave days..ie. Now for one unpaid leave 1 is reduced from the net salary . But i want to deduce the total salary of particular leave day from the net salary..

charlesraj
Autor

condition for the salary rule.. Deduct the salary(days which employee take leaves) from the net salary .

Maath

do not understand , the deduction should be from Basic salary my dear , other deduction you can put it as input (by value or do code for it) hope that help you

charlesraj
Autor

i want to put code in the salary rule. now i applied your code. it make the deduction of salary for the number of leave taken. ie: what i say is If He/She take one leave ONE will be deduced from the net salary..

charlesraj
Autor

Thank sir it work for me....i will add like this....result=-(worked_days.Unpaid and worked_days.Unpaid.number_of_days*(contract.wage/30)) or False ...

Vaibhav

I added same rule and condition but it will not affecting on calculation of payslip amounts and so on....even that rule is not appearing on Payslip form view after clicked on compute sheet

Avatar
moh
Mejor respuesta

its worked but if leave less than day in payslip compute as 1 day

0
Avatar
Descartar
Avatar
Aby
Mejor respuesta

Half pay leave this worked 

result=(worked_days.Halfpaidsickleave and worked_days.Halfpaidsickleave.number_of_days*(contract.wage/30)/2) or False

0
Avatar
Descartar
Avatar
trinath
Mejor respuesta

S MY SELF TOO NO EFECT OVER IT.. IN COMPUTATIO FOLKS!!

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
leaves, salary and generating payslip
hr_payroll payslip leaves python2.7
Avatar
Avatar
1
mar 15
6597
Unpaid Leaves Deduction not working Resuelto
python code hr_payroll payslip leaves
Avatar
Avatar
Avatar
Avatar
16
nov 23
24314
How to calculate Pay Slip automatically Resuelto
hr_payroll payslip
Avatar
Avatar
Avatar
Avatar
Avatar
12
dic 23
33473
How to change PaySlip Format?
hr_payroll payslip
Avatar
0
jul 15
8089
HR manager cannot edit payslip for employee
hr_payroll payslip
Avatar
0
mar 15
4834
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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