Odoo Help

Welcome!

This community 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.

0

please explain this strange override super behaviour

By
Joeri Belis
on 2/5/16, 9:35 AM 270 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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