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

Hello All,

I want to call the method which should be run in backend at the time of record creation.

E.g. If I create POS Order, my process should be run in backend at the same time of creating record.

Can anyone suggest how to do?

Thanks

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Finally Done using python multiprocessing

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just use the create method in your sales order class,

import urllib2
def create(self, cr, uid, vals, context=None):
        # just put your code here...
        urlread = urllib2.urlopen("http://www.abc.com").read()
        return super(sale_order, self).create(cr, uid, context=context)

The above method calling when you click on the save button.

อวตาร
ละทิ้ง
ผู้เขียน

Thanks for the answer: i dont want call sequence i want send request to url(www.abc.com)

@Jack. I have edited the code. What do you want ?

ผู้เขียน

Yes i have try this code request send to url thats fine, but my problem is when request to url this url create order in magento and when order created in magento then my process is completed in ERP, it take time i have wait for that request complete, i want do this in backend

ok, I think you need to use server actions here is the link http://www.sharoonthomas.com/2009/09/open-erp-server-actions.html

ผู้เขียน

I have try server action, but still facing problem