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

Hello everybody, I have a little problem that I don't know how resolve it. In my personal module, when the manager of the department approves a employee form, the data is passed to a external table, but one of the fields (a integer) changes from 1 to 2 when the data is passed.

My problem is the following, the manager makes a second approvement when the integer field is 3, so I would like to know if is possible check it in Odoo when in the external table the integer value is changed from 2 to 3.


Thank you.


아바타
취소
베스트 답변

It's difficult to assess the best strategy without knowing how it's all set up, but a write hook could be useful if the external table has a link to the manager. On employee form it would look something like this:

def write(self, vals):
    for rec in self:
        if rec.<integer_field> == 2 and vals.get('<integer_field>') == 3:
            rec.employee_id.manager_id.<let_manager_know>()
    return super(<ManagerClass>, self).write(vals)

Generally it's easier to check for a change at the source unless it's for a computed field, in which case a depends is your best bet.

아바타
취소
작성자

Finally I made it with a little cron, but thanks for your answer!

관련 게시물 답글 화면 활동
1
1월 18
4290
3
10월 16
7056
1
9월 17
3706
3
7월 17
3866
1
5월 16
10296