Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3369 Ansichten

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
Verwerfen

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

Beste Antwort

 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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
März 24
2043
2
Nov. 19
6970
1
Feb. 24
1711
2
Jan. 24
2050
1
Mai 23
14485