Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2759 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 1 25
6783
1
thg 12 23
4960
2
thg 11 22
4119
0
thg 11 22
3933
0
thg 10 22
2227