Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
18700 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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.

Avatar
Abbandona
Risposta migliore

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. 

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
dic 24
6132
3
ago 24
6988
4
lug 24
41337
5
apr 23
99189
3
nov 22
4407