Skip to Content
Menu
This question has been flagged
2 Replies
3511 Views

hello,


Using odoo V10 community

On the offers and invoices, I would like to avoid the "country name" print and replace it by the company phone number...

If I look in the export header, I see that the field "company_adress" is called (and this includes the country).


Thanks for your help

Avatar
Discard
Author Best Answer

Hello,


Many thanks for your help, I will follow your solution


best regards

Avatar
Discard
Best Answer

Hi Pascal de Clarens,

Top left header part of default odoo report will contain contact detail of company by using t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'

If you want to add phone number instead of country then first you have to replace the default report header.You can try below code:

<template id="external_layout_header" inherit_id="report.external_layout_header">
<xpath expr="//div[@name='company_address']" position="replace">
<div class="col-xs-6" name="company_address">
<t t-if="company.partner_id">
<span t-field="company.partner_id"/><br/>
</t>
<t t-if="company.partner_id.street">
<span t-field="company.street"/><br/>
</t>
<t t-if="company.partner_id.street2">
<span t-field="company.street2"/><br/>
</t>
//same way for city,state and zip
<t t-if="company.partner_id.phone">
<span t-field="company.partner_id.phone"/> //add phonenumber of company
</t>
</div>
</xpath>
</template>

Hope this may help you!

Regards, 

Avatar
Discard
Author

Hello, I tried to find the report.external_layout in reports but failed to find it.

I did find in configuration the RLM report with theese informations

<header>

<pageTemplate>

<frame id="first" x1="1.3cm" y1="3.0cm" height="21.7cm" width="19.0cm"/>

<stylesheet>

<!-- Set here the default font to use for all <para> tags -->

<paraStyle name='Normal' fontName="DejaVuSans"/>

<paraStyle name="main_footer" fontSize="8.0" alignment="CENTER"/>

<paraStyle name="main_header" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>

</stylesheet>

<pageGraphics>

<!-- Set here the default font to use for all <drawString> tags -->

<setFont name="DejaVuSans" size="8"/>

<!-- You Logo - Change X,Y,Width and Height -->

<image x="1.3cm" y="27.7cm" height="140.0" >[[ company.logo or removeParentNode('image') ]]</image>

<fill color="black"/>

<stroke color="black"/>

<!-- page header -->

<lines>1.3cm 27.7cm 20cm 27.7cm</lines>

<drawRightString x="20cm" y="27.8cm">[[ company.rml_header1 ]]</drawRightString>

<drawString x="1.3cm" y="27.3cm">[[ company.partner_id.name ]]</drawString>

<place x="1.3cm" y="25.3cm" height="1.8cm" width="15.0cm">

<para style="main_header">[[ display_address(company.partner_id) or '' ]]</para>

</place>

<drawString x="1.3cm" y="25.0cm">Phone:</drawString>

<drawRightString x="7cm" y="25.0cm">[[ company.partner_id.phone or '' ]]</drawRightString>

<drawString x="1.3cm" y="24.6cm">Mail:</drawString>

<drawRightString x="7cm" y="24.6cm">[[ company.partner_id.email or '' ]]</drawRightString>

<lines>1.3cm 24.5cm 7cm 24.5cm</lines>

<!-- left margin -->

<rotate degrees="90"/>

<fill color="grey"/>

<drawString x="2.65cm" y="-0.4cm">generated by Odoo.com</drawString>

<fill color="black"/>

<rotate degrees="-90"/>

<!--page bottom-->

<lines>1.2cm 2.65cm 19.9cm 2.65cm</lines>

<place x="1.3cm" y="0cm" height="2.55cm" width="19.0cm">

<para style="main_footer">[[ company.rml_footer ]]</para>

<para style="main_footer">Contact : [[ user.name ]] - Page: <pageNumber/></para>

</place>

</pageGraphics>

</pageTemplate>

</header>

Would you be kind enougth to help me further?

I would obviously consider in a positive way any fee demand...

best regards