Odoo Help

0
1
Sudhir Arya (ERP Harbor Consulting Services)
On 1/11/19, 6:12 AM

You should create a compute type of field which will calculate the rate from the o2m field.

Ex:

total_rate = fields.Float(compute='_compute_rate', string="Total Biaya Parkir")

@api.multi
def _compute_rate(self):
for rec in self:
rec.total_rate = sum(line.my_rate_field for line in rec.parking_log_ids) # replace my_rate_field by the field inside your o2m


thank you for the answer sir, i update my question

what I want is to calculate the value in o2m(parking_log_ids) that is field 'total_rate' to 'total_bill_id'.

i mean if i have value in o2m on field 'total_rate', I want to calculate the value and save it in the 'total_bill_id' field

Fazryan
on 1/14/19, 1:46 AM

I pulled my question, it was completed with an answer from you before.

thanks you sir :D

Fazryan
on 1/14/19, 1:54 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/11/19, 5:24 AM
Seen: 79 times
Last updated: 1/14/19, 1:50 AM