Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
2737 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
jan. 25
6769
1
dez. 23
4935
2
nov. 22
4087
0
nov. 22
3917
0
out. 22
2212