Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
18612 Lượt xem

@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)

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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. 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 24
5958
3
thg 8 24
6827
4
thg 7 24
41119
5
thg 4 23
98780
3
thg 11 22
4244