Hello all,
I have a new report defined for the model res.partner to print shipping label.
All these qweb lines print the correct fields content :
<span t-field="o.street"/>
<span t-field="o.zip"/>
<span t-field="o.country_id"/>
<span t-field="o.id"/>
But impossible to use this line :
<span t-field="o.id" t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": false}' />
I get this error with this last line :
Traceback (most recent call last):
File "/home/odoo/odoo-8.0-20161226/openerp/addons/base/ir/ir_qweb.py", line 600, in to_html
content = self.record_to_html(cr, uid, field_name, record, options, context=context)
File "/home/odoo/odoo-8.0-20161226/openerp/api.py", line 268, in wrapper
return old_api(self, *args, **kwargs)
File "/home/odoo/odoo-8.0-20161226/openerp/addons/base/ir/ir_qweb.py", line 951, in record_to_html
value_rec = value_rec.sudo().with_context(show_address=True)
AttributeError: 'int' object has no attribute 'sudo'
Why??? How could I use the contact widget in this report?
EDIT #1
Why does this line work :
<address t-field="o.parent_id" t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}' />
But not his one???
<address t-field="o.id" t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true, "no_tag_br": true}' />
I don't want address from the parent... I want address from the current partner...
EDIT #2
I can use this to get what I want. But i feel like a cheater...
<h3 t-field="o.name" />
<span t-if="o.street" t-field="o.street" /><br />
<span t-field="o.street2" /><br />
<span t-field="o.city"/>, <span t-field="o.state_id"/>, <span t-field="o.country_id"/><br />
<span t-field="o.zip"/><br />