diff --git a/soong_workflow/__manifest__.py b/soong_workflow/__manifest__.py
index da0bcdb5b..c1f380cbc 100644
--- a/soong_workflow/__manifest__.py
+++ b/soong_workflow/__manifest__.py
@@ -38,6 +38,7 @@
"wizard/soong_workflow_apostille_ok_wizard_view.xml",
"wizard/soong_workflow_record_revoke_wizard_view.xml",
"wizard/soong_workflow_record_delete_wizard_view.xml",
+ 'wizard/change_opinions_wizard_views.xml',
"templates/soong_workflow_templates.xml",
"views/menuitem.xml",
],
diff --git a/soong_workflow/models/soong_workflow.py b/soong_workflow/models/soong_workflow.py
index 35ff97155..89dab4266 100644
--- a/soong_workflow/models/soong_workflow.py
+++ b/soong_workflow/models/soong_workflow.py
@@ -60,6 +60,20 @@ class SoongWorkflow(models.Model):
employee_ids = fields.Many2many('hr.employee', string="人员")
role_ids = fields.Many2many('soong.user.role', 'soong_workflow_role_rel', 'workflow_id', 'user_role_id', string="角色")
+ def change_opinions_wizard(self):
+ soong_ids = self.env["soong.workflow"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ return {
+ 'name': '变更意见',
+ 'type': 'ir.actions.act_window',
+ 'view_mode': 'form',
+ 'res_model': 'change.opinions.wizard',
+ 'target': 'new',
+ 'context': {
+ 'default_soong_ids': [(6, 0, soong_ids.ids)],
+ }
+ }
+
@api.onchange('is_ease')
def _onchange_is_ease(self):
target_value = not self.is_ease
diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py
index 3d7740cb4..260033042 100644
--- a/soong_workflow/models/soong_workflow_mixin.py
+++ b/soong_workflow/models/soong_workflow_mixin.py
@@ -442,9 +442,9 @@ class SoongWorkflowMixin(models.AbstractModel):
is_supervising = False
if self._module in ['yuthon_official']:
is_supervising = self.is_supervising
- is_first_node = (self_state == 0)
- if is_first_node:
- comment_note_id = self.env['soong.note'].search([('name', '=', '妥否,呈领导审批。')], limit=1).id
+
+ if btn_rec.node_id.comment_id:
+ comment_note_id = btn_rec.node_id.comment_id.id
else:
comment_note_id = False
return {
diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py
index 2762bcb3d..18f5274fd 100644
--- a/soong_workflow/models/soong_workflow_node.py
+++ b/soong_workflow/models/soong_workflow_node.py
@@ -88,6 +88,7 @@ class SoongWorkflowNode(models.Model):
employee_ids = fields.Many2many('hr.employee', string='抄送/传阅人员')
is_end = fields.Boolean(string="结束", default=False)
department_id = fields.Many2many('hr.department', string='部门转入范围')
+ comment_id = fields.Many2one('soong.note', string="固定意见")
approval_concatenation = fields.Selection([('chuan', '串申'), ('bing', '并申')], string="审批形式", default="bing",
help='并:任何人均给意见,最后一个完成的人转交到下一节点.'
'串:都会收到消息,但任意一个人转交后,即到下一节点,其他人将不再显示,相当于收回.')
diff --git a/soong_workflow/security/ir.model.access.csv b/soong_workflow/security/ir.model.access.csv
index 997e0429c..f2349e69d 100644
--- a/soong_workflow/security/ir.model.access.csv
+++ b/soong_workflow/security/ir.model.access.csv
@@ -47,4 +47,6 @@ access_soong_workflow_record_revoke_wizard,soong_workflow_record_revoke_wizard,m
access_soong_workflow_line,soong_workflow_line,model_soong_workflow_line,soong_workflow.group_soong_workflow_user,1,1,1,1
access_project_project_line,project_project_line,model_project_project_line,soong_workflow.group_soong_workflow_user,1,1,1,1
access_soong_bounced_wizard,soong_bounced_wizard,model_soong_bounced_wizard,base.group_user,1,1,1,1
-access_workflow_line_wizard,workflow_line_wizard,model_workflow_line_wizard,soong_workflow.group_soong_workflow_user,1,1,1,1
\ No newline at end of file
+access_workflow_line_wizard,workflow_line_wizard,model_workflow_line_wizard,soong_workflow.group_soong_workflow_user,1,1,1,1
+
+access_change_opinions_wizard,change_opinions_wizard,model_change_opinions_wizard,soong_workflow.group_soong_workflow_user,1,1,1,1
\ No newline at end of file
diff --git a/soong_workflow/views/soong_workflow_node_views.xml b/soong_workflow/views/soong_workflow_node_views.xml
index d61c64225..235244391 100644
--- a/soong_workflow/views/soong_workflow_node_views.xml
+++ b/soong_workflow/views/soong_workflow_node_views.xml
@@ -13,6 +13,7 @@
+
diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml
index cbbca6feb..0381203ed 100644
--- a/soong_workflow/views/soong_workflow_record.xml
+++ b/soong_workflow/views/soong_workflow_record.xml
@@ -128,7 +128,7 @@
-
+
diff --git a/soong_workflow/views/soong_workflow_views.xml b/soong_workflow/views/soong_workflow_views.xml
index b75b2807d..daef6f356 100644
--- a/soong_workflow/views/soong_workflow_views.xml
+++ b/soong_workflow/views/soong_workflow_views.xml
@@ -115,4 +115,11 @@
soong.workflow
tree,form,search
+
+ 变更意见
+
+
+ code
+ action = model.change_opinions_wizard()
+
diff --git a/soong_workflow/wizard/__init__.py b/soong_workflow/wizard/__init__.py
index 4dc337751..5cef6345a 100644
--- a/soong_workflow/wizard/__init__.py
+++ b/soong_workflow/wizard/__init__.py
@@ -9,5 +9,6 @@ from . import soong_workflow_record_revoke_wizard
from . import role_group_wizard
from . import workflow_line_wizard
from . import soong_bounced_wizard
+from . import change_opinions_wizard
diff --git a/soong_workflow/wizard/change_opinions_wizard.py b/soong_workflow/wizard/change_opinions_wizard.py
new file mode 100644
index 000000000..bef615b69
--- /dev/null
+++ b/soong_workflow/wizard/change_opinions_wizard.py
@@ -0,0 +1,22 @@
+from odoo import fields, models, api
+from odoo.exceptions import UserError, ValidationError
+from datetime import datetime, date, time, timedelta
+
+
+class ChangeOpinionsWizard(models.Model):
+ _name = 'change.opinions.wizard'
+ _description = '变更意见'
+
+ node_name = fields.Char(string="节点名称")
+ comment_id = fields.Many2one('soong.note', string="意见")
+ soong_ids = fields.Many2many('soong.workflow')
+
+ def confirm(self):
+ for soong in self.soong_ids:
+ for node in soong.node_ids:
+ if node.name == self.node_name:
+ node.comment_id = self.comment_id
+
+
+
+
diff --git a/soong_workflow/wizard/change_opinions_wizard_views.xml b/soong_workflow/wizard/change_opinions_wizard_views.xml
new file mode 100644
index 000000000..b479a81be
--- /dev/null
+++ b/soong_workflow/wizard/change_opinions_wizard_views.xml
@@ -0,0 +1,21 @@
+
+
+
+ 变更意见
+ change.opinions.wizard
+ form
+
+
+
+
+
\ No newline at end of file
diff --git a/soong_workflow/wizard/soong_workflow_record_delete_wizard.py b/soong_workflow/wizard/soong_workflow_record_delete_wizard.py
index 62d6bae34..e4e1043ef 100644
--- a/soong_workflow/wizard/soong_workflow_record_delete_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_record_delete_wizard.py
@@ -21,6 +21,19 @@ class SoongWorkflowRecordDeleteWizard(models.TransientModel):
workflow_record = self.env["soong.workflow.record"].sudo().search([("id", "=", record.id)], limit=1)
if not workflow_record:
continue
+ # 议题状态恢复
+ if workflow_record.res_model == "issue.approval":
+ issue_id = self.env["issue.approval"].sudo().search([("id", "=", workflow_record.res_id)], limit=1)
+ issue_line_records = self.env['issue.approval.line'].search([
+ ('issue_approval_id', '=', issue_id.id)
+ ])
+ if issue_line_records:
+ issue_line_records.unlink()
+ issue_library_id = self.env["issue.library"].sudo().search([("issue_approval_id", "=", issue_id.id)], limit=1)
+ if issue_library_id:
+ issue_library_id.write({'issue_state': 'draft'})
+
+
# 删除假期额度里面的对应的流程记录
related_detail_models = [
'vacation.leave.line',
diff --git a/yuthon_base/views/menu.xml b/yuthon_base/views/menu.xml
index 5c2171364..1c7da27fb 100644
--- a/yuthon_base/views/menu.xml
+++ b/yuthon_base/views/menu.xml
@@ -25,7 +25,7 @@
sequence="1"/>
\ No newline at end of file
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index 9fc7fd241..444d9b35a 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -253,6 +253,15 @@ class YuthonHrEmployee(models.Model):
('divorced', 'Divorced')
], string='Marital Status', groups="hr.group_hr_user", default='single', tracking=True)
+ def update_trade_union(self):
+ records = self.env['hr.employee'].search([('is_membership', '=', True)])
+ for record in records:
+ if record.contract_id.termination_date:
+ if record.contract_id.termination_date <= date.today() + timedelta(days=8):
+ record.is_membership = False
+ if record.contract_id.date_end <= date.today() + timedelta(days=8):
+ record.is_membership = False
+
@api.depends('date_end')
def _compute_end_comparison(self):
for record in self:
diff --git a/yuthon_hr_employee_approval/models/contract_review_approval.py b/yuthon_hr_employee_approval/models/contract_review_approval.py
index 092a8ce85..df8920d11 100644
--- a/yuthon_hr_employee_approval/models/contract_review_approval.py
+++ b/yuthon_hr_employee_approval/models/contract_review_approval.py
@@ -9,13 +9,17 @@ class ContractReviewApproval(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('contract_review_approval_code'))
name = fields.Char(string='合同名称')
- user_id = fields.Many2one('res.users', string='合同经办人')
+ user_id = fields.Many2one('res.users', string='合同经办人', default=lambda self: self.env.user)
is_issues = fields.Boolean(string='是否上会')
issues_result = fields.Html(string="会议结果")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
department_id = fields.Many2one('hr.department', string='送审部门')
amount = fields.Float(string='合同金额')
remarks = fields.Text(string='情况说明')
+ purchase_type = fields.Selection(
+ [('fixed', '固定资产'), ('low', '低值易耗'), ('service', '服务'), ('day', '日常消耗品')],
+ string="采购类型", required=True, default='fixed')
+
documents_ids = fields.Many2many('ir.attachment', string="附件")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -23,9 +27,6 @@ class ContractReviewApproval(models.Model):
work_end = fields.Boolean(string="结束")
contract_type = fields.Many2one('yuthon.contract.type', string="合同类型")
formation_method = fields.Many2one('yuthon.contract.type', string="形成方式")
- submitting_unit = fields.Char(string="送审单位")
- sign_date = fields.Date(string="合同签订日期")
- performance_term_day = fields.Integer(string='履约期限')
def _get_default_name_title(self):
return self._description if self._description else self._name
diff --git a/yuthon_hr_employee_approval/models/inherit_hr_employee.py b/yuthon_hr_employee_approval/models/inherit_hr_employee.py
index 88890bcff..69e501b10 100644
--- a/yuthon_hr_employee_approval/models/inherit_hr_employee.py
+++ b/yuthon_hr_employee_approval/models/inherit_hr_employee.py
@@ -19,7 +19,7 @@ class YuthonHrEmployee(models.Model):
"views": [[form_id, "form"]],
"context":{
'default_employee_id': employee.id,
- 'default_phone': employee.work_phone,
+ 'default_phone': employee.mobile_phone,
'default_job_id': employee.job_id.id,
'default_structure_id': employee.contract_id.structure_type_id.id if employee.contract_id else False,
'default_onboarding_date': employee.entry_date,
diff --git a/yuthon_hr_employee_approval/views/contract_review_approval_views.xml b/yuthon_hr_employee_approval/views/contract_review_approval_views.xml
index cdfa0e43f..b1f3e9283 100644
--- a/yuthon_hr_employee_approval/views/contract_review_approval_views.xml
+++ b/yuthon_hr_employee_approval/views/contract_review_approval_views.xml
@@ -46,16 +46,13 @@
-
+
-
+
-
-
-
diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py
index d840f30fa..7a7b70cdd 100644
--- a/yuthon_issue/models/issue_library.py
+++ b/yuthon_issue/models/issue_library.py
@@ -60,6 +60,48 @@ class IssueLibrary(models.Model):
member_of_department = fields.Boolean("是否是本部门数据", compute='_compute_part_of_department',
search='_search_part_of_department')
+ is_passed = fields.Selection([('',''), ('pass', '通过'), ('reject', '未通过')])
+ is_push_party = fields.Boolean(string="党推送")
+ is_push_class = fields.Boolean(string="班子推送")
+ is_push_boss = fields.Boolean(string="董事推送")
+
+ def correction(self):
+ for rec in self:
+ menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的议题')])
+ url = f'https://oa.thtzjt.com/web#id={self.id}&cids=2&action={menu_id.action.id}&model=yuthon.notice&view_type=list&menu_id={menu_id.id}'
+ self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
+ user_id=rec.employee_id.wecom_userid,
+ title="议题修正",
+ description="您有待修正的议题,请尽快修正",
+ url=url, btntxt="详细信息")
+ return {
+ 'type': 'ir.actions.client',
+ 'tag': 'display_notification',
+ 'params': {
+ 'type': 'success',
+ 'message': '已发送提醒消息',
+ 'sticky': False,
+ }
+ }
+
+ def library_push(self):
+ for rec in self:
+ if rec.is_passed != 'pass':
+ raise UserError("当前状态不允许推送")
+
+ push_update_vals = {}
+ if rec.is_party and rec.is_passed:
+ push_update_vals['is_push_party'] = True
+
+ if rec.is_class and rec.is_passed:
+ push_update_vals['is_push_class'] = True
+
+ if rec.is_boss and rec.is_passed:
+ push_update_vals['is_push_boss'] = True
+
+ if push_update_vals:
+ rec.write(push_update_vals)
+
def add_workflow(self):
return {
'name': '流程添加弹窗',
@@ -115,15 +157,26 @@ class IssueLibrary(models.Model):
specifics_list.append(line.issue_approval_decision_id.specifics)
dec.approval_decision_sequence = ';'.join(specifics_list) if specifics_list else ''
+ def revoke(self):
+ self.write({'issue_state': 'draft'})
+ if self.issue_approval_id:
+ issue_line_records = self.env['issue.approval.line'].search([
+ ('issue_approval_id', '=', self.issue_approval_id.id)
+ ])
+ if issue_line_records:
+ issue_line_records.unlink()
+ workflow_id = self.env['soong.workflow.record'].search([('res_model', '=', 'issue.approval'),
+ ('res_id', '=', self.issue_approval_id.id)], limit=1)
+ if workflow_id:
+ workflow_id.sudo().unlink()
+ self.issue_approval_id.unlink()
+
+
def all_issue_pull(self):
issue_active_ids = self.env["issue.library"].browse(self._context.get('active_ids', self._context.get('active_id')))
- if not issue_active_ids:
- if self.issue_state != 'draft':
+ for i in issue_active_ids:
+ if i.issue_state != 'draft':
raise UserError("当前状态不允许提交")
- else:
- for i in issue_active_ids:
- if i.issue_state != 'draft':
- raise UserError("当前状态不允许提交")
form_id = self.env.ref("yuthon_issue.issue_library_approval_form").id
issue_decision_lines = []
specifics_list = []
@@ -227,7 +280,7 @@ class IssueLibrary(models.Model):
def single_meeting_issue(self):
issue = self.env["issue.library"].browse(self.id)
- if issue.state != 'will':
+ if issue.issue_state != 'will':
raise UserError("当前状态不允许上会")
self.write({"issue_state": "on_meet"})
issue_details = [(0, 0, {
diff --git a/yuthon_issue/views/issue_library_views.xml b/yuthon_issue/views/issue_library_views.xml
index 913c69e7a..eb254e9e0 100644
--- a/yuthon_issue/views/issue_library_views.xml
+++ b/yuthon_issue/views/issue_library_views.xml
@@ -29,6 +29,8 @@
+
+
@@ -213,6 +215,7 @@
+
@@ -327,7 +330,7 @@
党总支议题库
issue.library
tree,form
- [('is_party', '=', True)]
+ [('is_push_party', '=', True)]
党支委议题库
issue.library
tree,form
- [('is_party', '=', True)]
+ [('is_push_party', '=', True)]
+
@@ -481,7 +485,7 @@
班子会议题库
issue.library
tree,form
- [('is_class', '=', True)]
+ [('is_push_class', '=', True)]
+
@@ -623,7 +628,7 @@
董事会议题库
issue.library
tree,form
- [('is_boss', '=', True)]
+ [('is_push_boss', '=', True)]
= record.end_time:
+ record.archives_state = "stop"
+
def delete_data(self):
archives_ids = self.env["property.meter.archives"].browse(
self._context.get('active_ids', self._context.get('active_id')))
diff --git a/yuthon_property/models/property_meter_water.py b/yuthon_property/models/property_meter_water.py
index 2f26ec730..b89ac5e77 100644
--- a/yuthon_property/models/property_meter_water.py
+++ b/yuthon_property/models/property_meter_water.py
@@ -1,6 +1,7 @@
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
from datetime import datetime
+from datetime import datetime, timedelta, date
class PropertyElectricReading(models.Model):
@@ -53,6 +54,14 @@ class PropertyMeterWater(models.Model):
)
remarks = fields.Text(string="备注")
+ def update_water_state(self):
+ current_date = fields.Date.today() + timedelta(hours=8)
+ records = self.env["property.meter.water"].search([])
+ for record in records:
+ if record.end_time:
+ if current_date >= record.end_time:
+ record.water_state = "stop"
+
def water_task(self):
current_date = fields.Date.today()
current_date = current_date.replace(day=15)
diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py
index 8f2a86f44..6e5a0e939 100644
--- a/yuthon_purchase/models/inherit_purchase_order.py
+++ b/yuthon_purchase/models/inherit_purchase_order.py
@@ -21,7 +21,6 @@ class InheritPurchaseOrder(models.Model):
('分管领导', '分管领导'),
('总经理', '总经理')], default='draft')
work_end = fields.Boolean(string="结束")
- active = fields.Boolean('Active', default=True, tracking=True)
user_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user)
company_id = fields.Many2one(related='user_id.employee_ids.company_id', string="公司")
department_id = fields.Many2one(related='user_id.employee_ids.department_id', string="部门")
diff --git a/yuthon_purchase/views/inherit_purchase_order_views.xml b/yuthon_purchase/views/inherit_purchase_order_views.xml
index d4087cd1d..b667adcd7 100644
--- a/yuthon_purchase/views/inherit_purchase_order_views.xml
+++ b/yuthon_purchase/views/inherit_purchase_order_views.xml
@@ -64,7 +64,6 @@
-
明细
diff --git a/yuthon_trade/views/yuthon_business_approval_viwes.xml b/yuthon_trade/views/yuthon_business_approval_viwes.xml
index 1a53f58e6..041dde8f3 100644
--- a/yuthon_trade/views/yuthon_business_approval_viwes.xml
+++ b/yuthon_trade/views/yuthon_business_approval_viwes.xml
@@ -46,13 +46,13 @@
-
+
+
+
+
-
-
-