跳至內容
選單
此問題已被標幟
2 回覆
18606 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 24
5952
3
8月 24
6825
4
7月 24
41107
5
4月 23
98773
3
11月 22
4243