Hello all, I've spent a lot of time to find out what's wrong but without result :( In my class 'freelance_pricecombi' which is called in my class freelance as this
'pricecombi': fields.one2many('freelance.pricecombi', 'freelance_id','Price-Combi'), I've got his function def _compute_price_mark(self, cr, uid, ids, field_name, arg, context={}): result = {} for id in ids: freelance_pricecombi = self.browse(cr, uid, id, context=context) res = 0 tarif = (freelance_pricecombi.price * 100 / freelance_pricecombi.combination['target_rate']) - 100 if (tarif <20>= -20) and (tarif <10>= -10) and (tarif <10> 10) and (tarif <30>= 30) and (tarif <60>= 60) : res = 0 result[id] = res return result With this field : 'price_mark_func':fields.function(_compute_price_mark, method=True, type='integer', string='Mark on price', store=False, readonly=True ), When I register a pricecombi for the first time it works well but when I try to register a second time I've got 'key error' with the first records 'ID' In my database I can see the second record but not in the ERP ! Any Ideas ???? Thanks a lot :) -------------------- m2f -------------------- -- http://www.openobject.com/forum/viewtopic.php?p=60243#60243 -------------------- m2f -------------------- _______________________________________________ Tinyerp-users mailing list http://tiny.be/mailman2/listinfo/tinyerp-users