【问题标题】:Customize report layout odoo 10自定义报表布局odoo 10
【发布时间】:2018-01-31 08:21:23
【问题描述】:

我自定义 external_layout_header 以在 Purchase Order 中重复 vendor&shipping address。它的成功充分体现。但问题是,div class='page' 中的内容与标题重叠。我把margin-top:xx 给了class='page',但它不受影响。我怎样才能做到这一点?

*external_layout_inherit.xml

<template id="purchase_extrenal_layout" inherit_id="report.external_layout_header">
     <xpath expr="//div[@class='row zero_min_height']" position="before">
     <div class="row zero_min_height">
       <div class="col-xs-12">
        <div style="border-bottom: 1px solid black;"></div>
       </div>
     </div>
<div class="row">

      <div class="" style="float:left; text-align:left; margin-left:50px;">
        <strong>Customer address:</strong>
          <div t-field="o.partner_id"
              t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'/>
              <p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>
      </div>
      <div style="float:right; text-align:right; margin-right:50px;">
        <strong>Shipping address:</strong>
        <div t-if="o.dest_address_id">
            <div t-field="o.dest_address_id"
                t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'/>
        </div>

        <div t-if="not o.dest_address_id and o.picking_type_id and o.picking_type_id.default_location_dest_id">
            <span t-field="o.picking_type_id.default_location_dest_id.partner_id.name"/>
            <div t-field="o.picking_type_id.default_location_dest_id.partner_id"
                t-options='{"widget": "contact", "fields": ["address", "phone", "fax"], "no_marker": True, "phone_icons": True}'/>
        </div>
      </div>
</div>

样本报告。

【问题讨论】:

    标签: odoo odoo-10


    【解决方案1】:

    页眉和页脚“边距”在文档纸张格式中设置。因此,您必须更改默认的纸质格式(应该用于 Odoo 中的大多数报告),或者创建一个新格式并将其链接到采购订单报告。

    【讨论】:

      【解决方案2】:

      将此添加到您的报告文件中。

      <record id="paperformat_rfq" model="report.paperformat">
          <field name="name">A4 Barcode Paper</field>
          <field name="default" eval="True" />
          <field name="format">A4</field>
          <field name="page_height">0</field>
          <field name="page_width">0</field>
          <field name="orientation">Portrait</field>
          <field name="margin_top">8</field>
          <field name="margin_bottom">0</field>
          <field name="margin_left">3</field>
          <field name="margin_right">0</field>
          <field name="header_line" eval="False"/>
          <field name="header_spacing">5</field>
          <field name="dpi">90</field>
      </record>
      
      <record id="action_request_quotation" model="ir.actions.report.xml">
          <field name="paperformat_id" ref="your_module_name.paperformat_rfq"/>
      </record>
      

      根据需要调整margin_top和header_spacing。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-01-05
        • 1970-01-01
        相关资源
        最近更新 更多