I just started to develop for openerp and I'm stuck already for hours on this one:
I want to display all bill of materials with all products in the sale order for each product.
This is my class which inherits from "sale.order.line" which resides in my own module.
class sale_order_line(osv.osv):
_inherit = "sale.order.line"
def _get_bom(self, cr, uid, ids, field_name, arg, context=None):
result = {}
result[ids] = self.pool.get('product.bom_ids').browse(cr, uid, ids, context=context)
result[boms] = self.pool.get('mrp.bom').browse(cr, uid, ids, context=context)
return result
_columns = {
'bom': fields.function(_get_bom, method=True, string='Bill of Materials', type='text', store=False)
}
sale_order_line()
But when I use now [[ line.bom ]] in sale_order.rml I get the error message: Cannot eval 'line.bom' AttributeError: 'str' object has no attribute 'get'
What am I doing wrong? I guess it is just a simple programming mistake :(