Skip to Content
Menu
This question has been flagged
1 Reply
10882 Views

hello,

In this code how can I add the partner_id.title and make the partner_id.name on a new line?

<div class="col-xs-5 col-xs-offset-1">
   <div t-field="doc.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>
</div>


This looks now so:

COMPANY, NAME
STREET
ZIP CITY
COUNTRY

 

But it should look like this:

COMPANY
TITLE NAME
STREET
ZIP CITY
COUNTRY


The space above when you only have a company name is the problem. 


Can anyone help me ? I mean in a lot of countries there needs to be the name on a new line.

Thank you









Avatar
Discard
Best Answer

Try this code, maybe it can help you:

<tr>
    <td><strong> Recipient:</strong></td>
    <td>
	<t t-if="o.partner_id.company_type == 'person'">
	    <span t-field="o.partner_id.parent_id"/>
	</t>
	<t t-if="o.partner_id.company_type == 'company'">
            <span t-field="o.partner_id.name"/>
	</t>
</td> <td></td> </tr>  <tr> <td></td> <td> <t t-if="o.partner_id.company_type == 'person'"> <span t-field="o.partner_id.title"/>. <span t-field="o.partner_id.name"/> </t> <t t-if="o.partner_id.company_type == 'company'">  <span t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "phone", "fax"], "no_marker": True}'/> </t>
</td>   <td></td> </tr> <tr> <td></td> <td> <t t-if="o.partner_id.company_type == 'person'"> <span t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "phone", "fax"], "no_marker": True}'/> </t> </td> <td></td> </tr>
Avatar
Discard
Author

the title and name of the partner_id is on the same line as company name.

How can I break line after company name?

Author

it's impossible to split the customer name to a new line ???

did you try the above code? I tested that and post it to you. Its working fine the way you require

If you have noticed I have removed the field: " name" from the

<td><span t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["address", "phone", "fax"], "no_marker": True}'/></td> line. The "name" field is the one which shows company name,partner name.

Author

yes but the problem with that code is that when you only have a company, there is new space above. It should stay on the same line . When you print only a company without a contact there is a new blank space above the line.

yes , that is true, let me check

can you try the updated code.

Author

I added a <br/> in this line: <t t-if="doc.partner_id.company_type == 'person'"><br/>

and now its working fine, thank you very much

Welcome

Related Posts Replies Views Activity
2
Dec 19
7442
0
Oct 24
144
0
Oct 24
5
3
Sep 23
19231
1
May 23
1467