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

@api.one def create_employee(self):

        active_id = self.env.context.get('active_ids', []) or [] record = self.env['op.faculty'].browse(active_id) record.create_employee() if self.user_boolean and not record.user_id:

            user_group = self.env.ref('openeducat_core.group_op_faculty') self.env['res.users'].create_user(record, user_group)

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Dear Arunagiri,

Active ids is simply current record's id. When Form view of record is opened its id will be passed in context as active_ids. 

While Creating new record , in context('active_ids') will contain id of creating record. that means id of nextval(models table).


Thankyou.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Active id is the id of the active record.Wizard records will not be  saved in our database so we use this active id for saving datas in our wizard. 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 24
6035
3
ส.ค. 24
6882
how to know the odoo master password? แก้ไขแล้ว
4
ก.ค. 24
41196
Default value in form view แก้ไขแล้ว
5
เม.ย. 23
98930
3
พ.ย. 22
4319