콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3025 화면

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
7070
1
12월 23
5415
2
11월 22
4399
0
11월 22
4120
0
10월 22
2467