Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3244 Vues

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
Ignorer

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

Meilleure réponse

 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
Ignorer
Publications associées Réponses Vues Activité
2
mars 24
1883
2
nov. 19
6747
1
févr. 24
1620
2
janv. 24
1941
1
mai 23
14337