Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4132 มุมมอง

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 24
1841
1
ม.ค. 24
4951
2
มี.ค. 23
2689
1
ส.ค. 22
2432
3
มิ.ย. 20
10486