I'm using OpenERP v7 and requesting this below output in Purchase order line window
PO0001 PO0002 PO0003
Line Line Line
10 10 10
20 20 20
30 30
My code:
_columns={
'line_no':fields.function(_get_line_no,string='Line No',type='integer', multi="lineno",store=True),
'next_line_no':fields.function(_get_line_no,string='Next Line No',type='integer', multi="lineno", store=True),
}
_defaults = {
'next_line_no':10,
'line_no':0,
}
def _get_line_no(self, cr, uid, ids, name, arg, context=None):
res = {}
nextno =0
total =0
for record in self.browse(cr, uid, ids, context=context):
no = record.next_line_no
next_no = nextno + no
total += next_no
res[record.id]={
'next_line_no':next_no,
'line_no': total,
}
return res
But im getting this kind of output . Any advice would be greatful.
PO0001 PO0002 PO0003
Line Line Line
10 40 60
20 50 70
30 80
Anyone could help me to achive the required output.
The same requirement used in the different way in the link http://stackoverflow.com/questions/21375392/openerp-v7-sequence-number
That output also what im getting now.Im not requesting that.