首页 > 解决方案 > 如何在 Odoo POS 中更改订单收据中的字体大小?

问题描述

使用 Odoo 11 我想更改厨房订单收据上的字体大小

  <t t-foreach="changes.new" t-as="change">
                    <div size="double-height" t-if="!change.order">
                        <line line-ratio='0.6'>
                            <left><t t-esc="change.name_wrapped[0]" /></left>
                            <right><t t-esc="change.qty" /> <t t-esc="change.unit" /></right>
                        </line>
                        <t t-call="NameWrapped"/>

我想让名字更大的字体大小

我试过了

<t t-foreach="changes.new" t-as="change">
                <div size="double-height" t-if="!change.order">
                    <line line-ratio='0.6'>
                        <left><t t-esc="change.name_wrapped[0]" /></left>
                        <right><t t-esc="change.qty" /> <t t-esc="change.unit" /></right>
                    </line>
                    <t t-call="NameWrapped" size='double-height'/>

标签: xmlodooodoo-10odoo-11odoo-view

解决方案


完整的模板如下所示

<t t-name="NameWrapped">
    <t t-foreach="change.name_wrapped.slice(1)" t-as="wrapped_line">
        <line>
            <left></left>
            <right><t t-esc="wrapped_line"/></right>
        </line>
    </t>
</t>

继承并更新这个模板,结果应该是:

<t t-name="NameWrapped">
    <t t-foreach="change.name_wrapped.slice(1)" t-as="wrapped_line">
        <line size='double-height'>
            <left></left>
            <right><t t-esc="wrapped_line"/></right>
        </line>
    </t>
</t>

所以,你可以做类似的事情

<t t-extend="NameWrapped">
    <t t-jquery="line" t-operation="replace">
        <line size="double-height">
            <left></left>
            <right><t t-esc="wrapped_line"/></right>
        </line>
    </t>
</t>

推荐阅读