From 4d9bc1932ae18602f52db53397bbbdaf5ec711a4 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 18 Feb 2025 15:44:04 +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/yuthon_property_setting.py | 15 +++++ yuthon_property/security/ir.model.access.csv | 4 +- .../views/yuthon_property_setting_views.xml | 30 ++++++++++ yuthon_property_approval/__manifest__.py | 1 + .../data/sale_renting_code_data.xml | 5 ++ yuthon_property_approval/models/__init__.py | 3 +- .../models/property_reimbursement_form.py | 39 ++++++++++++ .../security/ir.model.access.csv | 2 + .../views/property_menu_all.xml | 22 ++++++- .../property_reimbursement_form_views.xml | 59 +++++++++++++++++++ .../models/yuthon_payroll_project.py | 20 +++++-- .../views/yuthon_payroll_project_views.xml | 14 ++++- 12 files changed, 205 insertions(+), 9 deletions(-) create mode 100644 yuthon_property_approval/models/property_reimbursement_form.py create mode 100644 yuthon_property_approval/views/property_reimbursement_form_views.xml diff --git a/yuthon_property/models/yuthon_property_setting.py b/yuthon_property/models/yuthon_property_setting.py index 8be6c1d4e..3610cdf11 100644 --- a/yuthon_property/models/yuthon_property_setting.py +++ b/yuthon_property/models/yuthon_property_setting.py @@ -16,3 +16,18 @@ class YuthonTariffSetting(models.Model): name = fields.Char(string="名称") ratio = fields.Float(string="比例") + + +class PropertyAccountSetting(models.Model): + _name = 'property.account.setting' + _description = '账户配置' + + name = fields.Char(string="账户名称") + bank_deposit = fields.Char(string="开户行") + bank_cards = fields.Char(string="银行卡号") + +class PropertyProjectSetting(models.Model): + _name = 'property.project.setting' + _description = '费用项目配置' + + name = fields.Char(string="名称") diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv index c0d577fb7..9e317ff1a 100644 --- a/yuthon_property/security/ir.model.access.csv +++ b/yuthon_property/security/ir.model.access.csv @@ -72,4 +72,6 @@ access_property_accounts_receivable,property_accounts_receivable,model_property_ access_yuthon_property_production,yuthon_property_production,model_yuthon_property_production,base.group_user,1,1,1,1 access_property_construction_unit,property_construction_unit,model_property_construction_unit,base.group_user,1,1,1,1 access_property_accounting_unit,property_accounting_unit,model_property_accounting_unit,base.group_user,1,1,1,1 -access_property_billing_method_line,property_billing_method_line,model_property_billing_method_line,base.group_user,1,1,1,1 \ No newline at end of file +access_property_billing_method_line,property_billing_method_line,model_property_billing_method_line,base.group_user,1,1,1,1 +access_property_account_setting,property_account_setting,model_property_account_setting,base.group_user,1,1,1,1 +access_property_project_setting,property_project_setting,model_property_project_setting,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_property/views/yuthon_property_setting_views.xml b/yuthon_property/views/yuthon_property_setting_views.xml index 91599bb4e..b48c4f263 100644 --- a/yuthon_property/views/yuthon_property_setting_views.xml +++ b/yuthon_property/views/yuthon_property_setting_views.xml @@ -30,4 +30,34 @@ yuthon.tariff.setting tree + + property.account.setting.tree + property.account.setting + + + + + + + + + + 账户配置 + property.account.setting + tree + + + property.project.setting.tree + property.project.setting + + + + + + + + 项目配置 + property.project.setting + tree + \ No newline at end of file diff --git a/yuthon_property_approval/__manifest__.py b/yuthon_property_approval/__manifest__.py index 17d43d7d0..8f853947b 100644 --- a/yuthon_property_approval/__manifest__.py +++ b/yuthon_property_approval/__manifest__.py @@ -18,6 +18,7 @@ 'views/property_collection_confirm.xml', 'views/property_early_quitting.xml', 'views/property_eligibility.xml', + 'views/property_reimbursement_form_views.xml', 'views/property_fitment.xml', 'views/property_information.xml', 'views/property_inventory_table.xml', diff --git a/yuthon_property_approval/data/sale_renting_code_data.xml b/yuthon_property_approval/data/sale_renting_code_data.xml index be9b9fe1d..09be5606b 100644 --- a/yuthon_property_approval/data/sale_renting_code_data.xml +++ b/yuthon_property_approval/data/sale_renting_code_data.xml @@ -294,4 +294,9 @@ property_design_approval_code SJ%(y)s%(month)s%(day)s + + 报销单编号 + property_reimbursement_form_code + BX%(y)s%(month)s%(day)s + \ No newline at end of file diff --git a/yuthon_property_approval/models/__init__.py b/yuthon_property_approval/models/__init__.py index 1160d95ab..669bbb14d 100644 --- a/yuthon_property_approval/models/__init__.py +++ b/yuthon_property_approval/models/__init__.py @@ -46,4 +46,5 @@ from . import property_delegated_agent from . import property_construction_approval from . import property_project_approval from . import property_design_approval -from . import property_supervising_approval \ No newline at end of file +from . import property_supervising_approval +from . import property_reimbursement_form \ No newline at end of file diff --git a/yuthon_property_approval/models/property_reimbursement_form.py b/yuthon_property_approval/models/property_reimbursement_form.py new file mode 100644 index 000000000..f6e70a571 --- /dev/null +++ b/yuthon_property_approval/models/property_reimbursement_form.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ +from odoo.exceptions import UserError, ValidationError + + +class PropertyReimbursementForm(models.Model): + _name = 'property.reimbursement.form' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = '报销单审批' + + name = fields.Char(string='标题') + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_reimbursement_form_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="部门") + is_issues = fields.Boolean(string='是否上会') + related_issues_id = fields.Many2one('issue.library', string="关联议题") + reason_application = fields.Html(string="事由") + documents_ids = fields.Many2many('ir.attachment', string="附件") + company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="公司") + account_id = fields.Many2one('property.account.setting', string="账户") + expense_line_ids = fields.One2many('property.expense.line', 'reimbursement_id', string="费用项目明细") + + +class PropertyExpenseLine(models.Model): + _name = 'property.expense.line' + _description = '费用项目明细' + + reimbursement_id = fields.Many2one('property.reimbursement.form', string='关联报销单') + expense_id = fields.Many2one('property.project.setting', string='费用项目') + invoice_type = fields.Char(string='发票类型') + expense_amount = fields.Float(string='费用金额') + applied_reimbursement_amount = fields.Float(string='申请报销金额') + expense_department_id = fields.Many2one('hr.department', string='费用承担部门') + invoice_receipt_number = fields.Char(string='收票单号') + applied_payment_amount = fields.Float(string='申请付款金额') + approved_reimbursement_amount = fields.Float(string='核定报销金额') + approved_payment_amount = fields.Float(string='核定付款金额') \ No newline at end of file diff --git a/yuthon_property_approval/security/ir.model.access.csv b/yuthon_property_approval/security/ir.model.access.csv index 027674c69..29ea7b70b 100644 --- a/yuthon_property_approval/security/ir.model.access.csv +++ b/yuthon_property_approval/security/ir.model.access.csv @@ -80,4 +80,6 @@ access_supervising_way_line,supervising.way.line,model_supervising_way_line,base access_property_contract_line,property_contract_line,model_property_contract_line,base.group_user,1,1,1,1 access_choose_property_wizard,choose_property_wizard,model_choose_property_wizard,base.group_user,1,1,1,1 access_property_rental_wizard,property_rental_wizard,model_property_rental_wizard,base.group_user,1,1,1,1 +access_property_reimbursement_form,property_reimbursement_form,model_property_reimbursement_form,base.group_user,1,1,1,1 +access_property_expense_line,property_expense_line,model_property_expense_line,base.group_user,1,1,1,1 diff --git a/yuthon_property_approval/views/property_menu_all.xml b/yuthon_property_approval/views/property_menu_all.xml index a5678d93e..851c48994 100644 --- a/yuthon_property_approval/views/property_menu_all.xml +++ b/yuthon_property_approval/views/property_menu_all.xml @@ -230,7 +230,7 @@ sequence="15"/> - + + + + + + + property.reimbursement.form.tree + property.reimbursement.form + + + + + + + + + + + property.reimbursement.form.form + property.reimbursement.form + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + 报销单 + property.reimbursement.form + tree,form + +
\ No newline at end of file diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py index 625b79c65..1d941abd2 100644 --- a/yuthon_salary/models/yuthon_payroll_project.py +++ b/yuthon_salary/models/yuthon_payroll_project.py @@ -7,7 +7,7 @@ class YuthonPayrollCommon(models.Model): name = fields.Char(string='工资项名称') yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], - string='所属公司') + string='公司') department_id = fields.Many2one('hr.department', string="部门") conditional_formulas = fields.Char(string='条件公式') # todo 可能是个many2one start_date = fields.Date(string="生效日期", default=fields.Date.today()) @@ -20,7 +20,7 @@ class YuthonPayrollTemporary(models.Model): name = fields.Char(string='工资项名称') yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], - string='所属公司') + string='公司') department_id = fields.Many2one('hr.department', string="部门") start_date = fields.Date(string="生效日期", default=fields.Date.today()) end_date = fields.Date(string="失效日期") @@ -31,8 +31,20 @@ class YuthonPayrollInsurances (models.Model): _description = '五险一金' name = fields.Char(string='工资项名称') + is_base = fields.Boolean(string='独立基数') yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], - string='所属公司') - department_id = fields.Many2one('hr.department', string="部门") + string='公司') + proportion_company = fields.Float(string='公司缴纳比例') + proportion_employee = fields.Float(string='个人缴纳比例') + proportion_company_ceiling = fields.Float(string='公司缴纳比例上限') + proportion_company_floor = fields.Float(string='公司缴纳比例下限') + company_base_ceiling = fields.Float(string='公司缴纳基数上限') + company_base_floor = fields.Float(string='公司缴纳基数下限') + employee_base_ceiling = fields.Float(string='个人缴纳基数上限') + employee_base_floor = fields.Float(string='个人缴纳基数下限') + company_values = fields.Char(string='险种公司取值') + employee_values = fields.Char(string='险种个人取值') + documents_ids = fields.Many2many('ir.attachment', string="附件") + remarks = fields.Text(string="备注") start_date = fields.Date(string="生效日期", default=fields.Date.today()) end_date = fields.Date(string="失效日期") \ No newline at end of file diff --git a/yuthon_salary/views/yuthon_payroll_project_views.xml b/yuthon_salary/views/yuthon_payroll_project_views.xml index 5a7017e01..21c819187 100644 --- a/yuthon_salary/views/yuthon_payroll_project_views.xml +++ b/yuthon_salary/views/yuthon_payroll_project_views.xml @@ -70,7 +70,19 @@ - + + + + + + + + + + + + +