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

Hi! I try override method 'write' when create and update objects for sync with db Magento. At the moment, my method first sync with Magento and then save change.

    def write(self, cr, uid, ids, vals, context=None):

        self.ex_bulk_prod(cr, uid, ids[0], context)
        return super(product_product, self).write(cr, uid, ids, vals, context=context)

Please anybody prompt me, how make first to save change and only then sync with Magento.

อวตาร
ละทิ้ง

Use super before calling your function.

คำตอบที่ดีที่สุด

Like Tobiasz adequetly responds, the super call is the call to the original save change. So the sooner the super call is done, the sooner you will save.

Note however: If the synced call to magento also prompts some changes, then you might need to save again.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ย. 15
6831
0
มี.ค. 15
2961
0
มี.ค. 15
4898
1
มี.ค. 15
5017
2
พ.ย. 19
5059