Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
2815 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
jan. 25
6837
1
dec. 23
5074
2
nov. 22
4181
0
nov. 22
3965
0
okt. 22
2268