Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4981 Widoki

If you put this in your rml report you get the address including the company name. Is it possible to do it without.

display_address(o.partner_id)

m2tecCompany  <--- (not included)

Foostreet 23

3454 BV BarCity

A customer wants to do this

m2tecCompany

t.a.v FooFoo de Contact

Foostreet 23

3454 BV BarCity

I do this the manual way in sales order like this. But then you loose the localisation templates that display_address() provides.

<para style="terp_default_9">[[ (o.partner_id.is_company == False and o.partner_id.parent_id.name) or "" ]] </para>

<para style="terp_default_9">[[ (o.partner_id.is_company == True and o.partner_id.name) or "t.a.v. "]] [[ (o.partner_id.is_company == False and o.partner_id.name) or ""]] </para>

<para style="terp_default_9">[[ o.partner_id.street]]</para> -->

<para style="terp_default_9">[[ o.partner_id.zip]]  [[ o.partner_id.city]] </para>

Awatar
Odrzuć
Autor Najlepsza odpowiedź

I have found you can change function definition in

server/openerp/addons/base/res/res_partner.py

 def _display_address(self, cr, uid, address, without_company=False, context=None):

to

def _display_address(self, cr, uid, address, without_company=True, context=None):

I was unable to override the default value in de report like this. Which I would prefer instead of editing the source code. I'am not sure about other consequences of this.

<para style="terp_default_9">[[ display_address(o.partner_id, without_company=True)]]</para>

 

Awatar
Odrzuć
Najlepsza odpowiedź

display_address uses the localisation, which is configured here:

Sales->Configuration->Address Book->Localization->Countries

Can you not modify these settings? Or is this template language too limited to add your logic for different customers?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lip 24
8510
0
kwi 17
3211
1
kwi 17
4592
2
lis 15
4934
0
mar 15
4699