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.

-1

Override v7 onchange and add extra parameters

By
Mathieu Laflamme
on 3/14/16, 5:24 PM 410 views

I need to override 

onchange_picking_type(picking_type_id,partner_id) 

from stock.view_picking_form.

But I need to have the selected carrier_id as well in the parameters to do something with it.

How can I do that?

I can't use the new @api.onchange when there is already an existing v7 method in parent module because Odoo doesn't want to support that (very frustrating). They apparently live in a world we everything is in V8! Ok I feel better now...

I tried to do that in inherited view. It doesn't seems to do anything different.

<field name="partner_id" position="attributes">

<attribute name="on_change">onchange_picking_type(picking_type_id,partner_id,carrier_id)</attribute>

</field>

Any idea?

-1
Mathieu Laflamme
On 3/15/16, 4:51 PM

Ok so the issue is really the warning module that screw everything up.

To correct the problem, the warning module should be fixed. Instead of overriding onchange_picking_type [or call it from onchange_partner_id(partner_id)] , warning module is redefining the on_change attribute in the view which mute the original on_change:

<field name="partner_id" position="attributes">

<attribute name="on_change">onchange_partner_id(partner_id)</attribute>

</field>

Odoo team will most likely fix it in the next days... \https://github.com/odoo/odoo/issues/11342

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: 3/14/16, 5:24 PM
Seen: 410 times
Last updated: 3/24/16, 11:44 AM