Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2148 Vistas

Hello,

I want to add a computed field in the leave form for wage adversary if the employees take leave before the trial period, their wages should be an adversary.


Thank you in advance for any help


Avatar
Descartar
Mejor respuesta

Hi,

Here is an example:


from odoo import api, fields, models


class TestComputed(models.Model):

    _name = "test.computed"


    wage = fields.Float(compute="_compute_wage_adversary")

    trail_period = fields.Integer()


    @api.depends("trail_period")

    def _compute_wage_adversary(self):

    """You can write your condition here"""



Hope it helps

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
ene 25
6131
1
dic 23
3969
2
nov 22
3344
0
nov 22
3359
0
oct 22
1713