【问题标题】:How to change Logo Company size如何更改徽标公司大小
【发布时间】:2018-05-18 17:34:28
【问题描述】:

我想更改销售订单和客户发票中的徽标公司大小,我使用此代码进行编码,但没有更改该徽标大小。

这是我的代码:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="co_report_saleorder_document">
    <t t-call="report.external_layout">
        <t t-set="docs" t-value="docs.with_context({'lang':docs.partner_id.lang})" />

        <!-- Multicompany -->
        <t t-if="not o and doc">
            <t t-set="o" t-value="doc"/>
        </t>
        <t t-if="o and 'company_id' in o">
            <t t-set="company" t-value="o.company_id"></t>
        </t>
        <t t-if="not o or not 'company_id' in o">
            <t t-set="company" t-value="res_company"></t>
        </t>

        <div class="header">
            <div class="row">
                <div class="col-xs-3">
                    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-width: 200px; max-height: 150px;"/>
                </div>
                <div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
            </div>
            <div class="row zero_min_height">
                <div class="col-xs-12">
                    <div style="border-bottom: 1px solid black;"></div>
                </div>
            </div>
        </div>

</template>


<template id="report_saleorder">
    <t t-call="report.html_container">
        <t t-foreach="docs" t-as="docs">
            <t t-call="sale.fal_report_saleorder_document" t-lang="docs.partner_id.lang"/>
        </t>
    </t>
</template>

<report
    string="Cetak Sales"
    id="co_view_sale"
    model="sale.order"
    report_type="qweb-pdf"
    name="co_sale_report.co_report_saleorder_document"
    file="co_sale_report.co_report_saleorder_document"
/>

</odoo>

我在 style="max-width: 200px; max-height: 150px;" 中添加了代码但没有改变。有人可以帮助我吗?

【问题讨论】:

标签: html css openerp odoo-10


【解决方案1】:

尝试添加下面的宽度块 css

style="max-width: 200px; max-height: 150px; display: block;"

【讨论】:

  • 我尝试了这个,但仍然没有改变
  • 尝试同时指定宽度和高度
  • 我有错误 this = Error to render compile AST TypeError: not all arguments convert during string formatting Template: 1400 Path: /templates/t/t/div[1]/div[1]/div [1]/img 节点:
  • 仅在样式属性中给出宽度高度
【解决方案2】:

您不能直接更改为外部布局。首先,您需要通过继承模板来更改报表模块的标题布局。

<template id="external_layout_header_inherited" inherit_id="report.external_layout_header" primary="True">
<xpath expr="//img" position="replace">
    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" height='150' width='200' />
</xpath></template>

希望对您有所帮助....

【讨论】:

  • 我尝试了这个,但没有改变。
猜你喜欢
  • 2016-08-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-10
  • 1970-01-01
  • 2016-10-09
  • 2021-08-22
相关资源
最近更新 更多