Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
18690 Zobrazení

@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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 24
6123
3
srp 24
6982
4
čvc 24
41321
5
dub 23
99155
3
lis 22
4395