Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3555 Prikazi

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?

Avatar
Opusti
Avtor Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
okt. 21
342
1
maj 17
3052
5
apr. 17
7543
3
nov. 15
7182
1
mar. 15
5511