Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2722 Представления

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
6756
1
дек. 23
4914
2
нояб. 22
4070
0
нояб. 22
3906
0
окт. 22
2200