From 10c433cc4e595d4332760d6f2846a3b0a9c8783b Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Tue, 21 Jan 2025 10:04:31 +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_property/views/menuitem.xml | 4 +-
yuthon_property_approval/__manifest__.py | 1 +
.../data/sale_renting_code_data.xml | 5 ++
yuthon_property_approval/models/__init__.py | 3 +-
.../models/property_delegated_agent.py | 23 ++++++++
.../security/ir.model.access.csv | 1 +
.../views/property_delegated_agent_views.xml | 53 +++++++++++++++++++
.../views/property_menu_all.xml | 13 ++---
8 files changed, 94 insertions(+), 9 deletions(-)
create mode 100644 yuthon_property_approval/models/property_delegated_agent.py
create mode 100644 yuthon_property_approval/views/property_delegated_agent_views.xml
diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml
index f343f9aa1..9814ff9c2 100644
--- a/yuthon_property/views/menuitem.xml
+++ b/yuthon_property/views/menuitem.xml
@@ -93,12 +93,12 @@
name="建设工程"
parent="yuthon_property_menu_root"/>
diff --git a/yuthon_property_approval/__manifest__.py b/yuthon_property_approval/__manifest__.py
index 62151ea3e..af5fb265c 100644
--- a/yuthon_property_approval/__manifest__.py
+++ b/yuthon_property_approval/__manifest__.py
@@ -53,6 +53,7 @@
'views/inherit_yuthon_property_views.xml',
'views/property_project_works_viwes.xml',
'views/property_sporadic_works_views.xml',
+ 'views/property_delegated_agent_views.xml',
'wizard/property_contract_wizard.xml',
'wizard/choose_contract_wizard_views.xml',
'wizard/property_rental_wizard_views.xml',
diff --git a/yuthon_property_approval/data/sale_renting_code_data.xml b/yuthon_property_approval/data/sale_renting_code_data.xml
index 88d198867..5ee1e1d4c 100644
--- a/yuthon_property_approval/data/sale_renting_code_data.xml
+++ b/yuthon_property_approval/data/sale_renting_code_data.xml
@@ -254,4 +254,9 @@
property_sporadic_works_code
LS%(y)s%(month)s%(day)s
+
+ 委托代理编号
+ property_delegated_agent_code
+ LS%(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 0f7c5ec2d..db238f69d 100644
--- a/yuthon_property_approval/models/__init__.py
+++ b/yuthon_property_approval/models/__init__.py
@@ -39,4 +39,5 @@ from . import property_intention_approval
from . import property_transfer_approval
from . import inherit_yuthon_property
from . import property_sporadic_works
-from . import property_project_works
\ No newline at end of file
+from . import property_project_works
+from . import property_delegated_agent
\ No newline at end of file
diff --git a/yuthon_property_approval/models/property_delegated_agent.py b/yuthon_property_approval/models/property_delegated_agent.py
new file mode 100644
index 000000000..98450940d
--- /dev/null
+++ b/yuthon_property_approval/models/property_delegated_agent.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, exceptions, _
+
+
+class PropertyDelegatedAgent(models.Model):
+ _name = 'property.delegated.agent'
+ _description = '委托代理'
+ _inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
+
+ name = fields.Char(string="名称")
+ 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="部门")
+ code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_delegated_agent_code'))
+ annual = fields.Char(string="年度")
+ contract_date = fields.Date(string="合同有效期")
+ signing_date = fields.Date(string="签订日期")
+ payment_date = fields.Date(string="付款日期")
+ consult_fee = fields.Float(string="咨询费")
+ quotations_list_id = fields.Many2one('ir.attachment', string="报价清单")
+
+
diff --git a/yuthon_property_approval/security/ir.model.access.csv b/yuthon_property_approval/security/ir.model.access.csv
index 16ef66b15..8cc140ff1 100644
--- a/yuthon_property_approval/security/ir.model.access.csv
+++ b/yuthon_property_approval/security/ir.model.access.csv
@@ -64,6 +64,7 @@ access_property_subset_contract,property_subset_contract,model_property_subset_c
access_property_sporadic_works,property_sporadic_works,model_property_sporadic_works,base.group_user,1,1,1,1
access_payment_methods_line,payment.methods.line,model_payment_methods_line,base.group_user,1,1,1,1
access_property_project_works,property_project_works,model_property_project_works,base.group_user,1,1,1,1
+access_property_delegated_agent,property_delegated_agent,model_property_delegated_agent,base.group_user,1,1,1,1
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
diff --git a/yuthon_property_approval/views/property_delegated_agent_views.xml b/yuthon_property_approval/views/property_delegated_agent_views.xml
new file mode 100644
index 000000000..3b91ea10c
--- /dev/null
+++ b/yuthon_property_approval/views/property_delegated_agent_views.xml
@@ -0,0 +1,53 @@
+
+
+
+ property.delegated.agent.tree
+ property.delegated.agent
+
+
+
+
+
+
+
+
+
+
+
+ property.delegated.agent.form
+ property.delegated.agent
+
+
+
+
+
+ 委托代理
+ property.delegated.agent
+ tree,form
+
+
+
+
+
+
+
diff --git a/yuthon_property_approval/views/property_menu_all.xml b/yuthon_property_approval/views/property_menu_all.xml
index 27d82eb2d..909782ce0 100644
--- a/yuthon_property_approval/views/property_menu_all.xml
+++ b/yuthon_property_approval/views/property_menu_all.xml
@@ -351,18 +351,19 @@
action="action_property_meter_water"/>
-
+
\ No newline at end of file