跳至內容
選單
此問題已被標幟
2 回覆
1368 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
9月 25
1302
1
8月 25
713
1
4月 25
1690
1
9月 24
2364
1
7月 24
2104