Merge branch 'dev' of https://gitee.com/jinan-pengyusen-data/gzth into dev_wang
This commit is contained in:
@@ -107,6 +107,7 @@ class SoongWorkflowNode(models.Model):
|
||||
('next', '跳过下一个相同人员节点'),
|
||||
('prev', '跳过上一个相同人员节点'),
|
||||
], string='相同人员节点处理', default='none')
|
||||
is_mandatory_node = fields.Boolean(string="必经节点", default=False)
|
||||
|
||||
@api.onchange("is_apostille")
|
||||
def onchange_is_apostille(self):
|
||||
|
||||
@@ -34,8 +34,13 @@
|
||||
<field name="soong_record_ids" style="width:100%; margin-top: 10px;">
|
||||
<tree create="1" edit="1" delete="1" editable="bottom" type="object">
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
<field name="workflow_record_id" domain="[('member_of_department', '=', True), ('approvals_group_id.name', 'not in', ['考勤', '人事'])]"
|
||||
required="1" options="{'no_open': True}" context="{'tree_view_ref': 'soong_workflow.soong_workflow_record_no_action_tree'}"/>
|
||||
<field name="workflow_record_id"
|
||||
domain="['|',
|
||||
('member_of_department', '=', True),
|
||||
('users_ids', 'in', [uid])]"
|
||||
required="1"
|
||||
options="{'no_open': True}"
|
||||
context="{'tree_view_ref': 'soong_workflow.soong_workflow_record_no_action_tree'}"/>
|
||||
<field name="code" column_invisible="1"/>
|
||||
<field name="workflow_id"/>
|
||||
<field name="create_uid"/>
|
||||
@@ -92,8 +97,13 @@
|
||||
<field name="soong_record_ids" style="width:100%%; margin-top: 10px;">
|
||||
<tree editable="bottom" delete="False">
|
||||
<button name="open_record" type="object" string="详情" class="btn-primary"/>
|
||||
<field name="workflow_record_id" domain="[('member_of_department', '=', True), ('approvals_group_id.name', 'not in', ['考勤', '人事'])]"
|
||||
required="1" options="{'no_open': True}" context="{'tree_view_ref': 'soong_workflow.soong_workflow_record_no_action_tree'}"/>
|
||||
<field name="workflow_record_id"
|
||||
domain="['|',
|
||||
('member_of_department', '=', True),
|
||||
('users_ids', 'in', [uid])]"
|
||||
required="1"
|
||||
options="{'no_open': True}"
|
||||
context="{'tree_view_ref': 'soong_workflow.soong_workflow_record_no_action_tree'}"/>
|
||||
<field name="code" column_invisible="1"/>
|
||||
<field name="workflow_id"/>
|
||||
<field name="create_uid"/>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<field name="return_comment_id"/>
|
||||
<field name="confirm_comment_id"/>
|
||||
<field name="end_comment_id"/>
|
||||
<field name="is_mandatory_node"/>
|
||||
<field name="same_user_skip_type"/>
|
||||
<field name="illustrate"/>
|
||||
</group>
|
||||
|
||||
@@ -206,13 +206,55 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
@api.onchange('trans_link_id')
|
||||
def onchange_trans_employee_ids(self):
|
||||
for record in self:
|
||||
record_id = self.env[record.res_model].browse(record.res_id) if record.res_model and record.res_id else None
|
||||
ctx_links = self.env.context.get('all_workflow_links', [])
|
||||
all_links = self.env['trans.link'].browse(ctx_links) if isinstance(ctx_links, (list, tuple)) else ctx_links
|
||||
|
||||
valid_links = all_links - record.invalid_link_ids
|
||||
|
||||
record.is_selection = False
|
||||
record.is_this_company = True
|
||||
if self.node_btn_name == '退回':
|
||||
record.is_this_company = False
|
||||
else:
|
||||
record.is_this_company = True
|
||||
if record.node_btn_id.employee_ids and record.node_btn_id.is_carbon_copy:
|
||||
record.circulated_employee_ids = record.node_btn_id.employee_ids
|
||||
|
||||
if not record.trans_link_id:
|
||||
continue
|
||||
record_id = self.env[record.res_model].browse(record.res_id) if record.res_model and record.res_id else None
|
||||
|
||||
# 排除规则:流程退回 不限制
|
||||
if record_id and record_id.workflow_id:
|
||||
has_exclude_log = record_id.log_ids.filtered(lambda l: l.node_btn_name == '1')
|
||||
if not has_exclude_log:
|
||||
# 1. 从 valid_links 里 匹配出 当前流程会经过的【必经节点】
|
||||
current_mandatory_nodes = self.env['soong.workflow.node']
|
||||
for link in valid_links:
|
||||
link_node = record_id.workflow_id.node_ids.search([
|
||||
('name', '=', link.name),
|
||||
('workflow_id', '=', record_id.workflow_id.id)
|
||||
], limit=1)
|
||||
if link_node and link_node.is_mandatory_node:
|
||||
current_mandatory_nodes |= link_node
|
||||
|
||||
if current_mandatory_nodes:
|
||||
# 2. 取第一个必经节点
|
||||
first_mandatory = current_mandatory_nodes.sorted('sequence')[0]
|
||||
# 3. 只允许选择 <= 第一个必经节点 的链接
|
||||
allow_links = self.env['trans.link']
|
||||
for link in valid_links:
|
||||
link_node = record_id.workflow_id.node_ids.search([
|
||||
('name', '=', link.name),
|
||||
('workflow_id', '=', record_id.workflow_id.id)
|
||||
], limit=1)
|
||||
if link_node and link_node.sequence <= first_mandatory.sequence:
|
||||
allow_links |= link
|
||||
|
||||
# 4. 校验:选了必经节点之后的 → 报错
|
||||
if record.trans_link_id not in allow_links:
|
||||
record.trans_link_id = False
|
||||
raise UserError(f"节点【{first_mandatory.name}】是必经节点,不可跳过!")
|
||||
|
||||
for link in record.trans_link_id:
|
||||
employee_user_role_ids = self.env['hr.employee']
|
||||
if link.name == '印章管理员':
|
||||
@@ -1075,6 +1117,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
if self.res_model == 'purchase.order':
|
||||
record.write({'purchase_state': 'done'})
|
||||
record.log_ids[-1].write({'is_active_operate': True,
|
||||
'lase_click_date': fields.Datetime.now(),
|
||||
'approval_state': '1'
|
||||
})
|
||||
workflow_record_id = self.env['soong.workflow.record'].sudo().search([('res_id', '=', record_id.id),
|
||||
|
||||
@@ -26,7 +26,7 @@ class YuthonHrEmployee(models.Model):
|
||||
对原模型数据的隐藏,字段的开发和添加
|
||||
"""
|
||||
_inherit = "hr.employee"
|
||||
_order = 'user_number asc'
|
||||
_order = 'number asc'
|
||||
|
||||
# name = fields.CharWithPinyin(default_export_compatible=True)
|
||||
user_role_ids_changed = fields.Boolean(string="xxx") # bug
|
||||
|
||||
@@ -589,7 +589,7 @@
|
||||
<field name="name">hr.employee.member</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="会员列表" create="false" delete="false" editable="bottom">
|
||||
<tree string="会员列表" create="false" delete="false" editable="bottom" default_order="number asc">
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="work_phone" readonly="1"/>
|
||||
<field name="department_id" readonly="1" options='{"no_open": True, "no_create": True}'/>
|
||||
|
||||
@@ -99,11 +99,16 @@ class RoomBooking(models.Model):
|
||||
meet.issue_library_id.issue_state = False
|
||||
|
||||
if self.code:
|
||||
self.env['issue.library.approval.line'].create({
|
||||
'issue_library_id': meet.issue_library_id.id,
|
||||
'code': self.code,
|
||||
'approval_date': fields.Datetime.now() + timedelta(hours=8),
|
||||
})
|
||||
exists = self.env['issue.library.approval.line'].search([
|
||||
('issue_library_id', '=', meet.issue_library_id.id),
|
||||
('code', '=', self.code)
|
||||
], limit=1)
|
||||
if not exists:
|
||||
self.env['issue.library.approval.line'].create({
|
||||
'issue_library_id': meet.issue_library_id.id,
|
||||
'code': self.code,
|
||||
'approval_date': fields.Datetime.now() + timedelta(hours=8),
|
||||
})
|
||||
|
||||
@api.depends_context('uid', 'company')
|
||||
@api.depends('company_id')
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<button name="open_record" type="object" string="详情" class="oe_highlight"/>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="meeting_booking_id" column_invisible="1"/>
|
||||
<field name="issue_library_text"/>
|
||||
<field name="issue_library_id"/>
|
||||
<field name="employee_id" options="{'no_create': True}"/>
|
||||
<field name="attendees_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
<field name="users_role_group_ids" widget="many2many_tags" options="{'no_create': True}"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<field name="name">issue.meeting.minutes.tree</field>
|
||||
<field name="model">issue.meeting.minutes</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="会议纪要">
|
||||
<tree string="会议纪要" default_order="meeting_date desc">
|
||||
<field name="meeting_id"/>
|
||||
<field name="code"/>
|
||||
<field name="meeting_type_id"/>
|
||||
|
||||
@@ -135,10 +135,11 @@ class YuthonNotice(models.Model):
|
||||
notice.with_context(skip_constrains=True).users_ids = [(6, 0, list(all_users))]
|
||||
|
||||
if notice.users_ids and notice.is_change_notice:
|
||||
conf_old = self.env['yuthon.confirm.users'].search([('notice_id', '=', notice.id)])
|
||||
conf_old = self.env['yuthon.confirm.users'].sudo().search([('notice_id', '=', notice.id)])
|
||||
old_employee_ids = conf_old.mapped('employee_id.id')
|
||||
new_employee_ids = notice.users_ids.mapped('employee_ids.id')
|
||||
|
||||
new_employee_ids = self.env['hr.employee'].sudo().search([
|
||||
('user_id', 'in', notice.users_ids.ids)
|
||||
]).ids
|
||||
add_employee_ids = list(set(new_employee_ids) - set(old_employee_ids))
|
||||
del_employee_ids = list(set(old_employee_ids) - set(new_employee_ids))
|
||||
|
||||
@@ -148,11 +149,13 @@ class YuthonNotice(models.Model):
|
||||
del_conf.unlink()
|
||||
|
||||
if add_employee_ids:
|
||||
# add_users = self.users_ids.filtered(lambda u: u.employee_ids[0].id in add_employee_ids)
|
||||
for user in self.users_ids:
|
||||
all_employees = self.env['hr.employee'].sudo().search([
|
||||
('user_id', 'in', self.users_ids.ids)
|
||||
])
|
||||
for employee in all_employees:
|
||||
self.env['yuthon.confirm.users'].create({
|
||||
'notice_id': self.id,
|
||||
'employee_id': user.employee_id.id,
|
||||
'employee_id': employee.id,
|
||||
'notice_code': self.code,
|
||||
'notice_name': self.name,
|
||||
'release_date': self.create_date1,
|
||||
@@ -198,9 +201,9 @@ class YuthonNotice(models.Model):
|
||||
self.ensure_one()
|
||||
if self.is_change_notice:
|
||||
self.notice_state = 'yes'
|
||||
conf_old = self.env['yuthon.confirm.users'].search([
|
||||
conf_old = self.env['yuthon.confirm.users'].sudo().search([
|
||||
('notice_id', '=', self.id),
|
||||
('employee_id', 'in', self.users_ids.mapped('employee_ids.id'))
|
||||
('employee_id.user_id', 'in', self.users_ids.ids)
|
||||
])
|
||||
if conf_old:
|
||||
conf_old.write({'state': 'no'})
|
||||
@@ -210,36 +213,32 @@ class YuthonNotice(models.Model):
|
||||
if not employee:
|
||||
continue
|
||||
url = f'https://phone.thtzjt.com/phone/Notice/{self.id}?employee_id={employee.id}'
|
||||
|
||||
result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(
|
||||
category='notice',
|
||||
touser=user_id.employee_ids.wecom_userid,
|
||||
touser=employee.wecom_userid,
|
||||
title="通知公告",
|
||||
description=f"{self.name} 发布人: {self.users_id.name}",
|
||||
description=f"{self.name} 发布人: {self.users_id.name if self.users_id else ''}",
|
||||
url=url,
|
||||
btntxt="详细信息"
|
||||
)
|
||||
|
||||
msg_id = None
|
||||
if result_data:
|
||||
res_dict = result_data[1]
|
||||
msg_id = res_dict.get('msgid')
|
||||
|
||||
user_wecom_mapping.append({
|
||||
'emp_id': employee.id,
|
||||
'msg_id': msg_id
|
||||
})
|
||||
|
||||
for mapping in user_wecom_mapping:
|
||||
emp_id = mapping['emp_id']
|
||||
msg_id = mapping['msg_id']
|
||||
is_exist = self.env['yuthon.confirm.users'].search([
|
||||
is_exist = self.env['yuthon.confirm.users'].sudo().search([
|
||||
('notice_id', '=', self.id),
|
||||
('notice_code', '=', self.code),
|
||||
('employee_id', '=', emp_id)
|
||||
], limit=1)
|
||||
if not is_exist:
|
||||
self.env['yuthon.confirm.users'].create({
|
||||
self.env['yuthon.confirm.users'].sudo().create({
|
||||
'notice_id': self.id,
|
||||
'employee_id': emp_id,
|
||||
'notice_code': self.code,
|
||||
@@ -249,7 +248,7 @@ class YuthonNotice(models.Model):
|
||||
'msg_id': msg_id,
|
||||
})
|
||||
else:
|
||||
is_exist.write({
|
||||
is_exist.sudo().write({
|
||||
'state': 'no',
|
||||
'msg_id': msg_id,
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="公告管理" decoration-success="notice_state == 'yes'"
|
||||
decoration-info="notice_state == 'no'"
|
||||
decoration-muted="notice_state == 'stop'">
|
||||
decoration-muted="notice_state == 'stop'" default_order="create_date1 desc">
|
||||
<field name="name" required="1"/>
|
||||
<field name="notice_type_id" string="类型" class="list_ids_width"/>
|
||||
<field name="users_id" string="发布人" class="list_ids_width"/>
|
||||
@@ -125,7 +125,7 @@
|
||||
<tree string="公告管理" edit="false" delete="false" create="false"
|
||||
decoration-danger="is_notice_roger == 'no'"
|
||||
decoration-success="is_notice_roger == 'yes'"
|
||||
js_class="custom_notice_tree_button">
|
||||
js_class="custom_notice_tree_button" default_order="create_date1 desc">
|
||||
<field name="name"/>
|
||||
<field name="notice_type_id" string="类型"/>
|
||||
<field name="users_id" string="发布人" class="list_ids_width"/>
|
||||
|
||||
@@ -952,7 +952,7 @@ class PropertyAccountsReceivable(models.Model):
|
||||
@api.depends('contract_id')
|
||||
def _compute_property_name(self):
|
||||
for record in self:
|
||||
record.property_name = record.contract_id.property_name
|
||||
record.property_name = record.contract_id.use_address
|
||||
|
||||
@api.depends('property_ids')
|
||||
def _compute_title_deed(self):
|
||||
|
||||
@@ -19,6 +19,14 @@ class PropertyBillsList(models.Model):
|
||||
workflow_record_id = fields.Many2one('soong.workflow.record', string="流程")
|
||||
fee_id = fields.Many2one('property.fee.form', string="费用")
|
||||
remake = fields.Text(string="备注")
|
||||
pay_state = fields.Selection([('unpaid', '待付'), ('paid', '已付')], string="支付状态", default="unpaid")
|
||||
|
||||
def update_pay_state(self):
|
||||
bills_ids = self.env["property.bills.list"].browse(
|
||||
self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in bills_ids:
|
||||
if record.actual_date:
|
||||
record.pay_state = 'paid'
|
||||
|
||||
def update_lessor_id(self):
|
||||
bills_ids = self.env["property.bills.list"].browse(
|
||||
|
||||
@@ -213,13 +213,6 @@ class PropertyLeaseRenewal(models.Model):
|
||||
elif lessor_id.referred in ['天河粮储']:
|
||||
company_id = self.env['res.company'].search([('name', '=', '天河粮储')], limit=1)
|
||||
|
||||
bank_accounts = self.env['property.bank.line'].search([
|
||||
('tenant_id', '=', rec.lessee_id.id)
|
||||
]).mapped('bank')
|
||||
bank_accounts = [acc for acc in bank_accounts if acc][0]
|
||||
rec.contract_id.write({
|
||||
'actual_end_time': rec.early_quitting_date
|
||||
})
|
||||
if not rec.is_full_refund:
|
||||
penalty_amount = rec.deposit - rec.refund_amount - rec.total_receivables
|
||||
if penalty_amount > 0:
|
||||
@@ -292,6 +285,13 @@ class PropertyLeaseRenewal(models.Model):
|
||||
('workflow_record_id', '=', workflow_record_id.id),
|
||||
], limit=1)
|
||||
if not existing_bank_statement:
|
||||
bank_accounts = self.env['property.bank.line'].search([
|
||||
('tenant_id', '=', rec.lessee_id.id)
|
||||
]).mapped('bank')
|
||||
bank_accounts = [acc for acc in bank_accounts if acc][0]
|
||||
rec.contract_id.write({
|
||||
'actual_end_time': rec.early_quitting_date
|
||||
})
|
||||
bank_id = self.env['property.bank.statements'].sudo().create({
|
||||
'start_time': start_time,
|
||||
'name': bank_accounts,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<field name="name">property.bills.list.tree</field>
|
||||
<field name="model">property.bills.list</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="应收账单" editable="bottom">
|
||||
<tree string="应收账单" editable="bottom" default_order="due_date desc">
|
||||
<field name="due_date"/>
|
||||
<field name="actual_date"/>
|
||||
<field name="management_type_id"/>
|
||||
@@ -24,10 +24,25 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_property_bills_list_search" model="ir.ui.view">
|
||||
<field name="name">property.bills.list.search</field>
|
||||
<field name="model">property.bills.list</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="contract_id"/>
|
||||
<field name="property_name"/>
|
||||
<field name="lessee_id"/>
|
||||
<group expand="0" string="分组">
|
||||
<filter string="状态" name="group_pay_state" context="{'group_by':'pay_state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_property_bills_list_action" model="ir.actions.act_window">
|
||||
<field name="name">应收账单</field>
|
||||
<field name="res_model">property.bills.list</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">tree,search</field>
|
||||
<field name="context">{'search_default_group_pay_state': 1}</field>
|
||||
</record>
|
||||
<record id="all_update_lessor_id" model="ir.actions.server">
|
||||
<field name="name">更新支付公司</field>
|
||||
@@ -36,6 +51,13 @@
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.update_lessor_id()</field>
|
||||
</record>
|
||||
<record id="all_update_pay_state" model="ir.actions.server">
|
||||
<field name="name">一次性</field>
|
||||
<field name="model_id" ref="yuthon_property_approval.model_property_bills_list"/>
|
||||
<field name="binding_model_id" ref="yuthon_property_approval.model_property_bills_list"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = model.update_pay_state()</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class PropertyBillsWizard(models.TransientModel):
|
||||
|
||||
if self.actual_date:
|
||||
self.bills_list_id.actual_date = self.actual_date
|
||||
self.bills_list_id.pay_state = 'paid'
|
||||
receivable = self.env['property.accounts.receivable'].search([('contract_id', '=', self.bills_list_id.contract_id.id),
|
||||
('management_type_id', '=', self.bills_list_i.management_type_id.id)
|
||||
])
|
||||
|
||||
@@ -90,6 +90,7 @@ class YuthonSalaryActive(models.Model):
|
||||
one_year_sum = fields.Float(string='一次性年终奖应发合计')
|
||||
one_year_tax = fields.Float(string='一次性年终奖计税')
|
||||
one_year_net = fields.Float(string='一次性年终奖实发')
|
||||
enterprise_promotion_bonus_2025 = fields.Float(string='2025年企业宣传奖励')
|
||||
insurance = fields.Float(string='保险', compute='_compute_insurance')
|
||||
|
||||
@api.depends("basic_endowment_insurance", "basic_medical_insurance", "unemployment_insurance",)
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<field name="balance_salary" string="2025年结余工资"/>
|
||||
<field name="liquidation_salary_staff" string="2024年清算工资(职工)"/>
|
||||
<field name="business_special_bonus" string="2025经营特别奖"/>
|
||||
<field name="enterprise_promotion_bonus_2025" string="2025企业宣传奖励"/>
|
||||
<field name="business_base" string="2025年基础年终奖"/>
|
||||
<field name="one_year_sum" string="一次性年终奖应发合计"/>
|
||||
<field name="one_year_tax" string="一次性年终奖计税"/>
|
||||
|
||||
Reference in New Issue
Block a user