Odoo 10
for example: a float x_uvp is in sale.order. i want to calculate x_uvp /1,19.
What do i have to put into depends and calculate?
Odoo 10
for example: a float x_uvp is in sale.order. i want to calculate x_uvp /1,19.
What do i have to put into depends and calculate?
Have you checked the ORM API documentation (https://www.odoo.com/documentation/9.0/reference/orm.html#computed-fields)?
Are you going to add an additional field to the model? If so something like the following should work.
x_uvp_display = fields.Float(string='UVP scaled'. compute='_compute_x_uvp_display')
@api.onchange('x_uvp')
@api.depends('x_uvp')
def _compute_x_uvp_display(self):
for rec in self:
rec.x_uvp_display = rec.x_uvp / 1.19
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|
2
maalisk. 24
|
3857 | |||
|
2
marrask. 19
|
8917 | |||
|
1
helmik. 24
|
3242 | |||
|
2
tammik. 24
|
3726 | |||
|
Odoo compute field Integer // int
Ratkaistu
|
1
toukok. 23
|
16669 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
The value 1.19 is always fix? or coming from any other input field?