之前用py实现的效果并不是很理想,而且哼冗余。
故,我们用xml来实现简单高效
- 产品/销售价格/成本/其他价格等(odoo14的xml)
<label for="base" string="New Price = "/>
<div>
<span attrs="{'invisible':[('base', '!=', 'list_price')]}">Sales Price -</span>
<span attrs="{'invisible':[('base', '!=', 'standard_price')]}">Cost -</span>
<span attrs="{'invisible':[('base', '!=', 'pricelist')]}">Other Pricelist -</span>
</div>
- (odoo15的xml)
<div class="o_td_label">
<label for="super_surplus" string="超发" style="font-weight:bold;" attrs="{'invisible': [('picking_type_code', '!=', 'outgoing')]}"/>
<label for="super_surplus" string="超收" style="font-weight:bold;" attrs="{'invisible': [('picking_type_code', '!=', 'incoming')]}"/>
<label for="super_surplus" string="超收/超发" style="font-weight:bold;" attrs="{'invisible': [('picking_type_code', 'in', ['incoming', 'outgoing'])]}"/>
</div>
推荐使用xml来写