Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1491 มุมมอง

Hi,

we want to customize invoice layout while using DIN5008 report layou addon.

We want do display partner VATID on the right side in the information block instead of the adress-zone. Can anyone help where to change this. The default reports do not honor this settings, so it look like it is in one of the files in addon-dir?


"l10n_din5008.external_layout_din5008"

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks for your reply. I get the whole idea. However, when I try to save your example I get something like "block not found" in inherited view?


Element „

“ kann nicht in der übergeordneten Ansicht lokalisiert werden
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

To make customization you need to inherit the current  "external_layout_din5008" template and add the VAT information inside the information div

example:

<template id="inherit_external_layout_din5008"

inherit_id="l10n_din5008.external_layout_din5008">

<xpath expr="//div[hasclass('information_block')]"

               position="replace">

                                <div class="information_block"

                                     style="margin-bottom: -5mm; margin-left: 5mm;">

<t t-if="'l10n_din5008_template_data' in company"

                                       t-set="template_data"

t-value="company.l10n_din5008_template_data"/>

                                    <t t-if="o and 'l10n_din5008_template_data' in o"

                                       t-set="template_data"

t-value="o.l10n_din5008_template_data"/>

                                    <table>

                                        <t t-foreach="template_data"

                                           t-as="row">

                                            <tr>

                                                <td>

                                                    <t t-out="row[0]"/>

                                                </td>

                                                <td>

                                                    <t t-out="row[1]"/>

                                                </td>

                                            </tr>

                                        </t>

                                        <t t-if="delivery_det">

                                            <tr t-if="delivery_det.origin">

                                                <td t-if="delivery_det.origin"

                                                    name="div_origin">

                                                    <strong>Order:</strong>

                                                </td>

                                                <td>

<span t-field="delivery_det.origin"/>

                                                </td>

                                            </tr>

                                            <tr name="div_sched_date">

                                                <td t-if="o.state"

                                                    class="col-auto"

                                                    name="div_sched_date">

                                                    <strong>Shipping Date:

                                                    </strong>

                                                </td>

                                                <td>

                                                    <span t-if="delivery_det.state == 'done'"

t-esc="delivery_det.date_done.date().strftime('%d/%m/%Y')"/>

                                                    <span t-else=""

t-esc="delivery_det.scheduled_date.date().strftime('%d/%m/%Y')"/>

                                                </td>

                                            </tr>

<tr t-if="delivery_det.sale_id.user_id">

                                                <td>

                                                    <strong>Sales Person

                                                    </strong>

                                                </td>

                                                <td>

<span t-esc="http://delivery_det.sale_id.user_id.name" target="_blank">delivery_det.sale_id.user_id.name"/>

                                                </td>


                                            </tr>

                                        </t>

                                        <tr t-if="company.vat">

                                            <td >

                                                VAT No.

                                            </td>

                                            <td>

                                                <t t-out="company.vat"/>

                                            </td>

                                        </tr>

                                        <tr t-if="payment_term">

                                            <td>

                                                Payment Terms

                                            </td>

                                            <td>

                                                <t t-esc='payment_term'/>

                                            </td>

                                        </tr>

                                    </table>

                                </div>

        </xpath>

    </template>



The above is just an example of inheriting the layout template and replacing the information block div to add the company VAT inside it.

-- 

   

       


   


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ย. 25
1383
1
ส.ค. 25
911
1
เม.ย. 25
1814
1
ก.ย. 24
2544
1
ก.ค. 24
2251