Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4136 Widoki

Just wondering is there a way to call a method on launch of the module? meaning when i starts up?

Awatar
Odrzuć
Najlepsza odpowiedź

What do you mean by 'when it starts up' ?

Do you mean when the module is installed or upgraded? If so, define an init function:

def init(self, cr):

Several OpenERP modules make use of this functionality, particular models representing reports.

Awatar
Odrzuć
Autor

like when you double click on the firefox browser icon the browser 'starts up' when you select the module from the menu bar it starts up. cant make it any clearer than that really

No. Modules don't work this way. They are loaded or 'started up' when they are installed (the init function above can run at this time) and any other functions within them are only called when records are read, created, updated or deleted.

Powiązane posty Odpowiedzi Widoki Czynność
1
lip 24
1843
1
sty 24
4956
2
mar 23
2691
1
sie 22
2445
3
cze 20
10492