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
2724 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
6756
1
pro 23
4916
2
lis 22
4074
0
lis 22
3908
0
říj 22
2205