*) Why did you have to change the browse for a read method in this iteration:
for form in self.read(cr, uid, ids, context=context):
for form in self.browse(cr, uid, ids, context=context):
Which resulted in you to change a bit of code downstream.
browse is one method recommended by openerp to use within the code
*) When accessing the date field you made a split and after
that you try to look for periods following the code which you
assume will _always_ be dash (-) separated,
date = wzr_brw.date and wzr_brw.date.split('-')
period = wzr_brw and wzr_brw.period and wzr_brw.period.id
period_ids = date and len(date) == 3 and period_obj.search(cr,uid,[('code','=','%s/%s'%(date[1],date[0]))],context=context)
please use instead the same date without splitting it, and
when look for the periods use the date though this time instead
of the code use date_start>= date and date_end <= date and special=False
In general It Looks Ok,
Some issues,
*) Why did you have to change the browse for a read method in this iteration:
for form in self.read(cr, uid, ids, context=context):
for form in self.browse(cr, uid, ids, context=context):
Which resulted in you to change a bit of code downstream.
browse is one method recommended by openerp to use within the code
*) When accessing the date field you made a split and after
that you try to look for periods following the code which you
assume will _always_ be dash (-) separated,
date = wzr_brw.date and wzr_brw. date.split( '-') obj.search( cr,uid, [('code' ,'=','% s/%s'%( date[1] ,date[0] ))],context= context)
period = wzr_brw and wzr_brw.period and wzr_brw.period.id
period_ids = date and len(date) == 3 and period_
please use instead the same date without splitting it, and
when look for the periods use the date though this time instead
of the code use date_start>= date and date_end <= date and special=False
this way it will be Period Code independent
Best Regards