diff --git a/yuthon_hr_employee/models/hr_employee_page.py b/yuthon_hr_employee/models/hr_employee_page.py index 69ab35dac..cc19e9188 100644 --- a/yuthon_hr_employee/models/hr_employee_page.py +++ b/yuthon_hr_employee/models/hr_employee_page.py @@ -46,7 +46,14 @@ class YuthonEducationExperienceLine(models.Model): end_date = fields.Date(string="毕业时间") in_school_duties = fields.Char(string="在校职务") professional = fields.Char(string="专业") - learning_style = fields.Selection([('full_time', '全日制'), ('part_time', '非全日制')], string="学习方式") + learning_style = fields.Selection([ + ('full_time', '全日制'), + ('upgrade', '专升本'), + ('adult_education', '成人教育'), + ('self_study', '自考'), + ('online_education', '网络教育'), + ('correspondence', '函授'), + ], string="学习方式") part_time_degree = fields.Char(string="学历") full_time_degree = fields.Char(string="学位") documents_ids = fields.Many2many('ir.attachment', string="附件") diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index 746d317b8..b3c6d9ed3 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -411,6 +411,7 @@ + diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py index 7f6ccb5e0..2c134c700 100644 --- a/yuthon_property/models/yuthon_resource_mgmt_config.py +++ b/yuthon_property/models/yuthon_resource_mgmt_config.py @@ -129,7 +129,7 @@ class YuthonPurposeEvidence(models.Model): class YuthonManagementType(models.Model): _name = 'yuthon.management.type' - _description = '管理类型' + _description = '应收类型' name = fields.Char(string="管理类型") diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml index 24e33f123..124515924 100644 --- a/yuthon_property/views/menuitem.xml +++ b/yuthon_property/views/menuitem.xml @@ -72,11 +72,11 @@ sequence="4" name="应收" parent="yuthon_property_estate_menu"/> - + + + + + - diff --git a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml index 33734793d..834114ea3 100644 --- a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml +++ b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml @@ -236,7 +236,7 @@ - 管理类型 + 应收类型 yuthon.management.type tree diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index 48140d737..70eed8191 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -69,21 +69,60 @@ class PropertyBankStatements(models.Model): electricity_ids = self.env['property.tariff.list'].search([('lessee_id', '=', tenant_id.id)]) def create_reconciliation_vals(ids, collection_type_val): + """ + :param ids:费用记录集 + :param collection_type_val: 费用类型(如 'rent', 'deposit') + :return: 格式化后的费用行列表 + """ nonlocal total_rent_month vals_list = [] - for sub_record in ids: - property_id = sub_record.property_id.id if sub_record.property_id else False - contract_id = sub_record.contract_id.id if sub_record.contract_id else False - original_amount = sub_record.original_amount if sub_record.original_amount else 0 - vals = { - 'property_id': property_id, - 'contract_id': contract_id, - 'rent_month': original_amount, - 'rent': original_amount, - 'collection_type': collection_type_val, - } - total_rent_month += original_amount - vals_list.append((0, 0, vals)) + + # 特殊处理:押金类型需要去重相同合同的记录 + if collection_type_val == 'deposit': + # 使用字典来跟踪已处理的合同ID + processed_contracts = set() + for sub_record in ids: + property_id = sub_record.property_id.id if sub_record.property_id else False + contract_id = sub_record.contract_id.id if sub_record.contract_id else False + original_amount = sub_record.original_amount if sub_record.original_amount else 0 + # 跳过已处理的合同 + if contract_id and contract_id in processed_contracts: + continue + # 获取合同的实际开始日期作为到期日 + due_date = False + if contract_id: + due_date = sub_record.contract_id.actual_start_time + # 构建对账行数据 + vals = { + 'property_id': property_id, + 'contract_id': contract_id, + 'rent_month': original_amount, + 'rent': original_amount, + 'collection_type': collection_type_val, + 'due_date': due_date, # 押金类型使用合同实际开始日期 + } + total_rent_month += original_amount # 累加总金额 + vals_list.append((0, 0, vals)) + # 标记此合同已处理 + if contract_id: + processed_contracts.add(contract_id) + else: + # 非押金类型:正常处理每条记录 + for sub_record in ids: + property_id = sub_record.property_id.id if sub_record.property_id else False + contract_id = sub_record.contract_id.id if sub_record.contract_id else False + original_amount = sub_record.original_amount if sub_record.original_amount else 0 + due_date = sub_record.due_date if sub_record.due_date else False + vals = { + 'property_id': property_id, + 'contract_id': contract_id, + 'rent_month': original_amount, + 'rent': original_amount, + 'collection_type': collection_type_val, + 'due_date': due_date, + } + total_rent_month += original_amount # 累加总金额 + vals_list.append((0, 0, vals)) return vals_list all_vals = [] @@ -97,6 +136,12 @@ class PropertyBankStatements(models.Model): return [], 0 def _get_context_and_action(self, record, all_vals, total_rent_month): + """ + :param record: 银行收款记录 + :param all_vals: 应收费用列表 + :param total_rent_month: 应收总金额 + :return: + """ context = { "default_account": record.name, "default_actual_total": record.original_amount, diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index fdf7e151f..5365abe01 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -22,6 +22,7 @@ class PropertyReconciliationLine(models.Model): property_id = fields.Many2one('yuthon.property', string='物业') contract_id = fields.Many2one('property.lease.contract', string='合同编号') rent_month = fields.Float(string='当月租金') + due_date = fields.Date(string='应收日期') rent = fields.Float(string='应收租金') penalty = fields.Float(string='违约金') amount = fields.Float(string='金额') diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard_views.xml b/yuthon_property_approval/wizard/property_reconciliation_wizard_views.xml index 90cc4eb66..65942fe59 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard_views.xml +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard_views.xml @@ -18,11 +18,12 @@ - - - - 、 - + + + + + + diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py index d64fe631a..c84e2672d 100644 --- a/yuthon_purchase/models/inherit_purchase_order.py +++ b/yuthon_purchase/models/inherit_purchase_order.py @@ -16,7 +16,7 @@ class YuthonPurchaseOrder(models.Model): service_content = fields.Text(string="服务内容") service_start_date = fields.Date(string="服务开始时间") service_end_date = fields.Date(string="服务结束时间") - type_of_procurement = fields.Selection([('service', '服务'), ('product', '低值易耗/固定资产')], string="采购类型") + type_of_procurement = fields.Selection([('service', '服务'), ('product', '低值易耗'), ('fixed', '固定资产')], string="采购类型") purchase_order_models_ids = fields.One2many('purchase.order.pay.line', 'purchase_id', string="付款详情") diff --git a/yuthon_purchase/views/inherit_purchase_order_views.xml b/yuthon_purchase/views/inherit_purchase_order_views.xml index 99d553f43..62b88840d 100644 --- a/yuthon_purchase/views/inherit_purchase_order_views.xml +++ b/yuthon_purchase/views/inherit_purchase_order_views.xml @@ -13,7 +13,7 @@ - + diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index a77d8e813..64a62025c 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -626,8 +626,6 @@ parent="finance_root_board" action="yuthon_salary.action_yuthon_salary_asset" sequence="5"/> - - +