Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2796 Переглядів

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


Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
січ. 25
6813
1
груд. 23
5025
2
лист. 22
4154
0
лист. 22
3953
0
жовт. 22
2251