Skip to Content
Menu
This question has been flagged
1 Atsakyti
2814 Rodiniai

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


Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
saus. 25
6837
1
gruod. 23
5074
2
lapkr. 22
4181
0
lapkr. 22
3965
0
spal. 22
2268