From 7869755c82ba23a9ea58e51290353aa2f4cf93b1 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 18:16:12 +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 --- .../models/financial_sheet_collection.py | 6 +++--- .../models/information_summary_table.py | 7 ++++--- .../financial_sheet_collection_views.xml | 20 +++++++++---------- .../views/information_summary_table_views.xml | 16 ++++++++------- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/yuthon_account_report/models/financial_sheet_collection.py b/yuthon_account_report/models/financial_sheet_collection.py index 4529cd519..4c9463398 100644 --- a/yuthon_account_report/models/financial_sheet_collection.py +++ b/yuthon_account_report/models/financial_sheet_collection.py @@ -7,9 +7,9 @@ class FinancialSheetCollection(models.Model): _description = '财务数据表收集' 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="角色") + company_id = fields.Many2one(related='employee_id.company_id', string='公司') + department_id = fields.Many2one(related='employee_id.department_id', string="部门") + user_role_id = fields.Many2one(related='employee_id.user_role_id', 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='财务数据表行') diff --git a/yuthon_account_report/models/information_summary_table.py b/yuthon_account_report/models/information_summary_table.py index 197104fde..a3a9faeba 100644 --- a/yuthon_account_report/models/information_summary_table.py +++ b/yuthon_account_report/models/information_summary_table.py @@ -8,11 +8,12 @@ class InformationSummaryTable(models.Model): _description = '信息汇总表收集' 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="角色") + company_id = fields.Many2one(related='employee_id.company_id', string='公司') + department_id = fields.Many2one(related='employee_id.department_id', string="部门") + user_role_id = fields.Many2one(related='employee_id.user_role_id', string="角色") account_type = fields.Selection([('to', '待确认', ), ('ok', '已确认')], string='状态', default='to') summary_line = fields.One2many('information.summary.line', 'summary_id', string='汇总表') + create_date = fields.Datetime(string='创建日期', default=fields.Datetime.now) def open_record(self): return { diff --git a/yuthon_account_report/views/financial_sheet_collection_views.xml b/yuthon_account_report/views/financial_sheet_collection_views.xml index 897f18c42..72dfad475 100644 --- a/yuthon_account_report/views/financial_sheet_collection_views.xml +++ b/yuthon_account_report/views/financial_sheet_collection_views.xml @@ -4,16 +4,16 @@ financial.sheet.collection.tree financial.sheet.collection - - + + - - + +