跳至内容
菜单
此问题已终结
1 回复
3231 查看

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?


 

形象
丢弃

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

最佳答案

 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

形象
丢弃
相关帖文 回复 查看 活动
2
3月 24
1857
2
11月 19
6732
1
2月 24
1608
2
1月 24
1930
1
5月 23
14309