<div>Hi Dev,</div><div>Thanks a lot Dev for your reply. It is really a great help.  Yes i have fixed what was wrong in the create method like log.debug. I have declared line_counter=1 before the for loop.  i will try now to chcek the value of  payment_line.</div>
<div> </div><div>Thanks again a lot. I am greateful be a member of this forum :) <br><br></div><div class="gmail_quote">On Sat, Dec 29, 2012 at 6:10 PM, Dave Angel <span dir="ltr"><<a href="mailto:d@davea.name" target="_blank">d@davea.name</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div class="im">On 12/29/2012 11:54 AM, Morten Engvoldsen wrote:<br>

> Hi Dave,<br>
</div><div class="im">> Thanks a lot for your reply. I have used logging.setLevel(logger.DEBUG)<br>
> because of threshold as you said.<br>
><br>
> I didn't copy paste the entire program since it was very huge. The "batch "<br>
> which value i am trying to retrieve is in a a for loop :<br>
><br>
> for payment in payment_line:<br>
><br>
> but here payment_line has null value since it was not able to retrieve<br>
> payment line value from the payment object.<br>
<br>
</div>The closest thing Python has to "null value" is called None.  If<br>
payment_line is None, then you'll get an exception on that loop.<br>
<br>
As I said a while ago, I have no idea how openerp handles exceptions.<br>
Maybe it's just doing a bare except, and ignoring anything that goes<br>
wrong in your functions.  (Very bad practice)<br>
<br>
It could be that payment_line is an empty list.  In that case, the loop<br>
will execute zero times.  That would also explain the lack of output.<br>
<br>
So if openerp gives you no debugging aid, then you may have to fake it<br>
with the logger.  How about logging a simple message just before the loop?<br>
<br>
logger.debug("value of payment_line is " + repr(payment_line))<br>
<br>
Did you ever fix the other things wrong with that create method?  Like<br>
using log.debug when the object was called logger?  Or incrementing<br>
line_counter when there was no such variable, and when it would vanish<br>
when you exited the method anyway?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
<br>
DaveA<br>
</font></span></blockquote></div><br>