Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2201 Vizualizări

I need to call Python function of mrp class in delivery slip report in stock.picking. It works if function is in stock_picking class. 

Any help is appreciatable! 

Imagine profil
Abandonează

From the stock.move you can access the manufacturing order using the field: raw_material_production_id or production_id

Autor

Couldn't get you? I need to call Python function which is in mrp class in qweb delivery slip report.

Cel mai bun răspuns

You just need a recordset of the "mrp.production" object to call the method.

Ex:

production = self.env['mrp.production'].browse(mrp_production_id)
production.mrp_method()


Imagine profil
Abandonează
Autor

How must i give it in qweb in t-call method?

You can call the method in qweb as well.

Ex:

<t t-set="method_data" t-value="o.env['mrp.production'].browse(mrp_production_id).mrp_method()"/>

Now, you can use this method_data as a variable.

Autor

It doesn't work. I don't understand what is the use of mrp_production_id?

Related Posts Răspunsuri Vizualizări Activitate
0
aug. 25
95
1
aug. 25
2045
1
iul. 25
2573
2
iul. 25
8010
2
iul. 25
4458