I need to show the label
or title
of a field in OpenErp.
I have a piece of code in the purchase
module that retrieves company_id, partner_id, date_order, etc
from the form, and then show these fields values in a concatenated way:
def _combinalos(self, cr, uid, ids, field_name, args, context=None):
values = {}
for id in ids:
rec = self.browse(cr, uid, [id], context=context)[0]
values[id] = {}
values[id] = '0%s-%s%s-%s-%s' %(rec.company_id, rec.partner_id, rec.soli_cant, rec.dest, rec.date_order)
return values
Then i call this function like:
'nombre' : fields.function(_combinalos, type='char', string='Nombre', arg=('empresa','provee','soli_cant', 'dest', 'anho'), method=True),
And of course the XML view code:
<h1>
<label string="Request for Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
<label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
<field name="nombre" class="oe_inline" readonly="1" />
</h1>
Being nombre
the function field.
Problem is, when i save the document, it should show me the names or labels for these fields, but just shows me like the ID of the field or something:
So, how could i show the 'name' or 'label' for these fiels? Is it maybe some attribute in the xml field call?
Thanks in advance.