Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
pengyuthon
2026-03-05 20:04:16 +08:00
18 changed files with 254 additions and 99 deletions
@@ -396,7 +396,7 @@ class SoongWorkflowMixin(models.AbstractModel):
def _add_comment(self, logs, btn_rec):
trans_link_ids = []
wizard = self.env.ref("soong_workflow.view_soong_workflow_comment_wizard")
workflow_record_id = self.env["soong.workflow.record"].search([("res_model", "=", self._name), ("res_id", "=", self.id)])
workflow_record_id = self.env["soong.workflow.record"].search([("res_model", "=", self._name), ("res_id", "=", self.id), ('reclaim_state', '=', False)])
# 状态列表
node_list = btn_rec.workflow_id.node_ids.sorted('sequence')
if self.name_title != '采购申请单':
@@ -498,7 +498,8 @@ class SoongWorkflowRecord(models.Model):
if record_id:
if not hasattr(record_id, 'log_ids'):
continue
for log in record_id.log_ids:
valid_logs = record_id.log_ids.filtered(lambda l: l.node_btn_name != '1')
for log in valid_logs:
if log.done_by.name == self.env.user.name:
if log.name == '归档' and (log.approval_state == '0' or log.approval_state == '1'):
record.write({'soong_state': 'to_active'})
+4 -4
View File
@@ -15,12 +15,12 @@
<button name="batch_generate_catering" string="批量生成12/1/2月餐饮数据" type="object" class="btn btn-primary"/>
</header>
<field name="date"/>
<field name="breakfast"/>
<field name="lunch"/>
<field name="amount" readonly="1"/>
<field name="employee_id"/>
<field name="state"/>
<field name="dept_id"/>
<field name="employee_id"/>
<field name="breakfast"/>
<field name="lunch"/>
<field name="amount" readonly="1"/>
<field name="menu_day_id" column_invisible="True"/>
<field name="note"/>
<button name="action_confirm" class="btn btn-primary" type="object" string="确认" invisible="state != 'modifying'"/>
@@ -200,6 +200,7 @@ class YuthonVacationReports(models.Model):
"views": [(False, "tree")],
'res_model': 'vacation.meal.line',
'domain': [
('start_time', '>=', datetime(2026, 12, 1)),
('meal', '=', 'yes'),
('vacation_id', '!=', False),
('workflow_id', '!=', False),
@@ -46,21 +46,20 @@ class YuthonVacationImportWizard(models.TransientModel):
)
if vacation_id:
if employee_id.company_id.name == '天河粮储':
target_leaves = vacation_id.leave_ids.filtered(lambda l: l.text == '年假分配')
for leave in target_leaves:
update_value = float(row[1].value) * 8
if update_value == 0:
leave.unlink()
else:
leave.write({'update_lines': update_value})
target_leaves1 = vacation_id.leave_ids.filtered(lambda l: l.text == '上月额度继承')
update_value = float(row[2].value) * 8
for leave in target_leaves1:
if update_value == 0:
leave.unlink()
else:
leave.write({'update_lines': update_value})
target_leaves = vacation_id.leave_ids.filtered(lambda l: l.text == '年假分配')
for leave in target_leaves:
update_value = float(row[1].value) * 8
if update_value == 0:
leave.unlink()
else:
leave.write({'update_lines': update_value})
target_leaves1 = vacation_id.leave_ids.filtered(lambda l: l.text == '上月额度继承')
update_value = float(row[2].value) * 8
for leave in target_leaves1:
if update_value == 0:
leave.unlink()
else:
leave.write({'update_lines': update_value})
target_overtimes = vacation_id.overtime_ids.filtered(lambda o: o.text == '上月额度继承')
+31
View File
@@ -84,6 +84,10 @@ class IssueLibrary(models.Model):
is_legal_trial = fields.Selection([('no', '否'), ('yes', '是')], string="是否法审", default='no')
workflow_id = fields.Many2one('soong.workflow.record', string="流程")
department_personnel_ids = fields.Many2many('res.users', string='部门人员')
is_external_person = fields.Selection([('no', '否'), ('yes', '是')], string="是否有外部人员", default='no')
is_admin = fields.Boolean(string='是否管理员', compute='_compute_is_admin')
issue_attendee_line_ids = fields.One2many('issue.library.attendee.line', 'issue_library_id', string='列席人员信息')
issue_external_person_line_ids = fields.One2many('issue.library.external.person.line', 'issue_library_id', string='外部参会人员')
approval_name = fields.Char(string="审批标题")
meeting_place = fields.Char(string="会议地点")
meeting_name = fields.Char(string="会议名称")
@@ -313,6 +317,11 @@ class IssueLibrary(models.Model):
'issue_state': 'to_approval',
})
def _compute_is_admin(self):
is_admin = self.env.user.has_group('base.group_system')
for rec in self:
rec.is_admin = is_admin
@api.onchange('is_legal_trial')
def _onchange_is_legal_trial(self):
self.department_personnel_ids = [(5, 0, 0)]
@@ -806,6 +815,28 @@ class IssueLibraryApprovalLine(models.Model):
"view_mode": "form",
}
class IssueLibraryAttendeeLine(models.Model):
_name = "issue.library.attendee.line"
_description = '列席人员信息明细'
issue_library_id = fields.Many2one('issue.library', string="关联议题")
attendee_name = fields.Char(string='姓名')
company_id = fields.Many2one('res.company', string='公司')
department_id = fields.Many2one('hr.department', string='部门')
job_position = fields.Char(string='岗位')
class IssueLibraryExternalPersonLine(models.Model):
_name = "issue.library.external.person.line"
_description = '外部参会人员明细'
issue_library_id = fields.Many2one('issue.library', string="关联议题")
person_name = fields.Char(string='姓名')
company_unit = fields.Char(string='单位/公司')
job_title = fields.Char(string='职务')
phone = fields.Char(string='联系电话')
class IssueLibraryRoomLine(models.Model):
_name = "issue.library.room.line"
_description = '关联会议明细'
@@ -20,3 +20,5 @@ access_issue_class_approval_line,issue_class_approval_line,model_issue_class_app
access_issue_boss_approval,issue_boss_approval,model_issue_boss_approval,base.group_user,1,1,1,1
access_issue_boss_approval_line,issue_boss_approval_line,model_issue_boss_approval_line,base.group_user,1,1,1,1
access_issue_library_attendee_line,issue_library_attendee_line,model_issue_library_attendee_line,base.group_user,1,1,1,1
access_issue_library_external_person_line,issue_library_external_person_line,model_issue_library_external_person_line,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
20 access_issue_boss_approval_line issue_boss_approval_line model_issue_boss_approval_line base.group_user 1 1 1 1
21 access_issue_library_attendee_line issue_library_attendee_line model_issue_library_attendee_line base.group_user 1 1 1 1
22 access_issue_library_external_person_line issue_library_external_person_line model_issue_library_external_person_line base.group_user 1 1 1 1
23
24
+40 -13
View File
@@ -156,13 +156,13 @@
</div>
<group>
<field name="name" required="1" force_save="1" invisible="is_invisible_workflow"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="topic_content" invisible="is_invisible_workflow"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="handling_situation" string="办理情况" placeholder="(存在问题)"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="deliberation_content" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="will_based" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="deliberation_content" readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="will_based" readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
</group>
<group>
<group>
@@ -171,12 +171,15 @@
<!-- <field name="handling_situation" string="办理情况(存在问题)" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>-->
<!-- <field name="deliberation_content" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>-->
<!-- <field name="will_based" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>-->
<field name="is_legal_trial" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="is_legal_trial" readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="is_external_person"
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="department_personnel_ids" widget="many2many_tags" invisible="1"/>
<field name="is_admin" invisible="1"/>
<field name="issue_state" groups="soong_workflow.group_soong_workflow_manager"/>
<field name="workflow_id" invisible="is_legal_trial == 'no'"
<field name="workflow_id" string="法审流程" invisible="is_legal_trial == 'no'"
domain="[('res_model', '=', 'contract.review.approval'), ('create_uid', 'in', department_personnel_ids)]"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<!--<field name="documents_ids" widget="preview_many2many" invisible="is_invisible_workflow" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>-->
<field name="is_invisible_workflow" invisible="1"/>
<field name="name_text" invisible="1"/>
@@ -192,21 +195,21 @@
</group>
<group>
<field name="documents_ids" widget="preview_many2many" invisible="is_invisible_workflow"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
</group>
<group col="5" string="决策程序">
<group>
<field name="is_party" groups="yuthon_salary.group_jtbb_user" string="党总支"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="is_party" groups="yuthon_salary.group_lc_user,yuthon_salary.group_wg_user"
string="党支部会" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
string="党支部会" readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
</group>
<group>
<field name="is_class" readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
<field name="is_class" readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
</group>
<group>
<field name="is_boss" groups="yuthon_salary.group_jtbb_user"
readonly="issue_state not in ['to_do', 'cancel','to_modify']"/>
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']"/>
</group>
<group>
<field name="is_note" invisible="1"/>
@@ -234,6 +237,30 @@
</tree>
</field>
</page>
<page string="列席人员信息">
<field name="issue_attendee_line_ids"
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']">
<tree editable="bottom">
<field name="issue_library_id" column_invisible="1"/>
<field name="attendee_name"/>
<field name="company_id"/>
<field name="department_id"/>
<field name="job_position"/>
</tree>
</field>
</page>
<page string="外部参会人员" invisible="is_external_person != 'yes'">
<field name="issue_external_person_line_ids"
readonly="not is_admin and issue_state not in ['to_do', 'cancel','to_modify']">
<tree editable="bottom">
<field name="issue_library_id" column_invisible="1"/>
<field name="person_name"/>
<field name="company_unit"/>
<field name="job_title"/>
<field name="phone"/>
</tree>
</field>
</page>
<page string="关联流程">
<button name="add_workflow" string="添加流程" type="object" class="btn-primary"/>
<field name="issue_library_approval_line_ids" readonly="1">
@@ -65,10 +65,13 @@
<field name="street"/>
<field name="financial_address"/>
<field name="effective_date"/>
<field name="property_type"/>
<field name="kingdee_property_id"/>
</group>
<group>
<field name="property_state" groups="soong_workflow.group_soong_workflow_manager"/>
<field name="property_leasing" groups="soong_workflow.group_soong_workflow_manager"/>
<field name="purpose_id" groups="soong_workflow.group_soong_workflow_manager"/>
<field name="property_type" groups="soong_workflow.group_soong_workflow_manager"/>
<field name="company_id" invisible="1"/>
<field name="tenure_type" invisible="1"/>
<field name="precinct_id" invisible="1"/>
@@ -90,7 +93,6 @@
<field name="feature_ids" widget="many2many_tags"/>
<field name="is_done_split" invisible="1"/>
<field name="is_done_merge" invisible="1"/>
<field name="property_state" invisible="1"/>
</group>
</group>
<group col="3">
+89 -51
View File
@@ -6,6 +6,37 @@ from odoo import fields, models, api
class YuthonProperty(models.Model):
_inherit = 'property.accounts.receivable'
# 固定费用类型列(用于报表横向展示)
FEE_COLUMNS = ['租金', '管理费', '水费', '电费', '违约金', '其他费用']
def _get_tax_rate_display(self, rec):
"""从合同获取税率显示字符串"""
try:
tr = rec.contract_id.tax_rate.name if rec.contract_id and rec.contract_id.tax_rate else None
if tr and str(tr).replace('%', '').strip():
v = float(str(tr).replace('%', '').strip())
return f"{v:.1f}%"
except (ValueError, TypeError):
pass
return "0.0%"
def _classify_fee_type(self, type_name):
"""将应收类型归类到固定列"""
if not type_name:
return '其他费用'
if '租' in type_name:
return '租金'
elif '管理' in type_name or '管' in type_name:
return '管理费'
elif '水' in type_name:
return '水费'
elif '电' in type_name:
return '电费'
elif '违约' in type_name:
return '违约金'
else:
return '其他费用'
@api.model
def get_complete_ledger_report(self, params):
domain = []
@@ -25,75 +56,82 @@ class YuthonProperty(models.Model):
date_end = datetime.datetime.fromisoformat(params.get("date_end")).date()
domain.append(("due_date", "<=", date_end))
# condition, 这里需要放到具体的搜索条件中 domain .
condition = params.get('condition', False)
partner_id = params.get('partner_id', False)
company_id = params.get('company_id', False)
if condition:
domain.append(('tenure_type', '=', condition))
if partner_id:
domain.append(('precinct_id', '=', partner_id))
if company_id:
domain.append(('company_id', '=', company_id))
receivables = self.search(domain)
management_type_map = dict(
self.env['yuthon.management.type'].search([]).mapped(lambda r: (r.id, r.name))
)
invoice_type_map = dict(
self._fields['invoice_type']._description_selection(self.env)
)
receivables = self.search(domain, order="contract_id asc, due_date asc")
# 按合同分组
contract_map = {}
for rec in receivables:
cid = rec.contract_id.id if rec.contract_id else 0
if cid not in contract_map:
contract_map[cid] = {
'recs': [],
'info_rec': rec, # 取第一条记录作为基础信息
}
contract_map[cid]['recs'].append(rec)
rows = []
type_totals = {}
total_amount = 0.0
for idx, rec in enumerate(receivables, start=1):
mgmt_type = management_type_map.get(rec.management_type_id.id, "") if rec.management_type_id else "未分类"
amount = rec.original_amount or 0.0
total_amount += amount
if mgmt_type not in type_totals:
type_totals[mgmt_type] = {'amount': 0.0}
type_totals[mgmt_type]['amount'] += amount
rows.append({
total_fees = {col: 0.0 for col in self.FEE_COLUMNS}
total_subtotal = 0.0
idx = 1
for cid, data in contract_map.items():
info_rec = data['info_rec']
fee_row = {col: 0.0 for col in self.FEE_COLUMNS}
# 归类费用
for rec in data['recs']:
type_name = rec.management_type_id.name if rec.management_type_id else ''
col = self._classify_fee_type(type_name)
fee_row[col] += rec.original_amount or 0.0
subtotal = sum(fee_row.values())
for col in self.FEE_COLUMNS:
total_fees[col] += fee_row[col]
total_subtotal += subtotal
row = {
"序号": idx,
"应收类型": mgmt_type,
"应收开始": rec.due_date.strftime("%Y-%m-%d") if rec.due_date else "",
"应收结束": rec.due_date_end.strftime("%Y-%m-%d") if rec.due_date_end else "",
"当期金额": round(amount, 2),
"应收开始": info_rec.due_date.strftime("%Y-%m-%d") if info_rec.due_date else "",
"应收结束": info_rec.due_date_end.strftime("%Y-%m-%d") if info_rec.due_date_end else "",
"合同编号": {
'model': 'property.lease.contract',
'id': rec.contract_id.id,
'display_name': rec.contract_id.contract_code,
} if rec.contract_id else "",
'id': info_rec.contract_id.id,
'display_name': info_rec.contract_id.contract_code,
} if info_rec.contract_id else "",
"承租方": {
'model': 'property.tenant.information',
'id': rec.lessee_id.id,
'display_name': rec.lessee_id.name,
} if rec.lessee_id else "",
"物业名称": rec.property_name or "",
"产权证号": rec.title_deed or "",
"发票类型": rec.lessee_id.invoicing_ids[0].invoicing_type_id.name if rec.lessee_id and rec.lessee_id.invoicing_ids else "",
"税率": (
lambda tr: (
lambda v: f"{v:.1f}%" if v is not None else "0.0%"
)(
float(str(tr).replace('%', '').strip())
if tr and str(tr).replace('%', '').strip()
else None
)
)(rec.contract_id.tax_rate.name if rec.contract_id and rec.contract_id.tax_rate else None)
})
'id': info_rec.lessee_id.id,
'display_name': info_rec.lessee_id.name,
} if info_rec.lessee_id else "",
"物业名称": info_rec.property_name or "",
"产权证号": info_rec.title_deed or "",
"发票类型": info_rec.lessee_id.invoicing_ids[0].invoicing_type_id.name if info_rec.lessee_id and info_rec.lessee_id.invoicing_ids else "",
"税率": self._get_tax_rate_display(info_rec),
}
# 加入各费用列
for col in self.FEE_COLUMNS:
row[col] = round(fee_row[col], 2) if fee_row[col] else ""
row["小计"] = round(subtotal, 2)
rows.append(row)
idx += 1
# 合计行
summary_stats = []
for type_name in sorted(type_totals.keys()):
summary_stats.append({'name': type_name, 'amount': round(type_totals[type_name]['amount'], 2)})
summary_stats.append({'name': '总合计', 'amount': round(total_amount, 2)})
for col in self.FEE_COLUMNS:
summary_stats.append({'name': col, 'amount': round(total_fees[col], 2)})
summary_stats.append({'name': '小计合计', 'amount': round(total_subtotal, 2)})
return {"rows": rows, "stats": summary_stats}
@api.model
@@ -112,6 +112,16 @@ class ReceivableReport extends Component {
},
context: {
actionService: this.actionService // 传递 actionService 用于穿透跳转
},
onFilterChanged: () => {
// 过滤后重新编号序号列
let num = 1;
this.grid.forEachNodeAfterFilter((node) => {
if (node.data) {
node.data['序号'] = num++;
}
});
this.grid.refreshCells({ columns: ['序号'], force: true });
}
};
@@ -287,6 +297,8 @@ class ReceivableReport extends Component {
this.state.stats = [];
}
}
// 数据刷新后重新应用收款类型过滤
this._applyManagementTypeFilter();
}
onExportExcel() {
@@ -305,10 +317,40 @@ class ReceivableReport extends Component {
}
}
// 费用类型名称 → 数据列字段名映射
_getFeeColumnByTypeName(typeName) {
if (!typeName) return null;
if (typeName.includes('租')) return '租金';
if (typeName.includes('管理') || typeName.includes('管')) return '管理费';
if (typeName.includes('水')) return '水费';
if (typeName.includes('电')) return '电费';
if (typeName.includes('违约')) return '违约金';
return '其他费用';
}
async onUpdateManagementType(v) {
this.state.selectManagementType = v[0] || {};
// 自动搜索
await this.onSearch()
// 应用前端过滤(不重新请求后端)
this._applyManagementTypeFilter();
}
_applyManagementTypeFilter() {
if (!this.grid) return;
const typeName = this.state.selectManagementType?.display_name || '';
if (!typeName) {
// 无选择,清除外部过滤
this.grid.setGridOption('isExternalFilterPresent', () => false);
this.grid.setGridOption('doesExternalFilterPass', () => true);
} else {
const col = this._getFeeColumnByTypeName(typeName);
this.grid.setGridOption('isExternalFilterPresent', () => true);
this.grid.setGridOption('doesExternalFilterPass', (node) => {
if (!node.data) return true;
const val = node.data[col];
return val !== '' && val !== null && val !== undefined && val !== 0;
});
}
this.grid.onFilterChanged();
}
onChangeCondition() {
@@ -11,16 +11,22 @@
"model": "property.accounts.receivable",
"method": "get_complete_ledger_report",
"columns": [
{"headerName": "应收类型", "field": "应收类型", "flex": 1},
{"headerName": "序号", "field": "序号", "width": 70, "flex": 0, "pinned": "left"},
{"headerName": "应收开始", "field": "应收开始", "flex": 1},
{"headerName": "应收结束", "field": "应收结束", "flex": 1},
{"headerName": "当期金额", "field": "当期金额", "flex": 1, "type": "number"},
{"headerName": "合同编号", "field": "合同编号", "flex": 1},
{"headerName": "承租方", "field": "承租方", "flex": 1},
{"headerName": "物业名称", "field": "物业名称", "flex": 1},
{"headerName": "物业名称", "field": "物业名称", "flex": 2},
{"headerName": "产权证号", "field": "产权证号", "flex": 1},
{"headerName": "发票类型", "field": "发票类型", "flex": 1},
{"headerName": "税率", "field": "税率", "flex": 1}
{"headerName": "税率", "field": "税率", "flex": 1},
{"headerName": "租金", "field": "租金", "flex": 1, "type": "number"},
{"headerName": "管理费", "field": "管理费", "flex": 1, "type": "number"},
{"headerName": "水费", "field": "水费", "flex": 1, "type": "number"},
{"headerName": "电费", "field": "电费", "flex": 1, "type": "number"},
{"headerName": "违约金", "field": "违约金", "flex": 1, "type": "number"},
{"headerName": "其他费用", "field": "其他费用", "flex": 1, "type": "number"},
{"headerName": "小计", "field": "小计", "flex": 1, "type": "number"}
]
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ class YuthonMealExpenses(models.Model):
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份',
default=lambda self: str(datetime.now().year))
meal_state = fields.Selection([('to_do', '待发送'), ('done', '已发送')], string='状态', default='to_do')
toll_state = fields.Selection([('to_do', '未缴'), ('done', '已缴')], string='状态', default='to_do')
toll_state = fields.Selection([('to_do', '待缴'), ('done', '已缴')], string='缴费状态', default='to_do')
@api.depends('number_breakfasts', 'number_lunches')
+1 -1
View File
@@ -20,7 +20,7 @@ class YuthonSalaryParty(models.Model):
select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2040)], string='年份',
default=lambda self: str(datetime.now().year))
party_state = fields.Selection([('to_do', '待发送'), ('done', '已发送')], string='状态', default='to_do')
toll_state = fields.Selection([('to_do', '未缴'), ('done', '已缴')], string='状态', default='to_do')
toll_state = fields.Selection([('to_do', '待缴'), ('done', '已缴')], string='缴费状态', default='to_do')
def toll_confirm(self):
self.toll_state = 'done'
@@ -32,6 +32,7 @@
<field name="number_lunches"/>
<field name="total_payment"/>
<field name="company_id"/>
<field name="toll_state"/>
<field name="meal_state"/>
<button name="send_meal" string="发送" type="object" class="oe_highlight"/>
</tree>
@@ -13,6 +13,7 @@
<field name="payment"/>
<field name="total_payment"/>
<field name="company_id"/>
<field name="toll_state"/>
<field name="party_state"/>
<button name="send_party" string="发送" type="object" class="oe_highlight"/>
</tree>
+4 -2
View File
@@ -48,7 +48,8 @@ class PartyMealWizard(models.TransientModel):
employee_list = []
meal_ids = self.env['yuthon.meal.expenses'].search([('select_time', '=', self.meal_month),
('select_year', '=', self.meal_year),
('meal_state', '=', 'to_do')
('meal_state', '=', 'to_do'),
('toll_state', '=', 'to_do')
])
for meal_id in meal_ids:
employee_list.append(meal_id.employee_id.id)
@@ -62,7 +63,8 @@ class PartyMealWizard(models.TransientModel):
for employee in self.employee_ids:
meal = self.env['yuthon.meal.expenses'].search([('employee_id', '=', employee.id),
('select_time', '=', self.select_time),
('select_year', '=', self.select_year)])
('select_year', '=', self.select_year),
('toll_state', '=', 'to_do')])
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
user_id=employee.wecom_userid,
title="缴纳餐费提醒",
+4 -2
View File
@@ -44,7 +44,8 @@ class PartySendWizard(models.TransientModel):
employee_list = []
party_ids = self.env['yuthon.salary.party'].search([('select_time', '=', self.party_month),
('select_year', '=', self.party_year),
('party_state', '=', 'to_do')
('party_state', '=', 'to_do'),
('toll_state', '=', 'to_do')
])
for party_id in party_ids:
employee_list.append(party_id.employee_id.id)
@@ -56,7 +57,8 @@ class PartySendWizard(models.TransientModel):
for employee in self.employee_ids:
party = self.env['yuthon.salary.party'].search([('employee_id', '=', employee.id),
('select_time', '=', self.select_time),
('select_year', '=', self.select_year)])
('select_year', '=', self.select_year),
('toll_state', '=', 'to_do')])
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
user_id=employee.wecom_userid,
title="缴纳党费提醒",