【发布时间】:2020-01-29 02:35:07
【问题描述】:
我们的客户希望 PoS 收据显示所售产品的计量单位。我该怎么做呢?
这是针对客户端 Odoo 12 实例的。在销售完成后收据要打印的XML 文件中,我尝试添加以下内容:
<t t-esc="orderline.get_product().uom"/>
但是当我打印收据时,它显示该字段为空,即使在销售点 UI 中您可以选择产品的计量单位。
这是系统查看打印产品名称、评论和折扣的地方。
<td width="35%">
<t t-esc="orderline.get_product().display_name"/>
<t t-if="widget.pos.config.on_product_line">
<div class="pos-disc-font">
<t t-esc="orderline.get_order_line_comment()"/>
</div>
</t>
<t t-if="orderline.get_discount() >0">
<div class="pos-disc-font">With a <t t-esc="orderline.get_discount()"/>% discount
</div>
</t>
</td>
在模型中声明了以下内容:
class UomCateg(models.Model):
_inherit = 'uom.category'
is_pos_groupable = fields.Boolean(string='Group Products in POS',
help="Check if you want to group products of this category in point of sale orders")
class Uom(models.Model):
_inherit = 'uom.uom'
is_pos_groupable = fields.Boolean(related='category_id.is_pos_groupable', readonly=False)
我也尝试调用这些类,但没有结果。
预期的结果应该能够调用所售产品的计量单位出现在 PoS 收据中。
【问题讨论】:
标签: python xml odoo odoo-12 pos