Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1371 Переглядів

I added a screen to the Done button on mrp.workorder that asks for scrap details such as quantity and defect type. I want to call this Done button from another model. This way I can press done on multiple work orders. To do this I need to pass in the quantity and defect type and do it all through python. Any suggestions on how to do this?

Odoo 13 CE. 

Аватар
Відмінити
Найкраща відповідь

Please try below code:

self.env['model.name'].sudo().method_name(args)
Аватар
Відмінити
Найкраща відповідь

Hi,

Using the active id from the wizard model you can browse the manufacturing record: https://www.youtube.com/watch?v=QRXvW5yCoF8&t=8s

Thanks

Аватар
Відмінити
Автор

Thanks for the reply. I'm familiar with using active_id from wizard to get the parent record.

Basically I want to use the method in this Wizard from a different module. I could re-use all this code and replace the user inputs that would be in the wizard with variables I pass into the method but I'd rather just call the wizard code that's already there. I hope this makes sense.