1
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
'category': 'public_dev',
|
||||
'author': 'HHY',
|
||||
'license': 'LGPL-3',
|
||||
'depends': ['base'],
|
||||
# 'data': [
|
||||
# 'views/product_views.xml',
|
||||
# ],
|
||||
'depends': ['base', 'sale_management'],
|
||||
'data': [
|
||||
'views/product_views.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'search_panel_extension/static/src/xml/search_panel.xml',
|
||||
|
||||
@@ -121,6 +121,56 @@ patch(SearchModel.prototype, {
|
||||
}
|
||||
|
||||
return sections.sort((s1, s2) => s1.index - s2.index);
|
||||
},
|
||||
|
||||
_getFilterDomain(excludedFilterId) {
|
||||
// debugger;
|
||||
const domain = [];
|
||||
const domainList = [];
|
||||
function addCondition(fieldName, valueMap) {
|
||||
const ids = [];
|
||||
for (const [valueId, value] of valueMap) {
|
||||
if (value.checked) {
|
||||
ids.push(valueId);
|
||||
}
|
||||
}
|
||||
if (ids.length) {
|
||||
const it = [[fieldName, "in", ids]]
|
||||
domainList.push(it);
|
||||
}
|
||||
}
|
||||
for (const filter of this.filters) {
|
||||
if (filter.id === excludedFilterId) {
|
||||
continue;
|
||||
}
|
||||
const { fieldName, groups, values } = filter;
|
||||
if (groups) {
|
||||
for (const group of groups.values()) {
|
||||
addCondition(fieldName, group.values);
|
||||
}
|
||||
Array.from(Domain.or(domainList).toList({}), (it) => domain.push(it))
|
||||
} else {
|
||||
addCondition(fieldName, values);
|
||||
}
|
||||
}
|
||||
return domain;
|
||||
},
|
||||
|
||||
_getGroupDomain(filter) {
|
||||
// debugger;
|
||||
const { fieldName, groups, enableCounters } = filter;
|
||||
const { type: fieldType } = this.searchViewFields[fieldName];
|
||||
|
||||
const groupDomain = super._getGroupDomain(filter);
|
||||
|
||||
if (fieldType === "many2one") {
|
||||
if (groupDomain && groupDomain.length === 1 && groupDomain[0][0] === 0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return groupDomain;
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @odoo-module **/
|
||||
import {SearchPanel} from "@web/search/search_panel/search_panel";
|
||||
import {patch} from "@web/core/utils/patch";
|
||||
import { Domain } from "@web/core/domain";
|
||||
|
||||
import { onPatched, onMounted } from "@odoo/owl";
|
||||
import {childrenSize} from "./search_model";
|
||||
@@ -73,6 +74,7 @@ patch(SearchPanel.prototype, {
|
||||
}
|
||||
});
|
||||
this.state.active[filterId][id] = !checked;
|
||||
if (id) valueIds.push(id)
|
||||
};
|
||||
|
||||
recurve_group(group, checked);
|
||||
|
||||
@@ -243,38 +243,6 @@ class SoongWorkflowMixin(models.AbstractModel):
|
||||
return self.with_context(cx)._add_comment(log_obj, btn_rec)
|
||||
else:
|
||||
return btn_rec.with_context(cx).run()
|
||||
# if btn_rec.name == '转交':
|
||||
# # 如果有下一个节点,发消息通知。
|
||||
# state_list = ['拟办' if i.node_name == 'start' else i.node_name for i in
|
||||
# btn_rec.workflow_id.node_ids]
|
||||
# # 当前节点状态
|
||||
# self_state = state_list.index('拟办' if self.state == 'start' else self.state)
|
||||
# # 下一个节点
|
||||
# next_state = btn_rec.workflow_id.node_ids[self_state + 1].button_ids[0]
|
||||
# # 不自动匹配
|
||||
# employee_user_role_ids = self.env['hr.employee'].search(
|
||||
# ['|', ('user_role_id', '=', next_state.users_role_id.id),
|
||||
# ('user_role_ids', 'in', next_state.users_role_id.id)])
|
||||
# # 自动匹配
|
||||
# employee_user_role_id = self.env['hr.employee'].search(
|
||||
# ['|', ('user_role_id', '=', next_state.users_role_id.id), ('user_role_ids', 'in', next_state.users_role_id.id),
|
||||
# '|', ('department_id', '=', self.department_id.id),('department_ids', 'in', self.department_id.id),
|
||||
# ('yuthon_company', '=', self.create_uid.employee_id.yuthon_company)])
|
||||
# employee_ids = employee_user_role_ids if not next_state.is_automatic else employee_user_role_id
|
||||
# url = 'https://oa.thtzjt.com/mail/view?model={}&res_id={}'.format(self._name, self.id)
|
||||
# for employee in employee_ids:
|
||||
# self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
# user_id=employee.wecom_userid,
|
||||
# title=self._description,
|
||||
# description="标题: {}\n".format(
|
||||
# self.name) + self.env.user.name + ' ' + str(
|
||||
# fields.Datetime.now() + timedelta(
|
||||
# hours=8)),
|
||||
# url=url, btntxt="查看详情")
|
||||
# partner_ids = employee_ids.user_id.partner_id.ids
|
||||
# self.with_context(lang=self.env.lang)._message_auto_subscribe_notify(partner_ids,
|
||||
# 'soong_workflow.message_soong_workflow_users_data')
|
||||
# return btn_rec.with_context(cx).run()
|
||||
|
||||
def _add_comment(self, logs, btn_rec):
|
||||
wizard = self.env.ref("soong_workflow.view_soong_workflow_comment_wizard")
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='department_id']" position="attributes">
|
||||
<attribute name="groupby">parent_id</attribute>
|
||||
<!-- <attribute name="select">multi</attribute>-->
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -241,4 +241,14 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
description=description, url=url,
|
||||
btntxt="查看详情")
|
||||
|
||||
url = 'https://oa.thtzjt.com/mail/view?model={}&res_id={}'.format(self._name, record_id.id)
|
||||
for employee in self.employee_ids:
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
user_id=employee.wecom_userid,
|
||||
title=self._description,
|
||||
description="标题: {}\n".format(
|
||||
self.name) + self.env.user.name + ' ' + str(
|
||||
fields.Datetime.now() + timedelta(
|
||||
hours=8)),
|
||||
url=url, btntxt="查看详情")
|
||||
return self.node_btn_id.with_context(cx).run()
|
||||
|
||||
@@ -27,6 +27,7 @@ class WecomAppsConfig(models.Model):
|
||||
('oa', '审批类型'),
|
||||
('att', '出勤类型'),
|
||||
('task', '日程类型'),
|
||||
('att_ok', '考勤确认类型'),
|
||||
], default="default")
|
||||
wecom_apps_id = fields.Many2one("wecom.apps", string="企业微信的应用")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user