El 27/03/15 a les 15:08, Jesús Martín Jiménez ha escrit:
Hi,

I've been looking for the way to override the static method
_get_origin() of purchase.request in order to add another possible
origin to this model, but I couldn't figure out how to do it. All
methods I could see to do so are class methods. Have anyone any idea of
how to do it? Or maybe I must override the get_origin() class method
instead.

You must override it as classmethod. So you are able to call the _get_orgin function of super call.

@classmethod
cls _get_origin(cls):
    origins = super(PurchaseRequest, cls)._get_origin()
    # make whatever you need with origins
    return origins

Hope it helps!


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Reply via email to