Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
1304 Vizualizări

Hi, 

maybe someone can help me out here.

We use ODOO 17 and when a contact has VAT-Number entered, it is printed on the Invoice.

We already found, where to "hide" that. However I am unable to print it in another location.

I simply do not now how.


So we removed/commented in "report-invoice-document", which dies work. But I am unable to get it printed anywhere else. We want it printed where the list for Date, Source and Ref is displayed... but how?


Maybe anyone can help me here?


Thank you in advance!


            
               
               
               

                   
                       

                           
                               

                                    Shipping Address:
                                   

                               

                           
                       

                       

                           
                               

                               

                               
                               

                           
                       

                   
                   
                       

                           
                               

                               

                                   
                               

                           
                       

                   
                   
                       

                           
                               

                               

                                   
                               

                           
                       

                   
               

               



Imagine profil
Abandonează
Cel mai bun răspuns

Hey Jörg, I'm running into the same kind of issues for a german report, also using DIN5008 for this. How did you end up hiding the VAT from the information block in the first place? I tried a lot of xpaths and workarounds and that didn't work... Your help would be greatly appreciated!
As for how to place it elsewhere, I did it by overriding the _compute_l10n_din5008_template_data method on account_move and added the VAT field in there!

EDIT : Ended up replacing the whole block from external_layout_din5008 like so (and just left out the VAT part) :
<xpath expr="//div[hasclass('address')]" position="replace">

I just needed to also add the phone back as it was added with the VAT infos so I put it back in the fallback like so :
<t t-out="o.partner_id.phone"/>

Hope it helps someone else at some point :)

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Thank you for you response.

Can you point me a bit more in the right direction, where to place/create this?

Update: I guess all is right but we use the DIN5008 template, and it looks like this needs some "special" handling to add another field. Maybe someone can point me in the right direction where to change this?

Regards

Imagine profil
Abandonează
Cel mai bun răspuns

Hello


Please use this code ,


<template id="report_custom_invoice_document" inherit_id="account.report_invoice_document">

            <xpath expr="//div[@id='informations']" position="inside">

                <div t-attf-class="#{'col-auto col-3 mw-100' if report_type != 'html' else 'col'} mb-2" t-if="o.partner_id.vat" name="vat">

                    <strong>Vat:</strong><br/>

                    <span t-field="o.partner_id.vat"/>

                </div>

            </xpath>

        </template>



Thankyou.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iul. 25
1395
0
ian. 25
1174
1
mai 24
2005
2
apr. 24
2007
2
feb. 24
1378