Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
10789 Ansichten

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.

Avatar
Verwerfen

Use super before calling your function.

Beste Antwort

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.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Sept. 15
6860
0
März 15
2990
0
März 15
4907
1
März 15
5051
2
Nov. 19
5088