Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
2979 Prikazi

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
Opusti
Best Answer

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
jan. 25
7004
1
dec. 23
5304
2
nov. 22
4335
0
nov. 22
4083
0
okt. 22
2409