From a31591db253529ccff5c4ae68884423771c7e696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Sat, 29 Nov 2025 16:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_account_report/data/account_task.xml | 29 +++ .../models/financial_sheet_collection.py | 37 ++- .../models/information_summary_table.py | 33 ++- .../security/ir.model.access.csv | 2 + .../financial_sheet_collection_views.xml | 46 +++- .../views/information_summary_table_views.xml | 42 +++- .../wizard/property_reconciliation_wizard.py | 212 +++++++++--------- yuthon_work_brand/views/hr_menus.xml | 10 + 8 files changed, 293 insertions(+), 118 deletions(-) create mode 100644 yuthon_account_report/data/account_task.xml diff --git a/yuthon_account_report/data/account_task.xml b/yuthon_account_report/data/account_task.xml new file mode 100644 index 000000000..6e422a6a5 --- /dev/null +++ b/yuthon_account_report/data/account_task.xml @@ -0,0 +1,29 @@ + + + + 定时任务:财务数据表 + + code + model.account_task() + + + 1 + weeks + + -1 + + + + 定时任务:信息汇总表 + + code + model.account_task() + + + 1 + months + + -1 + + + \ No newline at end of file diff --git a/yuthon_account_report/models/financial_sheet_collection.py b/yuthon_account_report/models/financial_sheet_collection.py index 577e44068..b8a68a295 100644 --- a/yuthon_account_report/models/financial_sheet_collection.py +++ b/yuthon_account_report/models/financial_sheet_collection.py @@ -5,14 +5,47 @@ class FinancialSheetCollection(models.Model): _name = 'financial.sheet.collection' _description = '财务数据表收集' - collection_id = fields.Many2one('sheet.collection.setting', string='项目名称') employee_id = fields.Many2one('hr.employee', string='人员') company_id = fields.Many2one('res.company', string='公司') department_id = fields.Many2one('hr.department', string="部门") user_role_id = fields.Many2one('soong.user.role', string="角色") + create_date = fields.Datetime(string='创建日期', default=fields.Datetime.now) + account_type = fields.Selection([('to', '待确认',), ('ok', '已确认')], string='状态', default='to') + sheet_line_ids = fields.One2many('financial.sheet.line', 'sheet_id', string='财务数据表行') + + def open_record(self): + return { + "type": "ir.actions.act_window", + "res_model": 'financial.sheet.collection', + "res_id": self.id, + "name": "详情", + "view_mode": "form", + } + + def button_put(self): + menu_id = self.env['ir.ui.menu'].search([('name', '=', '财务数据表收集')]) + for record in self.search([('account_type', '=', 'to')]): + url = f'https://oa.thtzjt.com/web#id={self.id}&cids=2&action={menu_id.action.id}&model=financial.sheet.collection&view_type=list&menu_id={menu_id.id}' + self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice', + user_id=record.employee_id.wecom_userid, + title="财务数据表", + description="您有待确认的财务数据表请尽快确认", + url=url, btntxt="详细信息") + record.account_type = 'ok' + + def account_task(self): + pass + + +class FinancialSheetLine(models.Model): + _name = 'financial.sheet.line' + _description = '财务数据表行' + + sheet_id = fields.Many2one('financial.sheet.collection', string='关联财务数据表') + collection_id = fields.Many2one('sheet.collection.setting', string='项目名称') this_issue_number = fields.Integer(string='本期数') same_last_year = fields.Integer(string='上年同期数') remake = fields.Text(string='说明') - create_date = fields.Datetime(string='创建日期', default=fields.Datetime.now) + diff --git a/yuthon_account_report/models/information_summary_table.py b/yuthon_account_report/models/information_summary_table.py index 6a6e9acdf..197104fde 100644 --- a/yuthon_account_report/models/information_summary_table.py +++ b/yuthon_account_report/models/information_summary_table.py @@ -7,10 +7,39 @@ class InformationSummaryTable(models.Model): _name = 'information.summary.table' _description = '信息汇总表收集' - table_id = fields.Many2one('summary.table.setting', string='项目名称') - this_year = fields.Float(string='本年底') employee_id = fields.Many2one('hr.employee', string='人员') company_id = fields.Many2one('res.company', string='公司') department_id = fields.Many2one('hr.department', string="部门") user_role_id = fields.Many2one('soong.user.role', string="角色") + account_type = fields.Selection([('to', '待确认', ), ('ok', '已确认')], string='状态', default='to') + summary_line = fields.One2many('information.summary.line', 'summary_id', string='汇总表') + + def open_record(self): + return { + "type": "ir.actions.act_window", + "res_model": 'information.summary.table', + "res_id": self.id, + "name": "详情", + "view_mode": "form", + } + + def button_put(self): + menu_id = self.env['ir.ui.menu'].search([('name', '=', '信息汇总表收集')]) + for record in self.search([('account_type', '=', 'to')]): + url = f'https://oa.thtzjt.com/web#id={self.id}&cids=2&action={menu_id.action.id}&model=information.summary.table&view_type=list&menu_id={menu_id.id}' + self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice', user_id=record.employee_id.wecom_userid, title="信息汇总表", + description="您有待确认的信息汇总表请尽快确认", url=url, btntxt="详细信息") + record.account_type = 'ok' + + def account_task(self): + pass + + +class InformationSummaryLine(models.Model): + _name = 'information.summary.line' + _description = '信息汇总表明细' + + summary_id = fields.Many2one('information.summary.table', string='关联汇总表') + table_id = fields.Many2one('summary.table.setting', string='项目名称') + this_year = fields.Float(string='本年底') remake = fields.Text(string='说明') diff --git a/yuthon_account_report/security/ir.model.access.csv b/yuthon_account_report/security/ir.model.access.csv index abe2a92c1..aba3fd29e 100644 --- a/yuthon_account_report/security/ir.model.access.csv +++ b/yuthon_account_report/security/ir.model.access.csv @@ -3,3 +3,5 @@ access_financial_sheet_collection,financial_sheet_collection,model_financial_she access_summary_table_setting,summary_table_setting,model_summary_table_setting,base.group_system,1,1,1,1 access_information_summary_table,information_summary_table,model_information_summary_table,base.group_system,1,1,1,1 access_sheet_collection_setting,sheet_collection_setting,model_sheet_collection_setting,base.group_system,1,1,1,1 +access_financial_sheet_line,financial_sheet_line,model_financial_sheet_line,base.group_system,1,1,1,1 +access_information_summary_line,information_summary_line,model_information_summary_line,base.group_system,1,1,1,1 \ No newline at end of file diff --git a/yuthon_account_report/views/financial_sheet_collection_views.xml b/yuthon_account_report/views/financial_sheet_collection_views.xml index 22817587e..8574f6259 100644 --- a/yuthon_account_report/views/financial_sheet_collection_views.xml +++ b/yuthon_account_report/views/financial_sheet_collection_views.xml @@ -5,22 +5,58 @@ financial.sheet.collection - - - - + +