2015-03-27 15:11 GMT+01:00 Sergi Almacellas Abellana <[email protected]>:

> 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!
>

Sure! Thanks a lot Sergi


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



-- 

Jesús Martín

Zikzakmedia SL
C/ de Sant Jaume, 9, baixos, 2ª
08720 Vilafranca del Penedès
☏ 93 890 21 08

Reply via email to