xml - 如何在 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'/>
解决方案
完整的模板如下所示
<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>
推荐阅读
- java - 如何从(双)ArrayList 中找到最小值、最大值和平均值以打开 GUI(图形)?
- database - 重定向后的 Laravel 页面加载需要永远
- flutter - 英雄动画导致(最小)溢出
- javascript - 如何在javascript中设置外部div的长度,呼吸
- qt - QWidget 报告相同的错误宽度值
- python - Python Pillow / Numpy 数组是这些像素“连接”的吗?
- spring - Spring属性:yml vs属性文件语法,不可互换?
- javascript - 使用 GraphQL 注册用户时出现错误
- haskell - ((->) r) 在实例 Applicative ((->) r) 中是什么意思?
- php - 从 php 启动 python3 脚本:字符串编码系统问题