hi all,
I have a problem hearts Making subtotal method , the method for Only thing I can last column displays the data in Saja NOT want to add BETWEEN column 1 and column 2 , I 've Tried differences Only the results are still the same and this is the method that I created
def _get_total(self,a):
total =0
for o in a :
total +=(o['cost_spare_part'] *o['jumlah'])
print "ini total=================>>>>>>>>>>",total
return total
Hi Akhil P Sivan [1] A variable is the name of the table on parts_lines or a = parts_lines in this parts_lines table I want to take the price of spare parts and the number but when I took the price ( standard_price ) that are on the object , but when I took my product.product standard_price even error a ={'jumlah': 2.0, 'asset_name': u'Kendaraan', 'plat_no': u'A 2338 AB', 'asset_no': u'1.11 Asset', 'tindakan': False, 'pelaksana': False, 'satuan': u'Unit(s)', 'permasalahan': u'as', 'spare_part': u'ban', 'tanggal': '2015-01-28 06:55:11', 'cost_spare_part': 50000.0} of the answer that you gave no error occurs, the error like this : for o in self : TypeError: 'history_maintenance' object is not iterable [1] https://www.odoo.com/forum/help-1/user/336884
How and where you call _get_total?
The method to call formatLang (get_total (o)) and this for at RML (report)
Hi Yusuf, I made a change in the answer. Please try like that. Are you can calling the 'part_lines' field as one2many from any other object? Where you want to get the 'total_cost' value returning from the function?