【问题标题】:Odoo 8 qweb report style modificationOdoo 8 qweb 报表样式修改
【发布时间】:2018-07-03 09:21:07
【问题描述】:

我正在尝试在 Oddo 8 中修改我的 qweb 报告内容,我正在使用 div 位置。我想在打印视图上隐藏传真字段。我能怎么做?它不工作。我正在尝试像不显示一样的 CSS。

下面是我的代码 这是我的最终代码

<openerp>
<data>
    <template id="report_picking_inherit_demo" inherit_id="stock.report_picking">
        <xpath expr="//div[hasclass('page')]/div[hasclass('row')]" position="replace">
            <div class="col-xs-6">
                <div t-if="o.picking_type_id.code=='incoming' and o.partner_id">
                    <span>
                        <strong>Supplier Address:</strong>
                    </span>
                </div>
                <div t-if="o.picking_type_id.code=='internal' and o.partner_id">
                    <span>
                        <strong>Warehouse Address:</strong>
                    </span>
                </div>
                <div t-if="o.picking_type_id.code=='outgoing' and o.partner_id">
                    <span>
                        <strong>Customer Addresswww:</strong>
                    </span>
                </div>
                <div t-if="o.partner_id" name="partner_header">
                      <div t-field="o.partner_id"
                     t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true}'/>

                </div>
            </div>
            <div class="col-xs-5 col-xs-offset-1">
                <div t-if="o.move_lines and o.move_lines[0].partner_id and o.move_lines[0].partner_id.id != o.partner_id.id">
                    <span>
                        <strong>Delivery Address:</strong>
                    </span>
                    <div t-field="o.move_lines[0].partner_id"
                         t-field-options='{"widget": "contact", "fields": ["address", "name", "phone","fax"], "no_marker": true}'/>
                </div>
                <div t-if="o.picking_type_id.code != 'internal' and (not o.move_lines or not o.move_lines[0].partner_id) and o.picking_type_id.warehouse_id.partner_id">
                    <span>
                        <strong>Warehouse Address:</strong>
                    </span>
                    <div t-field="o.picking_type_id.warehouse_id.partner_id"
                         t-field-options='{"widget": "contact", "fields": ["address", "name", "phone","fax"], "no_marker": true}'/>
                </div>
            </div>
        </xpath>
    </template>
</data>

这里我输入了传真的一些例子 https://i.stack.imgur.com/iIUCo.png

然后是这个结果

https://i.stack.imgur.com/ukxTI.png]

【问题讨论】:

    标签: css xml odoo odoo-8


    【解决方案1】:

    从列表中删除字段“传真”,

    *.xml

       <div t-field="o.partner_id"
                             t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true}'/>
    

    【讨论】:

    • 如果我使用这条线。它应该隐藏吗?我想在打印视图中隐藏传真
    • 是的。你试试吧。
    • 请查看我的更改 我在 div 中有传真。我放了。但没有工作
    • 更新了我的答案。
    • 不工作..我只使用我向您展示的 xml 文件。请检查是否有任何问题。
    【解决方案2】:

    您需要从t-options 中删除fax 属性,您可以通过继承原始模板并覆盖&lt;div t-field="o.partner_id"... 元素来实现。

    <template id="custom_report_picking" inherit_id="stock.report_picking">
        <xpath expr="//t/t/t/t/div/div/div/div[2]/div" position="replace">
                <div t-field="o.partner_id"
                     t-field-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": true}'/>
            </xpath>
    </template>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多