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
2580 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
6600
1
pro 23
4674
2
lis 22
3878
0
lis 22
3710
0
říj 22
2044