指望的视图
对于“新”阶段:525K→预期收入(已经显示)
12→年度总查询(10)→目前在此阶段的查询计数
对于所有其他阶段:
显示格式应为:
525K -6
6→目前在此阶段的查询计数 我的问题
我应该在哪里修改代码以实现这一目标? 应该在自定义模块中完成,还是可以通过XML视图来处理?
如何在Odoo 18中的每个阶段动态获取和显示这些计数?如果它需要猫头鹰JS的更改,我应该如何进行更新 进度栏组件?
ColumnProgress
crm
<AnimatedNumber>
元素(显示当前值)并插入您的其他计数iT.
__manifest__.py
声明对crm
的依赖性并将XML资产加载到后端。
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<!-- Inherit and extend the CRM progress bar template -->
<t t-inherit="crm.ColumnProgress" t-inherit-mode="extension">
<!-- Insert additional count after the AnimatedNumber element -->
<xpath expr="//AnimatedNumber" position="after">
<span class="ml-2">
<!-- Replace 'your_field' with the actual field name -->
#######
</span>
</xpath>
</t>
</templates>
manifest文件(
__manifest__.py
):
{
# ... other manifest keys
'assets': {
'web.assets_backend': [
'your_module/static/src/xml/your_template.xml', # XML asset path
],
},
# ... other manifest keys
}