Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
1602 Näkymät

hi. 

im looking for a method that runs when a form opens and can be overriden in odoo 16 to run custom code before the form opens.

i want to run custom code when crm pipeline opens.

hope someone can help

Avatar
Hylkää
Paras vastaus

Hi,

You can use the '_get_view' method in the crm_lead model.

@api.model
   def _get_view(self, view_id=None, view_type='form', **options):
       arch, view = super()._get_view(view_id, view_type, **options)
       custom code here
       return arch, view


Hope it helps​

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
marrask. 24
1722
1
huhtik. 24
2171
3
kesäk. 23
2533
1
syysk. 21
9525
1
tammik. 24
17094