Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3009 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
5
ส.ค. 18
16319
1
มิ.ย. 25
496
0
เม.ย. 21
2528
0
ต.ค. 19
4002
1
มี.ค. 15
3543