跳至内容
菜单
此问题已终结
1 回复
4130 查看

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

形象
丢弃
最佳答案

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.

形象
丢弃
编写者

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.

相关帖文 回复 查看 活动
1
7月 24
1840
1
1月 24
4950
2
3月 23
2689
1
8月 22
2431
3
6月 20
10483