Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3520 Zobrazení

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
Zrušit

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

Nejlepší odpověď

 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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
bře 24
2190
2
lis 19
7139
1
úno 24
1868
2
led 24
2248
1
kvě 23
14670