Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3220 Weergaven

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?


 

Avatar
Annuleer

The value 1.19 is always fix? or coming from any other input field?

Beste antwoord

 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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mrt. 24
1851
2
nov. 19
6727
1
feb. 24
1602
2
jan. 24
1927
1
mei 23
14306