Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
3559 Näkymät

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
Hylkää
Tekijä Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
lokak. 21
342
1
toukok. 17
3057
5
huhtik. 17
7546
3
marrask. 15
7186
1
maalisk. 15
5514