I have added one column named as "line_no" in POLine. Im trying to get the below structure. Please anyone help me
PO0001 PO0002 PO0003
Line Line Line
1 1 1
2 2 2
3 3
My code:
def default_get(self, cr, uid, ids, context=None):
res = {}
next_no = 0;
next_line_no =1
value=self.browse(cr,uid,ids,context=context)
obj = value[0]
next_no = next_no + value.next_line_no
total =+ next_no
res={
'next_line_no':next_no,
'line': total
}
return res
_columns={
'next_line_no':fields.integer(' Next Line No'),
'line_no':fields.function(_get_line_no,string='Line No',type='integer'),
}
Im getting error:
TypeError: %d format: a number is required, not unicode
Another Question
I will get order and order Id in another class by using below format
record_id = context.get('active_id')
orderid= self.pool.get('purchase.order.line').browse(cr, uid, record_id)
order = self.pool.get('purchase.order').browse(cr, uid, move_obj.order_id.id)
In Order Line Class How do get Order and Order Line ID.