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

I created a new button (check employees data) for hr_employee to check if we have multi employees who have the same name and same passport number and I created a new field employee_code.

I want when the user clicks this button the function will check for the employees who have the same names and passports numbers and fill employee_code for these employees with the same number.

Eg:

name| passport number| employee code

emp1       123                         10001

emp1       123                         10001

emp2      5555                       10002
emp1      0000                       10003

아바타
취소
베스트 답변

Hi,

  Inside the button click method you can search for employee records having same passport number and name .if such employee exists write the sequence number to our record.if doesnt exist assign a sequence number to it (like this self.env['ir.sequence'].next_by_code('sale.order', sequence_date=seq_date)

아바타
취소
작성자

Thank You, I was made the search but how can I write the sequence number to my existing records.

작성자

if exist it should be the same sequence number

관련 게시물 답글 화면 활동
5
8월 18
17318
1
6월 25
1205
0
4월 21
3070
0
10월 19
4553
1
3월 15
4069