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

Hi,


on the report_invoice_document, there is shipping address on the top left of the report

For single invoice it is ok but for a grouped invoice, it is not because this invoice concern many customers with different shipping address

Also for a grouped invoice, i would like to remove (or hide) this address


I know that report_invoice_document call external_layout wich call external_layout_standard wich call address_layout

And in this address_layout, there is information_block wich print this address (if i understood how it works)


How is it possible to remove/hide this information_block from report_invoice_document (in fact from an inherited view) ? Of course, i don't want to remove/hide this address for the others reports.


Good evening

Vincent

Avatar
Discard
Author Best Answer

Thank you Ray, it works but it removes shipping address for any invoices, grouped or not

Do you have an idea to remove it only for a grouped invoice ?


EDIT : 

I found solution by myself

Find below my code (in the inherited view of sale.report_invoice_document_inherit_sale) if it could help someone :


<?xml version="1.0"?>

<data inherit_id="sale.report_invoice_document_inherit_sale">

    <!--We replace the delivery address block for the condition that the company linked to the delivery address is the same as the invoiced company-->

    <xpath expr="//address" position="after">

        <t t-if="o.partner_shipping_id and (o.partner_shipping_id.parent_id == o.partner_id)">

            <t t-set="information_block">

                <div groups="sale.group_delivery_invoice_address">

                    <strong>Adresse de livraison:</strong>

                    <div t-field="o.partner_shipping_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: True}"/>

                </div>

            </t>

        </t>

    </xpath>

    <!--And we remove the address block added by the parent view-->

    <t t-if="o.partner_shipping_id and (o.partner_shipping_id != o.partner_id)" position="replace"/>

</data>


Thank you very much for your help Ray :)


Vincent

Avatar
Discard
Best Answer

v13:


Avatar
Discard