Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2218 Visualizzazioni

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! 

Avatar
Abbandona

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

Autore

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

Risposta migliore

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()


Avatar
Abbandona
Autore

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.

Autore

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

Post correlati Risposte Visualizzazioni Attività
0
ago 25
144
1
ago 25
2093
1
lug 25
2590
2
lug 25
8025
2
lug 25
4477