python - 如何在odoo 12中生成报告(xlsx格式)和Qweb报告
问题描述
我正在使用帐户财务报告模块 (OCA)。我想根据代码添加树结构:如果account.code =“xxx000”或“yyy000”,然后将线条样式更改为粗体,并按升序获取其他代码。例子:
Code | |
-------------------------
xxx000 | |
-------------------------
|xxx001 |
-------------------------
|xxx003 |
-------------------------
yyy000 | |
-------------------------
|yyy002 |
-------------------------
|yyy005 |
-------------------------
def _generate_report_content(self, workbook, report):
if not report.show_partner_details:
# Display array header for account lines
self.write_array_header()
# For each account
for account in report.account_ids.filtered(lambda a: not a.hide_line):
if not report.show_partner_details:
# Display account lines
self.write_line(account, 'account')
请问有什么帮助吗?
解决方案
推荐阅读
- reactjs - 如何使用 Enzyme 模拟背景单击 Material-ui 的模态窗口?
- r - 使用 P-splines 拟合数据时,数据集是否需要分为验证集和测试集?
- stata - 在时间间隔内随机选取年份
- java - 使用 ldap 时出现 AcceptSecurityContext 错误
- swift - Vapor 服务器抛出的错误是字符串,而不是响应中的错误
- python - 当访问一个不可调用的属性运行一个方法时,它在 Python 中调用了什么,它是如何完成的?
- assembly - 超时内的串行字节检查 (asm)
- r - 如何编写函数或循环以用列名替换二进制值?
- html - 如何在Vuetify的布局中居中元素?
- java - 使用两个线程顺序打印奇偶数