Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3066 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
led 25
7165
1
pro 23
5527
2
lis 22
4478
0
lis 22
4178
0
říj 22
2510