Odoo Help

0

please explain this strange override super behaviour

By
Joeri Belis
on 2/5/16, 9:35 AM 492 views

Without going into much detail...

overriding the _store_get_values of a custom model i have gives a different result when i return the super directly then when i use a temp result variable

def _store_get_values(self, cr, uid, ids, fields, context=None):
    return super(purchase_approval_item, self)._store_get_values(cr, uid, ids, fields, context)


returns

[(10, 'purchase.approval.item', [13484L], ['line_next_approver_id', 'next_approver_id', 'line_id', 'partner_id'])]

and 

def _store_get_values(self, cr, uid, ids, fields, context=None):
    result = super(purchase_approval_item, self)._store_get_values(cr, uid, ids, fields, context)
    return result

returns

[(10, 'purchase.approval.item', [13485L], ['line_id', 'next_approver_id', 'partner_id', 'line_next_approver_id'])]

You see the order of the fields ['line_id', 'next_approver_id', 'partner_id', 'line_next_approver_id'] is different.

What am i doing different or could be the reason of this behaviour?

Are you sure that you are calling exactly the same operation... the order can differ based on the operation. """Returns an ordered list of fields.function to call due to an update operation on ``fields`` of records with ``ids``, """

Jérémy Kersten (jke)
on 2/7/16, 8:45 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 2/5/16, 9:35 AM
Seen: 492 times
Last updated: 2/5/16, 10:25 AM