html - 账户发票报表税表

标签 html css openerp odoo-9 qweb

我有服装模型,可以在发票报告中添加一些字段,但我需要上移税表。我需要删除行吗? 是通过做这样的事情来完成的吗?

<xpath expr="//div[@class='row mt32 mb32']" position="attributes">
                <attribute name="class">row mt8 mb8</attribute>
            </xpath>

enter image description here

已编辑: 我正在扩展 Account invoice report addons/account/report_invoice.xml 下面是我想向上移动的表格。我无法通过这里的所有报告,因为它太大了。

EDIT2
https://github.com/odoo/odoo/blob/9.0/addons/account/views/report_invoice.xml链接到原始报告。我想沿着旁边的小计表向上移动税表。 :)

   <div class="row">
                <div class="col-xs-4 pull-right">
                    <table class="table table-condensed">
                        <tr class="border-black">
                            <td><strong>Subtotal</strong></td>
                            <td class="text-right">
                                <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                            </td>
                        </tr>
                        <t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group">
                            <tr>
                                <td><span t-esc="amount_by_group[0]"/></td>
                                <td class="text-right">
                                    <span t-esc="amount_by_group[1]"/>
                                </td>
                            </tr>
                        </t>
                        <tr class="border-black">
                            <td><strong>Total</strong></td>
                            <td class="text-right">
                                 <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <div class="row" t-if="o.tax_line_ids">
                <div class="col-xs-6">
                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Tax</th>
                                <th class="text-right">Base</th>
                                <th class="text-right">Amount</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr t-foreach="o.tax_line_ids" t-as="t">
                                <td><span t-field="t.name"/></td>
                                <td class="text-right">
                                    <span t-field="t.base"
                                        t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                                </td>
                                <td class="text-right">
                                    <span t-field="t.amount"
                                        t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>

最佳答案

您可以使用以下方式完成:

在总计部分之前添加税表并删除现有的。

<template id="account_invoice_report_document_tax_table_ept" inherit_id="account.report_invoice_document">
    <xpath expr="//div[@t-if='o.tax_line_ids']" position="replace">
    </xpath>
    <xpath expr="//div[@class='col-xs-4 pull-right']" position="before">
        <div t-if="o.tax_line_ids">
        <div class="col-xs-6">
            <table class="table table-condensed">
                <thead>
                    <tr>
                        <th>Tax</th>
                        <th class="text-right">Base</th>
                        <th class="text-right">Amount</th>
                    </tr>
                </thead>
                <tbody>
                    <tr t-foreach="o.tax_line_ids" t-as="t">
                        <td><span t-field="t.name"/></td>
                        <td class="text-right">
                            <span t-field="t.base"
                                t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                        </td>
                        <td class="text-right">
                            <span t-field="t.amount"
                                t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    </xpath> 
</template>

这可能对你有帮助。

关于html - 账户发票报表税表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45041824/

相关文章:

php - 从 php 文件访问样式表

html - 用对 Angular 线分割div

android - 在 Android 上运行 Odoo (OpenERP) 服务器

python - 在 Windows 中为 OpenERP 6.1 安装 Python 模块

javascript - 检测 iFrame JS 中的滚动条

javascript - 单击后显示新表单

javascript - 使用 jQuery 在页面加载后生成包装 DIV

html - 在 bootstrap v3.0.21 中我在哪里写我的响应样式

html - 您如何找到以像素为单位的填充百分比?

python - 如何在 python 中获取除服务器时区 (UTC) 之外的用户本地时区?