跳至內容
選單
此問題已被標幟
1 回覆
2727 瀏覽次數

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
6759
1
12月 23
4921
2
11月 22
4078
0
11月 22
3912
0
10月 22
2206