78. Active Id In Odoo Development || Odoo active_id || Get Data From Main Model inside Wizard Model
HTML-код
- Опубликовано: 8 сен 2024
- Working and use of active_id in odoo. Get data from main model inside wizard model. Usage of active_id in odoo development. Odoo 15 tutorial. Odoo 15 development videos. Working of active_id in Odoo. Odoo mates videos.
Odoo 15 Playlist: • How To Configure Odoo1...
Website: www.odoomates....
Instgram: / odoomates
Github: github.com/odo...
Email : odoomates@gmail.com
Facebook: / odoomate
Twitter: / odoomates
Support Us in Ko Fi : ko-fi.com/odoo...
Hi, I have two questions please:
- How can we load the values of other fields (ex. "date") of the main model active record other then the "id" ?
- How to save back changes done in wizard fields record into the main model record ?
From the default_get method, we can get main record, by browsing the active_id and then we can access any value from the main model
To save back value to original model,
main_rec = self.env['main_model'].browse(active_id)
main_rec.field = new_value
@@OdooMates I tried:
res[‘field_name’] = self.env.context.get(‘active_id.field_name’) but it return context none.
@@OdooMates U mean I should use the “Browse” method instead of “Get” ?
@@SamirSELLAMI we have to browse the record by getting the active_id from context
Thanks 👍👍👍
Welcome 👍
Thanks
Welcome
good video, do you have tutorial regarding passing one2many fields record from models.Model to transientModel?
Can we upload documents to attachments via wizard?
how to acess many2many field in wizard .it shows not allowed to access error
how to point to specific active_id in active_ids?
active_ids is list, lets say, it is [4,3,2,1]
from this list on what basis you need to get a specific one ?
@@OdooMates if you use browse method it would retrieve a list?