我正在尝试在CRM模块的机会部分对客户进行分组。
我想在上分组客户/机会industry。
我已经使用过类似的代码res.partner,但我无法解决这一问题!
models.py
x_industry_id = fields.Many2one(string="Industry", comodel_name="res.partner")
Run Code Online (Sandbox Code Playgroud)
views.xml
<record id="view_crm_case_opportunities_filter_inherit" model="ir.ui.view">
<field name="name">crm.lead.search.opportunity</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="arch" type="xml">
<xpath expr="//search" position="inside">
<filter name="x_industry_id" string="Industry" context="{'group_by':'x_industry_id'}" domain="[('industry_id','!=', False)]"/>
</xpath>
</field>
</record>
Run Code Online (Sandbox Code Playgroud)
对于使用相同方法的过滤器和其他组,我也遇到相同的问题。
它们只是看起来不正常!
如何将群组和过滤器应用于不同的模型
我有一个 PyQt 图表,但 X 轴水平显示数据。
如何垂直显示 X 轴上的标签?
我想要的结果是这样的(原谅糟糕的Photoshop技能!!)
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtChart import *
#https://doc.qt.io/qt-5/qtcharts-datetimeaxis-example.html
if __name__ == '__main__':
import sys
if True:
a = QApplication(sys.argv)
x = ['2018-07-01 13:06:38', '2018-07-01 12:46:38', '2018-07-01 12:36:38', '2018-07-01 12:26:38', '2018-07-01 12:16:38', '2018-07-01 12:06:38', '2018-07-01 11:56:38', '2018-07-01 11:46:38', '2018-07-01 11:36:38', '2018-07-01 11:26:38', '2018-07-01 10:56:38', '2018-07-01 10:46:38', '2018-07-01 10:36:38']
y = [23.5, 20.8, 28.0, 28.1, 28.0, 27.8, 27.3, 27.2, 25.7, 24.7, 25.0, 25.0, 24.9] …Run Code Online (Sandbox Code Playgroud)