跳至内容
菜单
此问题已终结
1 回复
2683 查看

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

形象
丢弃
相关帖文 回复 查看 活动
2
1月 25
6715
1
12月 23
4855
2
11月 22
4014
0
11月 22
3832
0
10月 22
2172