From 293106471496fe8638c3fb6b49aec2861d588ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 1 Apr 2026 19:57:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E8=B4=B9=EF=BC=8C=E9=A4=90=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_salary/__manifest__.py | 4 +++ yuthon_salary/models/yuthon_meal_expenses.py | 24 +++++++++++++++++- yuthon_salary/models/yuthon_salary_party.py | 24 +++++++++++++++++- .../views/yuthon_meal_expenses_views.xml | 7 +++++- .../views/yuthon_salary_party_views.xml | 6 ++++- yuthon_salary/wizard/__init__.py | 5 +++- .../wizard/meal_expenses_review_wizard.py | 22 ++++++++++++++++ .../meal_expenses_review_wizard_views.xml | 25 +++++++++++++++++++ .../wizard/party_expenses_review_wizard.py | 22 ++++++++++++++++ .../party_expenses_review_wizard_views.xml | 20 +++++++++++++++ 10 files changed, 154 insertions(+), 5 deletions(-) create mode 100644 yuthon_salary/wizard/meal_expenses_review_wizard.py create mode 100644 yuthon_salary/wizard/meal_expenses_review_wizard_views.xml create mode 100644 yuthon_salary/wizard/party_expenses_review_wizard.py create mode 100644 yuthon_salary/wizard/party_expenses_review_wizard_views.xml diff --git a/yuthon_salary/__manifest__.py b/yuthon_salary/__manifest__.py index 5151f650f..4d4ec6f2b 100644 --- a/yuthon_salary/__manifest__.py +++ b/yuthon_salary/__manifest__.py @@ -55,6 +55,10 @@ 'wizard/select_delete_wizard_viwes.xml', 'wizard/put_return_wizard_viwes.xml', 'wizard/salary_print_wizard_views.xml', + 'wizard/meal_expenses_review_wizard_views.xml', + 'wizard/party_expenses_review_wizard_views.xml', + + ], 'assets': { 'web.assets_backend': [ diff --git a/yuthon_salary/models/yuthon_meal_expenses.py b/yuthon_salary/models/yuthon_meal_expenses.py index d5419a19d..80c4ce595 100644 --- a/yuthon_salary/models/yuthon_meal_expenses.py +++ b/yuthon_salary/models/yuthon_meal_expenses.py @@ -21,7 +21,12 @@ 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', '待复核确认'), + ('paid', '已缴费'), + ], string='缴费状态', default='to_do') + def _get_date_range(self): @@ -63,6 +68,23 @@ class YuthonMealExpenses(models.Model): def toll_confirm(self): self.toll_state = 'done' + def action_review_confirm(self): + """打开缴费复核确认弹窗,只对状态为待复核确认的记录生效""" + self.ensure_one() + if self.toll_state != 'done': + return + return { + 'type': 'ir.actions.act_window', + 'name': '复核确认', + 'res_model': 'meal.expenses.review.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': { + 'default_meal_id': self.id, + }, + } + + def _get_default_month(self): current_month = datetime.now().month return str(current_month) diff --git a/yuthon_salary/models/yuthon_salary_party.py b/yuthon_salary/models/yuthon_salary_party.py index d0c01d9aa..394e3e60b 100644 --- a/yuthon_salary/models/yuthon_salary_party.py +++ b/yuthon_salary/models/yuthon_salary_party.py @@ -20,11 +20,33 @@ 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', '待复核确认'), + ('paid', '已缴费'), + ], string='缴费状态', default='to_do') def toll_confirm(self): + # 员工确认已缴费,状态进入待复核确认 self.toll_state = 'done' + def action_party_review_confirm(self): + """打开党费缴费复核确认弹窗,只对状态为待复核确认的记录生效""" + self.ensure_one() + if self.toll_state != 'done': + return + return { + 'type': 'ir.actions.act_window', + 'name': '复核确认', + 'res_model': 'party.expenses.review.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': { + 'default_party_id': self.id, + }, + } + + def _get_default_month(self): current_month = datetime.now().month return str(current_month) diff --git a/yuthon_salary/views/yuthon_meal_expenses_views.xml b/yuthon_salary/views/yuthon_meal_expenses_views.xml index 13f5b6f8d..77c122594 100644 --- a/yuthon_salary/views/yuthon_meal_expenses_views.xml +++ b/yuthon_salary/views/yuthon_meal_expenses_views.xml @@ -39,6 +39,8 @@