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
&nbsp; &nbsp;&nbsp; &nbsp;if&nbsp; &#40;tarif <20>= -20&#41; and &#40;tarif 
<10>= -10&#41; and &#40;tarif <10> 10&#41; and &#40;tarif <30>= 30&#41; and 
&#40;tarif <60>= 60&#41;&nbsp; &#58;
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;res = 0
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result&#91;id&#93; = res
&nbsp; &nbsp;&nbsp; &nbsp;return result 


With this field : 

'price_mark_func'&#58;fields.function&#40;_compute_price_mark, method=True, 
type='integer', string='Mark on price', store=False, readonly=True &#41;,

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

Reply via email to