diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index f34f19399..d8570cbd4 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -126,11 +126,6 @@ class InheritHrPayslip(models.Model): self.env['hr.payslip.line'].create(payslips._get_payslip_lines()) return True - def action_refresh_from_work_entries_twice(self): - self.action_refresh_from_work_entries() - self.action_refresh_from_work_entries() - return True - @api.depends('line_ids') def _compute_salary(self): for rec in self: diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml index 9106268f9..ae905c367 100644 --- a/yuthon_salary/views/inherit_hr_payslip_views.xml +++ b/yuthon_salary/views/inherit_hr_payslip_views.xml @@ -259,7 +259,7 @@
diff --git a/yuthon_trade/__manifest__.py b/yuthon_trade/__manifest__.py index 01398277f..5e1cd3223 100644 --- a/yuthon_trade/__manifest__.py +++ b/yuthon_trade/__manifest__.py @@ -18,6 +18,8 @@ 'views/yuthon_trade_policy.xml', 'views/yuthon_trade_purchase.xml', 'views/yuthon_trade_premium.xml', + 'views/yuthon_business_approval_viwes.xml', + 'views/yuthon_seals_approval_views.xml', 'views/yuthon_trade_refund.xml', 'views/yuthon_trade_reimbursed.xml', 'views/yuthon_message_approval_views.xml', diff --git a/yuthon_trade/data/sale_renting_code_data.xml b/yuthon_trade/data/sale_renting_code_data.xml index 8e4215ca5..a38b56a33 100644 --- a/yuthon_trade/data/sale_renting_code_data.xml +++ b/yuthon_trade/data/sale_renting_code_data.xml @@ -5,6 +5,28 @@ property_work_condolences_code JR%(y)s%(month)s%(day)s 3 + + + + 用章审批编号 + yuthon_seals_approval_code + YZ%(y)s%(month)s%(day)s + 3 + + + + 业务审批编号 + yuthon_business_approval_code + YW%(y)s%(month)s%(day)s + 3 + + + + 节日慰问编号 + property_work_condolences_code + JR%(y)s%(month)s%(day)s + 3 + 作业审批编号 diff --git a/yuthon_trade/models/__init__.py b/yuthon_trade/models/__init__.py index 6bd5a0366..0c3d4224e 100644 --- a/yuthon_trade/models/__init__.py +++ b/yuthon_trade/models/__init__.py @@ -20,3 +20,5 @@ from . import yuthon_insurance_policy from . import yuthon_task_approval from . import yuthon_task_setting from . import trade_reward_approval +from . import yuthon_seals_approval +from . import yuthon_business_approval diff --git a/yuthon_trade/models/yuthon_business_approval.py b/yuthon_trade/models/yuthon_business_approval.py new file mode 100644 index 000000000..482cfe0a7 --- /dev/null +++ b/yuthon_trade/models/yuthon_business_approval.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ + +class YuthonBusinessApproval(models.Model): + _name = 'yuthon.business.approval' + _description = '业务审批' + _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] + + name = fields.Char(string='标题') + code = fields.Char(string="流水号", + default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_business_approval_code')) + users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) + urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', + default='normal') + department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") + is_issues = fields.Boolean(string='是否上会') + issues_result = fields.Html(string="会议结果") + related_issues_id = fields.Many2one('issue.library', string="关联议题") + reason = fields.Html(string="正文") + document_ids = fields.Many2many('ir.attachment', string="附件") + active = fields.Boolean('Active', default=True, tracking=True) + work_end = fields.Boolean(string="结束") + + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) + + @api.onchange('is_issues') + def _onchange_is_issues(self): + if self.is_issues: + issue_id = self.env['issue.library'].create({'name': self.name}) + self.related_issues_id = issue_id.id + workflow_record_id = self.env["soong.workflow.record"].search( + [("res_model", "=", self._name), ("res_id", "=", self.id)]) + self.env['issue.library.approval.line'].create({ + 'issue_library_id': issue_id.id, + 'workflow_record_id': workflow_record_id.id, + 'approval_type': workflow_record_id.workflow_id.id, + 'code': self.code, + 'approval_date': fields.Datetime.now(), + }) \ No newline at end of file diff --git a/yuthon_trade/models/yuthon_seals_approval.py b/yuthon_trade/models/yuthon_seals_approval.py new file mode 100644 index 000000000..1847178b6 --- /dev/null +++ b/yuthon_trade/models/yuthon_seals_approval.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ + +class YuthonSealsApproval(models.Model): + _name = 'yuthon.seals.approval' + _description = '用章审批' + _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin'] + _rec_name = 'name' + + name = fields.Char(string='用章事项') + code = fields.Char(string="流水号", + default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_seals_approval_code')) + users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) + department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") + document_ids = fields.Many2many('ir.attachment', string="附件") + urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', + default='normal') + type_stamp = fields.Selection([('official', '公章'), ('contract', '合同章'), ('seal', '法人章'), + ('salary', '财务章'), ('other', '其他')], string='用章类型', default='official') + scope_chapter = fields.Selection([('thtz', '天河投资'), ('ttcj', '天投城建'), + ('thwg', '天河物管'), ('thlc', '天河粮储')], string='用章范围', default='thtz') + approval_id = fields.Many2one('hr.department', string="发送单位") + remake = fields.Text(string="用章意见") + active = fields.Boolean('Active', default=True, tracking=True) + work_end = fields.Boolean(string="结束") + def _get_default_name_title(self): + return self._description if self._description else self._name + + name_title = fields.Char(default=_get_default_name_title) diff --git a/yuthon_trade/security/ir.model.access.csv b/yuthon_trade/security/ir.model.access.csv index 91a45f433..c3261b36b 100644 --- a/yuthon_trade/security/ir.model.access.csv +++ b/yuthon_trade/security/ir.model.access.csv @@ -12,6 +12,8 @@ access_yuthon_trade_reimbursed,yuthon_trade_reimbursed,model_yuthon_trade_reimbu access_yuthon_trade_supportive,yuthon_trade_supportive,model_yuthon_trade_supportive,base.group_user,1,1,1,1 access_yuthon_care_condolences,yuthon_care_condolences,model_yuthon_care_condolences,base.group_user,1,1,1,1 access_yuthon_work_condolences,yuthon_work_condolences,model_yuthon_work_condolences,base.group_user,1,1,1,1 +access_yuthon_seals_approval,yuthon_seals_approval,model_yuthon_seals_approval,base.group_user,1,1,1,1 +access_yuthon_business_approval,yuthon_business_approval,model_yuthon_business_approval,base.group_user,1,1,1,1 access_yuthon_care_setting,yuthon_care_setting,model_yuthon_care_setting,base.group_user,1,1,1,1 access_yuthon_work_setting,yuthon_work_setting,model_yuthon_work_setting,base.group_user,1,1,1,1 diff --git a/yuthon_trade/views/yuthon_business_approval_viwes.xml b/yuthon_trade/views/yuthon_business_approval_viwes.xml new file mode 100644 index 000000000..1a0d31249 --- /dev/null +++ b/yuthon_trade/views/yuthon_business_approval_viwes.xml @@ -0,0 +1,60 @@ + + + + yuthon.business.approval.tree + yuthon.business.approval + + + + + + + + yuthon.business.approval.form + yuthon.business.approval + +
+ + + + + + + + + + + + + + + + + + +
+

+ +

+
+ + + + + + + + +
+
+
+
+ + 业务审批 + yuthon.business.approval + tree,form + +
diff --git a/yuthon_trade/views/yuthon_seals_approval_views.xml b/yuthon_trade/views/yuthon_seals_approval_views.xml new file mode 100644 index 000000000..6e6e7d82d --- /dev/null +++ b/yuthon_trade/views/yuthon_seals_approval_views.xml @@ -0,0 +1,58 @@ + + + + yuthon.seals.approval.tree + yuthon.seals.approval + + + + + + + + yuthon.seals.approval.form + yuthon.seals.approval + +
+ + + + + + + + + + + + + +
+

+ +

+
+ + + + + + + + + + + +
+
+
+
+ + 用章审批 + yuthon.seals.approval + tree,form + +
\ No newline at end of file diff --git a/yuthon_trade/views/yuthon_trade_menu.xml b/yuthon_trade/views/yuthon_trade_menu.xml index cb289c3c1..a80d0bdb2 100644 --- a/yuthon_trade/views/yuthon_trade_menu.xml +++ b/yuthon_trade/views/yuthon_trade_menu.xml @@ -98,6 +98,16 @@ parent="executive_trade_process_ment" action="view_trade_reward_approval_action" sequence="60"/> + +