Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita 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
  • Proyectos
  • 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

How to create Salary rules?

Suscribirse

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

Se marcó esta pregunta
pythonhr_payrollrules
2 Respuestas
12893 Vistas
Avatar
priyankahdp

How to create q salary rule when worker works in holiday (1st of may,25 december) and we need to pay salary x 1.5?

WE also need to pay bonus when he worked preceding 3months with more than 75% attendance.

Can we create such rules or do we need to write method in Python ?

2
Avatar
Descartar
Cheikh Diop

<record id="extra_hr_salaire_hs" model="hr.salary.rule">
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">heure supplémentaire</field>
<field name="code">STAR0002</field>
<field name="appears_on_payslip">True</field>
<field name="sequence">00002</field>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">if worked_days.number_of_days > 30:
result = contract.wage + contract.wage * (worked_days.number_of_days-30) /100
else:
result = contract.wage </field>

Avatar
Cheikh Diop
Mejor respuesta

A partire des regel salarial , chaque models possede un ligne de communication sur l'autre models
# Available variables:
#----------------------
# payslip: object containing the payslips
# employee: hr.employee object
# contract: hr.contract object
# rules: object containing the rules code (previously computed)
# categories: object containing the computed salary rule categories (sum of amount of all rules belonging to that category).
# worked_days: object containing the computed worked days.
# inputs: object containing the computed inputs.


# Note: returned value have to be set in the variable 'result'


result = contract.wage * 0.10





record go here 

0
Avatar
Descartar
Cheikh Diop

<record id="extra_hr_salaire_hs" model="hr.salary.rule">
<field name="category_id" ref="hr_payroll.ALW"/>
<field name="name">heure supplémentaire</field>
<field name="code">STAR0002</field>
<field name="appears_on_payslip">True</field>
<field name="sequence">00002</field>
<field name="condition_select">none</field>
<field name="amount_select">code</field>
<field name="amount_python_compute">if worked_days.number_of_days > 30:
result = contract.wage + contract.wage * (worked_days.number_of_days-30) /100
else:
result = contract.wage </field>

Avatar
Mario Arias Badila
Mejor respuesta

You need to go with a new module.

One way to do this is inherit from hr.payslip, and patch the method get_inputs so that you go over employees attendance, check if worked on holidays and his attendance records and create inputs for them.

class hr_payslip(osv.osv):
    '''
    Pay Slip
    '''
    _inherit = 'hr.payslip'

    def get_inputs(self, cr, uid, contract_ids, date_from, date_to, context=None):
        res = super(hr_payslip, self).get_inputs(cr, uid, contract_ids, date_from, date_to, context=context)
        contract_obj = self.pool.get('hr.contract')

        for contract in contract_obj.browse(cr, uid, contract_ids, context=context):

            """
               Your code here to find out if emplooyee has more than 75% attendance.
               Suppose you set a flag called 'good_attendance'
            """
            input = {
                 'name': 'Attendance over 75 percent',
                 'code': 'ATTENDANCE_OVER_75',
                 'contract_id': contract.id,
                 'amount': good_attendance,
            }
            res += [input]

        return res

Then you create a rule that checks for ATTENDANCE_OVER_75 input and adds a bonus if true...

Similar will be for checking if employee worked on holidays...

0
Avatar
Descartar
priyankahdp
Autor

daily attendace how to entered.?seems no modules to capture employee;'s come or not.!

i got only leave management views

Mario Arias Badila

Check http://doc.openerp.com/v6.1/book/4/4_11_HR/4_11_HR_timesheet.html It explains time sheets and attendance management

priyankahdp
Autor

Thanks Mario

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

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

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Payroll rules with dates
python code hr_payroll rules
Avatar
Avatar
2
mar 15
7940
Record rules on same object with different CRUD options?
python rules
Avatar
0
feb 17
5478
How to sum previous payroll rule categories in Odoo 17
python payroll hr_payroll rules odoo17
Avatar
Avatar
1
nov 24
2254
Payroll Goal seek function
python hr_payroll excel
Avatar
Avatar
1
may 22
2668
HR Payroll Pay Roll - Python Rules.
python employee hr_payroll age
Avatar
1
jun 15
6925
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • 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 estar 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