Skip to Content
मेन्यू
This question has been flagged
1 Reply
2674 Views

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
Discard
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
Discard
Related Posts Replies Views Activity
2
जन॰ 25
6707
1
दिस॰ 23
4845
2
नव॰ 22
4006
0
नव॰ 22
3819
0
अक्तू॰ 22
2168