Hi all,
I have a custom model to which I have added the "standard" address fields. Namely: name, street, street2, city, country_id, state_id. I also have website, phone and email
I have a qweb report and I want to use the contact widget to format this address. I have the following code snippet in the report:
<span t-field="o.mymodel_id" t-if="o.mymodel_id"
t-field-options='{"widget": "contact", "fields": ["address", "city", "name","email","phone","website"], "no_marker": true}'
style="border-bottom: 1px solid black; display:inline-block;"/>
The address that prints on the report shows city,email, website. name and phone but no street address. I have added a compute field to my model to provide the address field. I searched the code base for example code to define and return an address but couldnt find where this field in defined for the core classes. This is what I tried but the street details will not print.
address = fields.Char(compute="_address", readonly=True)
@api.multi
@api.depends('street', 'street2')
def _address(self):
for rec in self:
rec.address = rec.street+"\n" + rec.street2