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

Hi,


I am quite new to Odoo and I am trying to create custom field on mrp.workorder model. I have no access to server machine.


My new field will be x_productionweight and what I want to calculate is  x_productionweight = qty_production * x_product_weight. How can I do this? 

Avatar
Hylkää
Paras vastaus

I'm just know to it with python code

something like this

@api.depends('qty_production', 'x_product_weight')

def _compute_x_productionweight(self):

​for r in self:

​r.x_productionweight = r.qty_production * r.x_product_weight


Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
heinäk. 25
2338
2
heinäk. 25
7825
2
heinäk. 25
4218
2
heinäk. 25
4004
2
kesäk. 25
2594