diff --git a/soong_workflow/models/soong_user_role.py b/soong_workflow/models/soong_user_role.py
index 041a9f190..7ed6374a7 100644
--- a/soong_workflow/models/soong_user_role.py
+++ b/soong_workflow/models/soong_user_role.py
@@ -14,26 +14,26 @@ class YuthonUserRole(models.Model):
end_time = fields.Datetime(string="结束时间")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
('thlc', '天河粮储'), ('tctj', '天投城建'),
- ('thtjbb', '天河投资本部')], string="所属公司")
+ ('thtjbb', '天河投资本部')], string="所属公司",compute='compute_company')
#
- # @api.depends('department_id')
- # def compute_company(self):
- # company_mapping = {'天河投资集团': 'thtz',
- # '天河物管': 'thwg',
- # '天河粮储': 'thlc',
- # '天投城建': 'tctj',
- # '天河投资本部':'thtjbb'}
- # for record in self:
- # visited_departments = set()
- # department = record.department_id
- # while department and department.id not in visited_departments:
- # visited_departments.add(department.id)
- # if department.name == '天河投资集团':
- # record.yuthon_company = 'thtz'
- # break
- # elif department.name in company_mapping:
- # record.yuthon_company = company_mapping[department.name]
- # break
- # department = department.parent_id
- # else:
- # record.yuthon_company = 'thtz'
+ @api.depends('department_id')
+ def compute_company(self):
+ company_mapping = {'天河投资集团': 'thtz',
+ '天河物管': 'thwg',
+ '天河粮储': 'thlc',
+ '天投城建': 'tctj',
+ '天河投资本部':'thtjbb'}
+ for record in self:
+ visited_departments = set()
+ department = record.department_id
+ while department and department.id not in visited_departments:
+ visited_departments.add(department.id)
+ if department.name == '天河投资集团':
+ record.yuthon_company = 'thtz'
+ break
+ elif department.name in company_mapping:
+ record.yuthon_company = company_mapping[department.name]
+ break
+ department = department.parent_id
+ else:
+ record.yuthon_company = 'thtz'
diff --git a/soong_workflow/views/soong_user_role_views.xml b/soong_workflow/views/soong_user_role_views.xml
index bb08a258f..d8b014798 100644
--- a/soong_workflow/views/soong_user_role_views.xml
+++ b/soong_workflow/views/soong_user_role_views.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/yuthon_contract/models/inherit_hr_contract.py b/yuthon_contract/models/inherit_hr_contract.py
index 6027f1866..5060dd808 100644
--- a/yuthon_contract/models/inherit_hr_contract.py
+++ b/yuthon_contract/models/inherit_hr_contract.py
@@ -17,3 +17,7 @@ class HrContract(models.Model):
salary.wage = salary.job_lv_id.base_wage
salary.name = '劳动合同'
+ work_entry_source = fields.Selection([
+ ('calendar', '考勤安排'),
+ ('attendance', 'Attendances'),
+ ('planning', '特殊排版')])
\ No newline at end of file
diff --git a/yuthon_contract/views/inherit_hr_contract_views.xml b/yuthon_contract/views/inherit_hr_contract_views.xml
index 145b57b8e..452ad4f20 100644
--- a/yuthon_contract/views/inherit_hr_contract_views.xml
+++ b/yuthon_contract/views/inherit_hr_contract_views.xml
@@ -6,7 +6,7 @@
-
+
diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py
index ff2e75baf..58db48c63 100644
--- a/yuthon_holiday/models/inherit_hr_leave.py
+++ b/yuthon_holiday/models/inherit_hr_leave.py
@@ -6,12 +6,12 @@ from odoo.exceptions import ValidationError
class HrLeave(models.Model):
_inherit = 'hr.leave'
- batch_id = fields.Many2one(string='Batch', comodel_name='hr.leave.batch', required=True, ondelete='cascade')
+ batch_id = fields.Many2one(string='批量', comodel_name='hr.leave.batch', required=True, ondelete='cascade')
class HolidaysRequestBatch(models.Model):
_name = 'hr.leave.batch'
- _description = 'Time Off Batches'
+ _description = '请假审批'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
def _get_default_emp(self):
@@ -20,21 +20,25 @@ class HolidaysRequestBatch(models.Model):
raise
return emp
- name = fields.Char(string='Description')
- employee_id = fields.Many2one(string='Employee', comodel_name='hr.employee', required=True, default=_get_default_emp, index=True)
- leave_ids = fields.One2many(string='Details', comodel_name='hr.leave', inverse_name='batch_id')
- state = fields.Selection(string='State', selection=[
- ('draft', 'To Submit'),
- ('confirm', 'To Approve'),
- ('refuse', 'Refused'),
- ('validate', 'Approved')
+ name = fields.Char(string='标题')
+ employee_id = fields.Many2one(string='员工', comodel_name='hr.employee', required=True, default=_get_default_emp, index=True)
+ leave_ids = fields.One2many(string='详情', comodel_name='hr.leave', inverse_name='batch_id')
+ state = fields.Selection(string='状态', selection=[
+ ('draft', '撤回'),
+ ('confirm', '转交'),
+ ('refuse', '拒绝'),
+ ('validate', '审批')
], default='draft', tracking=True, copy=False)
+ company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="公司")
+ users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
+ leave_id = fields.Many2one('res.users', string="请假人")
+ department_id = fields.Many2one('hr.department', string="部门")
+ days = fields.Float(string='天数')
+ hours = fields.Float(string='小时')
+ text = fields.Html(string='申请事由')
+ leave_line_ids = fields.One2many('hr.leave.line', 'leave_batch_id', string="关联请假详情明细行")
+ is_issues = fields.Boolean(string='是否上会')
- @api.constrains('leave_ids')
- def _check_leave_ids(self):
- for rec in self:
- if len(rec.leave_ids) < 1:
- raise ValidationError(_('You must have at least one leave request in the batch.'))
# 提交
def action_submit(self):
@@ -59,3 +63,17 @@ class HolidaysRequestBatch(models.Model):
class HrLeaveLine(models.Model):
_name = 'hr.leave.line'
+ leave_batch_id = fields.Many2one('hr.leave.batch', string="关联请假审批")
+ leave_type_id = fields.Many2one('hr.leave.type',string="请假类型")
+ available_days = fields.Integer(related='leave_type_id.available_days',string="可用天数")
+ applicants = fields.Selection(related='leave_type_id.request_unit',string="申请单位")
+ leave_documents_ids = fields.Many2many(related='leave_type_id.leave_documents_id',string="假期详情说明")
+ start_time = fields.Date(string="开始时间")
+ end_time = fields.Date(string="结束时间")
+ days = fields.Float(string="天数")
+ residual = fields.Float(string="剩余天数")
+ #
+ # @api.onchange('leave_type_id')
+ # def _onchange_leave_type_id(self):
+ # if self.leave_type_id:
+ # self.leave_documents_ids = self.leave_type_id.leave_documents_id
diff --git a/yuthon_holiday/models/inherit_hr_leave_type.py b/yuthon_holiday/models/inherit_hr_leave_type.py
index 971cecb68..6bc514307 100644
--- a/yuthon_holiday/models/inherit_hr_leave_type.py
+++ b/yuthon_holiday/models/inherit_hr_leave_type.py
@@ -6,4 +6,5 @@ class HrLeaveType(models.Model):
_inherit = 'hr.leave.type'
leave_documents_id = fields.Many2many('ir.attachment', string="假期详细说明")
+ available_days = fields.Integer(string="可用天数")
allocation_validation_type = fields.Selection(defalt='no')
\ No newline at end of file
diff --git a/yuthon_holiday/security/ir.model.access.csv b/yuthon_holiday/security/ir.model.access.csv
index f4129e1d0..d3e6ee678 100644
--- a/yuthon_holiday/security/ir.model.access.csv
+++ b/yuthon_holiday/security/ir.model.access.csv
@@ -1,2 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_hr_leave_batch,hr.leave.batch,model_hr_leave_batch,,1,1,1,1
+access_hr_leave_line,hr.leave.line,model_hr_leave_line,,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml
index 2a299707d..dadabf6b7 100644
--- a/yuthon_holiday/views/hr_leave_batch.xml
+++ b/yuthon_holiday/views/hr_leave_batch.xml
@@ -6,14 +6,19 @@
hr.leave.batch.tree
hr.leave.batch
-
-
+
+
-
+
+
+
+
+
+
-
-
-
+
+
+
@@ -25,24 +30,46 @@
@@ -80,7 +122,7 @@
- My Time Off
+ 我的休假
hr.leave.batch
tree,form
{}
@@ -97,7 +139,7 @@
- All Time Off
+ 所有休息时间
hr.leave.batch
tree,form
{}
diff --git a/yuthon_holiday/views/inherit_hr_type_views.xml b/yuthon_holiday/views/inherit_hr_type_views.xml
index 05ddb88ba..0b07271d9 100644
--- a/yuthon_holiday/views/inherit_hr_type_views.xml
+++ b/yuthon_holiday/views/inherit_hr_type_views.xml
@@ -8,6 +8,9 @@
假期类型
+
+
+
1
@@ -23,6 +26,9 @@
+
+
+
1
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index 9043b1457..8bb4a1801 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models
-from datetime import datetime
+from datetime import date, datetime
from odoo.exceptions import UserError, ValidationError
nation_list = [('a', '汉族'), ('b', '壮族'), ('v', '满族'), ('d', '回族'), ('e', '苗族'), ('f', '维吾尔族'),
@@ -45,8 +45,9 @@ class YuthonHrEmployee(models.Model):
user_number_start_time = fields.Date(string="身份证开始时间")
user_number_end_time = fields.Date(string="身份证到期时间")
nation = fields.Selection(nation_list, string="民族")
- old = fields.Integer(string="年龄", compute='_compute_birthday_old')
- birthday_month = fields.Integer(string="生日月份", compute='_compute_birthday_old')
+ old = fields.Integer(string="年龄", compute='_compute_info')
+ birthday = fields.Date(string="出生年月", compute='_compute_info')
+ birthday_month = fields.Integer(string="生日月份", compute='_compute_info')
user_type = fields.Char(string="人员类别")
retire_date = fields.Date(string="退休日期")
retire_years = fields.Integer(string="离退休年限", compute='_compute_retire_years')
@@ -171,17 +172,46 @@ class YuthonHrEmployee(models.Model):
else:
record.company_old = None
- @api.depends('birthday')
- def _compute_birthday_old(self):
- """生日月份 年龄 计算"""
+ @api.depends('identification_id') # 只依赖身份证号码
+ def _compute_info(self):
for record in self:
- if record.birthday:
- today = datetime.now().date()
- record.birthday_month = record.birthday.month
- record.old = today.year - record.birthday.year
+ if record.identification_id:
+ id_number = record.identification_id.upper()
+ if len(id_number) != 18:
+ record._clear_info()
+ raise UserError("身份证号码长度应为18位")
+
+ try:
+ if not (all(c.isdigit() for c in id_number[:-1]) and (
+ id_number[-1].isdigit() or id_number[-1] == 'X')):
+ raise ValueError("身份证号码包含无效字符")
+
+ year = int(id_number[6:10])
+ month = int(id_number[10:12])
+ day = int(id_number[12:14])
+ record.birthday = date(year, month, day)
+ record.birthday_month = month
+
+ today = date.today()
+ if year is not None:
+ record.old = today.year - year - ((today.month, today.day) < (month, day))
+ else:
+ record.old = 0
+ gender_code = int(id_number[-2])
+ record.user_sex = 'girl' if gender_code % 2 == 0 else 'boy'
+
+ except ValueError as e:
+ record._clear_info()
+ raise UserError(str(e) or "身份证号码格式不正确") # Raise UserError
else:
- record.birthday_month = 0
- record.old = 0
+ record._clear_info()
+
+ def _clear_info(self):
+ self.birthday = False
+ self.birthday_month = False
+ self.old = 0
+ self.user_sex = False
+
@api.depends('retire_date')
def _compute_retire_years(self):
diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
index 34acf0979..3b0711fa9 100644
--- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
+++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml
@@ -65,17 +65,17 @@
- 岁
+
- 月
+
- 年
+
@@ -258,4 +258,15 @@
tree,kanban,form,activity,graph,pivot,hierarchy
+
+ hr.employee.attendance.form
+ hr.employee
+
+
+
+
+ 1
+
+
+
\ No newline at end of file
diff --git a/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py b/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
index 86013a697..bd25252a0 100644
--- a/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
@@ -2,7 +2,7 @@ from odoo import models, fields, api
class YutransferApproval(models.Model):
_name = 'yuthon.transfer.approval'
- _inherit = ['mail.activity.mixin']
+ _inherit = ['soong.workflow.mixin']
_description = '工作移交'
documents_ids = fields.Many2many('ir.attachment', string='议题附件')
diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py
index 9dcf65458..0e1b38b16 100644
--- a/yuthon_issue/models/issue_library.py
+++ b/yuthon_issue/models/issue_library.py
@@ -54,11 +54,13 @@ class IssueLibrary(models.Model):
def all_issue_pull(self):
issue_active_ids = self.env["issue.library"].browse(self._context.get('active_ids', self._context.get('active_id')))
- if self.state != 'draft':
- raise UserError("当前状态不允许提交")
- for i in issue_active_ids:
- if i.state != 'draft':
+ if not issue_active_ids:
+ if self.state != 'draft':
raise UserError("当前状态不允许提交")
+ else:
+ for i in issue_active_ids:
+ if i.state != 'draft':
+ raise UserError("当前状态不允许提交")
form_id = self.env.ref("yuthon_issue.issue_library_approval_form").id
issue_decision_lines = []
specifics_list = []
@@ -76,9 +78,13 @@ class IssueLibrary(models.Model):
'is_note': issue_record.is_note,
'employee_id': issue_record.employee_id.id
}))
+ if len(specifics_list)>1:
+ name = ','.join(specifics_list)
+ else:
+ name = self.name
issue_approval_id = self.env['issue.approval'].create({
'issue_approval_ids': issue_decision_lines,
- 'name': ';'.join(specifics_list),
+ 'name': name,
'employee_id': self.employee_id.id,
})
self.issue_approval_id = issue_approval_id
@@ -98,9 +104,9 @@ class IssueLibrary(models.Model):
def all_meeting_issue(self):
issue_active_ids = self.env["issue.library"].browse(self._context.get('active_ids', self._context.get('active_id')))
- for record in issue_active_ids:
- if record.state != 'will':
- raise UserError("当前状态不允许上会")
+ # for record in issue_active_ids:
+ # if record.state != 'will':
+ # raise UserError("当前状态不允许上会")
for meet in self:
meet.write({"state": "on_meet"})
issue_details = []
diff --git a/yuthon_issue/views/issue_library_views.xml b/yuthon_issue/views/issue_library_views.xml
index 04c197f8a..4a06ad1b4 100644
--- a/yuthon_issue/views/issue_library_views.xml
+++ b/yuthon_issue/views/issue_library_views.xml
@@ -36,7 +36,7 @@
-
+
diff --git a/yuthon_property/__manifest__.py b/yuthon_property/__manifest__.py
index 70661de0a..96134119e 100644
--- a/yuthon_property/__manifest__.py
+++ b/yuthon_property/__manifest__.py
@@ -12,7 +12,6 @@
'data/data_yuthon_resource_mgmt_config.xml',
'data/yuthon_property_approval_data.xml',
'views/yuthon_property_views.xml',
- 'views/property_type_views.xml',
'views/property_patrol_duty.xml',
'views/property_patrol_plan.xml',
'views/property_route_management.xml',
@@ -25,8 +24,9 @@
'views/yuthon_resource_mgmt_config_views.xml',
'views/property_meter_archives_views.xml',
'views/property_meter_water_views.xml',
- 'views/property_evaluate_application_views.xml',
- 'views/yuthon_property_evaluation_views.xml',
+ 'views/yuthon_property_evaluated_views.xml',
+ 'views/property_prospective_customers.xml',
+ 'views/yuthon_property_lessee_views.xml',
'views/menuitem.xml',
],
'demo': [],
diff --git a/yuthon_property/data/data_yuthon_resource_mgmt_config.xml b/yuthon_property/data/data_yuthon_resource_mgmt_config.xml
index 34c99479f..6c8def2e6 100644
--- a/yuthon_property/data/data_yuthon_resource_mgmt_config.xml
+++ b/yuthon_property/data/data_yuthon_resource_mgmt_config.xml
@@ -85,27 +85,4 @@
全电票
-
- 待评估
-
-
- 评估中
-
-
- 评估备案
-
-
- 挂网
-
-
- 签约中
-
-
- 已出租
-
-
- 闲置
-
-
-
\ No newline at end of file
diff --git a/yuthon_property/data/yuthon_property_approval_data.xml b/yuthon_property/data/yuthon_property_approval_data.xml
index eb62db1de..c13930e45 100644
--- a/yuthon_property/data/yuthon_property_approval_data.xml
+++ b/yuthon_property/data/yuthon_property_approval_data.xml
@@ -7,5 +7,4 @@
3
-
\ No newline at end of file
diff --git a/yuthon_property/models/__init__.py b/yuthon_property/models/__init__.py
index 944cc44df..5ea97e7de 100644
--- a/yuthon_property/models/__init__.py
+++ b/yuthon_property/models/__init__.py
@@ -1,5 +1,4 @@
from . import yuthon_property
-from . import property_type
from . import property_patrol_duty
from . import property_patrol_plan
from . import property_patrol_position
@@ -9,8 +8,11 @@ from . import yuthon_resource_mgmt_config
from . import yuthon_draw_result
from . import yuthon_expert_database
from . import yuthon_property_evaluation
-from . import property_evaluate_application
from . import property_rental_form
from . import property_transaction_confirmed
from . import property_meter_archives
from . import property_meter_water
+from . import yuthon_property_evaluated
+from . import property_prospective_customers
+from . import yuthon_property_lessee
+from . import property_assess
diff --git a/yuthon_property/models/property_assess.py b/yuthon_property/models/property_assess.py
new file mode 100644
index 000000000..c170e0e0e
--- /dev/null
+++ b/yuthon_property/models/property_assess.py
@@ -0,0 +1,12 @@
+from odoo import models, fields, api
+
+
+class PropertyAssess(models.Model):
+ _name = 'property.assess'
+
+ name = fields.Char(string="Name")
+
+
+class PropertyAssessLine(models.Model):
+ _name = 'property.assess.line'
+
diff --git a/yuthon_property/models/property_evaluate_application.py b/yuthon_property/models/property_evaluate_application.py
deleted file mode 100644
index b90c410e5..000000000
--- a/yuthon_property/models/property_evaluate_application.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from odoo import models, fields, api
-
-
-class PropertyEvaluateApplication(models.Model):
- _name = 'property.evaluate.application'
- _description = '物业评估申请'
- _inherit = ['soong.workflow.mixin']
-
-
- name = fields.Char(string='标题')
- code = fields.Char(string='编号', required=True, copy=False,
- default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_property_code'))
- main_text = fields.Html(string='正文')
- is_meet = fields.Boolean(string="是否上会")
- is_experts = fields.Boolean(string="是否需要专家评审")
- notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
- property_message_ids = fields.One2many('yuthon.property.evaluation', 'property_message_id', string='物业信息明细行')
-
-
diff --git a/yuthon_property/models/property_prospective_customers.py b/yuthon_property/models/property_prospective_customers.py
new file mode 100644
index 000000000..0315d996c
--- /dev/null
+++ b/yuthon_property/models/property_prospective_customers.py
@@ -0,0 +1,15 @@
+from odoo import models, fields, api
+
+
+class PropertyProspectiveCustomers(models.Model):
+ _name = 'property.prospective.customers'
+ _description = '意向客户列表'
+
+ name = fields.Char(string='标题')
+ customer_name = fields.Char(string='意向客户名称')
+ entity_type = fields.Selection([('person', '个人'), ('company', '企业')],string='实体类型')
+ phone = fields.Char(string='联系人')
+ phone_number = fields.Char(string='联系电话')
+ industry = fields.Char(string='行业')
+
+
diff --git a/yuthon_property/models/property_type.py b/yuthon_property/models/property_type.py
deleted file mode 100644
index 14806844e..000000000
--- a/yuthon_property/models/property_type.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-from odoo import models, fields, api, exceptions, _
-from datetime import datetime
-from odoo.exceptions import UserError, ValidationError
-
-
-class PropertyType(models.Model):
- _name = 'property.type'
- _description = '物业状态'
- _rec_name = 'name'
-
- name = fields.Char(string='名称')
- create_time = fields.Datetime(string="创建日期", default=lambda self: fields.Datetime.now())
- start_time = fields.Datetime(string="生效日期")
- end_time = fields.Datetime(string="终止日期")
- is_enable = fields.Boolean(string="是否启用", compute='_compute_is_enable')
-
- @api.depends('start_time', 'end_time')
- def _compute_is_enable(self):
- for rec in self:
- if rec.start_time >= rec.end_time:
- raise ValidationError('合同开始日期不能大于合同结束日期')
- if rec.start_time and rec.end_time:
- if rec.start_time < datetime.now() < rec.end_time:
- rec.is_enable = True
- else:
- rec.is_enable = False
- else:
- rec.is_enable = False
-
-
-
-
-
-
-
-
diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py
index 32fb8160c..a8e397f46 100644
--- a/yuthon_property/models/yuthon_property.py
+++ b/yuthon_property/models/yuthon_property.py
@@ -1,5 +1,5 @@
from odoo import models, fields, api
-
+from odoo.exceptions import UserError, ValidationError
class YuthonProperty(models.Model):
_name = 'yuthon.property'
@@ -31,12 +31,13 @@ class YuthonProperty(models.Model):
property_area = fields.Float(string="产权面积")
pooled_area = fields.Float(string="公摊面积")
rentable_area = fields.Float(string="可租面积")
- end_date = fields.Date(string="结束日期")
- state_id = fields.Many2one('property.type', string='状态')
+ state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'),
+ ('ing_handover', '移交中') ,('done_handover', '已移交'),
+ ('filing', '评估备案'), ('net', '挂网'), ('signing', '签约中'),
+ ('leased', '已出租'),('idle', '闲置')],string='状态', default='to')
is_meter = fields.Boolean(string="是否有水表")
is_electricity_meter = fields.Boolean(string="是否有电表")
-
- company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="所属公司")
+ company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj','天河投建')], string="所属公司")
admin_id = fields.Many2one('res.users', string="管理员")
purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途")
mgmt_type_id = fields.Many2one('yuthon.resource.management.type', string="管理类型")
@@ -45,24 +46,10 @@ class YuthonProperty(models.Model):
property_card = fields.Html(string="产权证")
life_timer = fields.Datetime(string="使用时间")
property_use_time = fields.Selection([('a', '70年'), ('b', '40年')], string="使用年限")
-
property_precinct = fields.Char(string="片区")
asset_type_id = fields.Many2one('yuthon.resource.type', string="资产类型")
is_hvac = fields.Boolean(string="是否使用中央空调")
is_handle_land = fields.Boolean(string="是否办理土地有偿使用手续")
-
- ame = fields.Char(string='标题')
- decoration_type = fields.Selection([('blank', '毛坯'), ('hardcover', '精装'), ('brands', '简装'), ('rsz', '豪装')],
- string="装修类型")
- water_meter_ids = fields.One2many('yuthon.property.water', 'yuthon_property_id', string='水表列表')
- energy_meter_ids = fields.One2many('yuthon.property.energy', 'yuthon_property_id', string='电表列表')
-
- @api.onchange('building_area')
- def _onchange_building_area(self):
- for rec in self:
- rec.management_area = rec.building_area
- rec.rentable_area = rec.building_area
-
property_use_id = fields.Integer(string="物业用途ID")
image_1920 = fields.Image(string="图片")
description = fields.Html(string="描述")
@@ -72,18 +59,97 @@ class YuthonProperty(models.Model):
address = fields.Char(string="物业地址")
title_number = fields.Char(string="产权编号")
suite_area = fields.Float(string="套内面积")
- start_time = fields.Date(string="开始时间")
-
+ start_time = fields.Date(string="生效时间")
+ end_date = fields.Date(string="失效日期")
manage_standard = fields.Char(string="物业管理费标准")
title_address = fields.Char(string="产权地址")
rental_address = fields.Char(string="出租地址")
+ ame = fields.Char(string='标题')
+ decoration_type = fields.Selection([('blank', '毛坯'), ('hardcover', '精装'), ('brands', '简装'), ('rsz', '豪装')],
+ string="装修类型")
+ water_meter_ids = fields.One2many('yuthon.property.water', 'yuthon_property_id', string='水表列表')
+ energy_meter_ids = fields.One2many('yuthon.property.energy', 'yuthon_property_id', string='电表列表')
+ title_information_ids = fields.One2many('title.information.line', 'yuthon_property_id', string='关联产权信息明细行')
+ manage_information_ids = fields.One2many('manage.information.line', 'yuthon_property_id', string='关联管理信息明细行')
+ disassembly_information_ids = fields.One2many('disassembly.information.line', 'yuthon_property_id', string='关联拆合信息明细行')
+ @api.onchange('building_area')
+ def _onchange_building_area(self):
+ for rec in self:
+ rec.management_area = rec.building_area
+ rec.rentable_area = rec.building_area
+
+ #待评估物业相关信息
+ unit_price = fields.Float(string='单价')
+ current_status = fields.Date(string='现状(合同到期日)')
+ registered_use = fields.Char(string='证载用途')
+ rental_conditions = fields.Text(string='出租条件')
+ district_manager = fields.Char(string='片区负责人')
+ remarks = fields.Text(string='备注')
+ evaluation_asset = fields.Char(string='评估资产')
+ evaluation_area = fields.Float(string='评估面积(m²)')
+ evaluation_category = fields.Char(string='评估类别')
+ last_hand_rent_price = fields.Float(string='上一手历史租金单价(元/m²•月)')
+ gov_rent_price = fields.Float(string='政府租金参考价')
+ evaluation_rent_price = fields.Float(string='评估散租单价(元/m²•月)')
+ evaluation_rent_total = fields.Float(string='评估总价(元•月,散租)')
+ evaluation_whole_rent_price = fields.Float(string='评估整租单价(元/m² •月)')
+ evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)')
+
+ assessment_category = fields.Char(string='评估类别')
+ property_message_id = fields.Many2one('property.evaluate.application', string='关联物业评估申请')
+ # yuthon_property_evaluated_id = fields.Many2one('yuthon.property.evaluated', string='关联评估备案表')
+
def put_change_title(self):
pass
def put_change_manage(self):
pass
+ def put_property_handover(self):
+ property_ids = self.env["yuthon.property"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ form_id = self.env.ref('yuthon_property_approval.view_property_handover_form').id
+ property_list = []
+ for record in property_ids:
+ property_list.append([0, 0, {'property_id': record.id}])
+ for i in property_ids:
+ i.write({'state': 'ing_handover'})
+ return {
+ 'name': '提交物业移交',
+ 'view_mode': 'form',
+ 'res_model': 'property.handover',
+ 'type': 'ir.actions.act_window',
+ 'views': [(form_id, 'form')],
+ "context": {
+ 'default_property_handover_ids':property_list
+ }
+ }
+ def put_assessment_approval(self):
+ property_ids = self.env["yuthon.property"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ if not property_ids:
+ if self.state != 'to':
+ raise UserError("当前状态不允许提交")
+ else:
+ for i in property_ids:
+ if i.state != 'to':
+ raise UserError("当前状态不允许提交")
+ form_id = self.env.ref('yuthon_property_approval.property_evaluate_application_form').id
+ if not property_ids:
+ property_ids = self
+ for i in property_ids:
+ i.write({'state': 'ing'})
+ return {
+ 'name': '提交物业评估',
+ 'view_mode': 'form',
+ 'res_model': 'property.evaluate.application',
+ 'type': 'ir.actions.act_window',
+ 'views': [(form_id, 'form')],
+ "context": {
+ 'default_yuthon_property_ids': [(6, 0, property_ids.ids)]
+ }
+ }
+
class YuthonPropertyWater(models.Model):
_name = 'yuthon.property.water'
@@ -122,3 +188,43 @@ class YuthonPropertyEnergy(models.Model):
def _onchange_water_meter_ids(self):
for rec in self:
rec.property_meter_archives_id.write({'yuthon_property_id': rec.property_meter_archives_id.id})
+
+
+
+class TitleInformationLine(models.Model):
+ _name = 'title.information.line'
+ _description = '产权信息明细行'
+
+ yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
+ address = fields.Char(string="地址")
+ equity_area = fields.Float(string="产权面积")
+ management_area = fields.Float(string="管理面积")
+ building_area = fields.Float(string="建筑面积")
+ rent_area = fields.Float(string="可租面积")
+ owner = fields.Char(string="权属人")
+ title_certificate = fields.Char(string="产权证号")
+ start_time = fields.Date(string="生效日期")
+ end_date = fields.Date(string="失效日期")
+
+class ManageInformationLine(models.Model):
+ _name = 'manage.information.line'
+ _description = '管理信息明细行'
+
+ yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
+ purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途")
+ precinct = fields.Char(string="片区")
+ admin_id = fields.Many2one('res.users', string="管理员")
+ company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')],
+ string="所属公司")
+ start_time = fields.Date(string="生效日期")
+ end_date = fields.Date(string="失效日期")
+
+class DisassemblyInformationLine(models.Model):
+ _name = 'disassembly.information.line'
+ _description = '拆合信息明细行'
+
+ yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息")
+ property_name = fields.Char(string="物业名称") #逻辑没搞清,暂时先放这里
+ rent_area = fields.Float(string="可租面积")
+ start_time = fields.Date(string="生效日期")
+ end_date = fields.Date(string="失效日期")
\ No newline at end of file
diff --git a/yuthon_property/models/yuthon_property_evaluated.py b/yuthon_property/models/yuthon_property_evaluated.py
index 501037ecc..1f304a91e 100644
--- a/yuthon_property/models/yuthon_property_evaluated.py
+++ b/yuthon_property/models/yuthon_property_evaluated.py
@@ -4,3 +4,12 @@ from odoo import models, fields, api
class YuthonPropertyEvaluated(models.Model):
_name = 'yuthon.property.evaluated'
_description = '评估项目备案表(已评估)'
+
+ name = fields.Char(string='标题')
+ other_company_id = fields.Many2one('res.company', string="评估单位")
+ evaluation_code = fields.Char(string="评估编号")
+ evaluation_way = fields.Char(string='评估方法')
+ base_date = fields.Date(string="基准日")
+ expert_review_time = fields.Date(string="专家评审时间")
+ notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
+ # yuthon_property_evaluation_ids = fields.One2many('yuthon.', 'yuthon_property_evaluated_id', string='物业信息明细行')
\ No newline at end of file
diff --git a/yuthon_property/models/yuthon_property_evaluation.py b/yuthon_property/models/yuthon_property_evaluation.py
index 5fd733703..ac6444214 100644
--- a/yuthon_property/models/yuthon_property_evaluation.py
+++ b/yuthon_property/models/yuthon_property_evaluation.py
@@ -5,53 +5,7 @@ from odoo.exceptions import UserError, ValidationError
class YuthonPropertyEvaluation(models.Model):
_name = 'yuthon.property.evaluation'
- _inherit = ['mail.thread', 'mail.activity.mixin']
- _description = '物业评估'
- owner = fields.Char(string='权属人')
- property_address = fields.Char(string='物业地址')
- property_area = fields.Float(string='产权面积')
- rentable_area = fields.Float(string='可租面积')
- unit_price = fields.Float(string='单价')
- current_status = fields.Date(string='现状(合同到期日)')
- registered_use = fields.Char(string='证载用途')
- rental_use = fields.Char(string='出租用途')
- rental_conditions = fields.Text(string='出租条件')
- district_manager = fields.Char(string='片区负责人')
- company = fields.Char(string='所属公司')
- remarks = fields.Text(string='备注')
- state = fields.Selection([('done','已评估'), ('draft','待评估'), ('ing','评估中')],string='评估状态',default='draft')
+ name = fields.Char(string='评估单号')
- sequence = fields.Integer(string='序号', default=10)
- evaluation_asset = fields.Char(string='评估资产')
- evaluation_area = fields.Float(string='评估面积(m²)')
- evaluation_category = fields.Char(string='评估类别')
- set_purpose = fields.Char(string='设定用途')
- last_hand_rent_price = fields.Float(string='上一手历史租金单价(元/m²•月)')
- gov_rent_price = fields.Float(string='政府租金参考价')
- evaluation_rent_price = fields.Float(string='评估散租单价(元/m²•月)')
- evaluation_rent_total = fields.Float(string='评估总价(元•月,散租)')
- evaluation_whole_rent_price = fields.Float(string='评估整租单价(元/m² •月)')
- evaluation_whole_rent_total = fields.Float(string='评估总价(元•月,整租)')
-
- assessment_category = fields.Char(string='评估类别')
- property_message_id = fields.Many2one('property.evaluate.application', string='关联物业评估申请')
-
- def all_issue_pull(self):
- issue_active_ids = self.env["yuthon.property.evaluation"].browse(self._context.get('active_ids', self._context.get('active_id')))
- if self.state != 'draft':
- raise UserError("当前状态不允许提交")
- form_id = self.env.ref("yuthon_property.property_evaluate_application_form").id
- if not issue_active_ids:
- issue_active_ids = self
- for record in issue_active_ids:
- record.write({"state": "ing"})
- return {
- 'name': '提交评估',
- 'type': 'ir.actions.act_window',
- 'res_model': 'property.evaluate.application',
- 'views': [(form_id, 'form')],
- 'context':{'default_property_message_ids':[(6, 0,issue_active_ids.ids)]},
-
- }
diff --git a/yuthon_property/models/yuthon_property_lessee.py b/yuthon_property/models/yuthon_property_lessee.py
new file mode 100644
index 000000000..162d8c0f1
--- /dev/null
+++ b/yuthon_property/models/yuthon_property_lessee.py
@@ -0,0 +1,15 @@
+from odoo import models, fields, api
+
+
+class YuthonPropertyLessee(models.Model):
+ _name = 'yuthon.property.lessee'
+ _description = '承租方列表'
+
+ name = fields.Char(string='标题')
+ customer_name = fields.Char(string='承租方名称')
+ entity_type = fields.Selection([('person', '个人'), ('company', '企业')], string='实体类型')
+ phone = fields.Char(string='联系人')
+ phone_number = fields.Char(string='联系电话')
+ industry = fields.Char(string='行业')
+ invoicing_type = fields.Char(string='开票类型')
+
diff --git a/yuthon_property/models/yuthon_resource_mgmt_config.py b/yuthon_property/models/yuthon_resource_mgmt_config.py
index 8995c7a26..87cea83d1 100644
--- a/yuthon_property/models/yuthon_resource_mgmt_config.py
+++ b/yuthon_property/models/yuthon_resource_mgmt_config.py
@@ -35,3 +35,11 @@ class YuthonResourceBillingType(models.Model):
_description = '开票类型'
name = fields.Char(string="开票类型")
+
+
+class YuthonPropertySource(models.Model):
+ _name = 'yuthon.property.source'
+ _description = '资产来源'
+
+ name = fields.Char(string="资产来源")
+
diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv
index 8c1219596..70f19eff9 100644
--- a/yuthon_property/security/ir.model.access.csv
+++ b/yuthon_property/security/ir.model.access.csv
@@ -1,6 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_yuthon_property,yuthon_property,model_yuthon_property,base.group_user,1,1,1,1
-access_property_type,property_type,model_property_type,base.group_user,1,1,1,1
access_property_patrol_duty,property_patrol_duty,model_property_patrol_duty,base.group_user,1,1,1,1
access_property_patrol_plan,property_patrol_plan,model_property_patrol_plan,base.group_user,1,1,1,1
access_property_route_management,property_route_management,model_property_route_management,base.group_user,1,1,1,1
@@ -15,11 +14,14 @@ access_yuthon_resource_house_type,yuthon_resource_house_type,model_yuthon_resour
access_yuthon_resource_purpose,yuthon_resource_purpose,model_yuthon_resource_purpose,base.group_user,1,1,1,1
access_yuthon_resource_management_type,yuthon_resource_management_type,model_yuthon_resource_management_type,base.group_user,1,1,1,1
access_yuthon_resource_billing_type,yuthon_resource_billing_type,model_yuthon_resource_billing_type,base.group_user,1,1,1,1
-access_property_evaluate_application,property_evaluate_application,model_property_evaluate_application,base.group_user,1,1,1,1
access_property_rental_form,property_rental_form,model_property_rental_form,base.group_user,1,1,1,1
access_property_transaction_confirmed,property_transaction_confirmed,model_property_transaction_confirmed,base.group_user,1,1,1,1
-access_yuthon_property_evaluation,yuthon_property_evaluation,model_yuthon_property_evaluation,base.group_user,1,1,1,1
access_property_meter_archives,property_meter_archives,model_property_meter_archives,base.group_user,1,1,1,1
access_property_meter_water,property_meter_water,model_property_meter_water,base.group_user,1,1,1,1
-
-
+access_yuthon_property_evaluated,yuthon_property_evaluated,model_yuthon_property_evaluated,base.group_user,1,1,1,1
+access_yuthon_property_lessee,yuthon_property_lessee,model_yuthon_property_lessee,base.group_user,1,1,1,1
+access_property_prospective_customers,property_prospective_customers,model_property_prospective_customers,base.group_user,1,1,1,1
+access_title_information_line,title_information_line,model_title_information_line,base.group_user,1,1,1,1
+access_manage_information_line,manage_information_line,model_manage_information_line,base.group_user,1,1,1,1
+access_disassembly_information_line,disassembly_information_line,model_disassembly_information_line,base.group_user,1,1,1,1
+access_yuthon_property_source,yuthon_property_source,model_yuthon_property_source,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_property/static/others/user_template.xlsx b/yuthon_property/static/others/user_template.xlsx
new file mode 100644
index 000000000..31abb9116
Binary files /dev/null and b/yuthon_property/static/others/user_template.xlsx differ
diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml
index 3368b16ee..8a53c399e 100644
--- a/yuthon_property/views/menuitem.xml
+++ b/yuthon_property/views/menuitem.xml
@@ -21,19 +21,14 @@
sequence="1"
name="待评估"
parent="yuthon_property_menu"
- action="yuthon_property_evaluation_action1"/>
-
+ action="yuthon_on_property_action"/>
+ action="action_yuthon_property_evaluated"/>
+ action="action_property_prospective_customers"/>
+ action="action_yuthon_property_lessee"/>
+ sequence="50"/>
@@ -293,7 +288,8 @@
action="yuthon_resource_management_type_action" sequence="10"/>
-
+
+ optional="{'preview_image': 'image_128'}"/>
@@ -65,29 +48,29 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -102,21 +85,60 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -134,12 +156,6 @@
-
-
-
-
-
-
@@ -153,7 +169,7 @@
-
+
@@ -166,8 +182,6 @@
-
-
@@ -194,20 +208,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -222,36 +223,74 @@
kanban,tree,form
-
-
- yuthon.property.water.tree
- yuthon.property.water
+
+
+ yuthon_property_tree2
+ yuthon.property
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- yuthon.property.energy.tree
- yuthon.property.energy
+
+ yuthon_property_form2
+ yuthon.property
-
-
-
-
-
-
-
-
+
-
+
+ 待评估物业
+ ir.actions.act_window
+ yuthon.property
+ tree,form
+ [('state','=','to')]
+
+
\ No newline at end of file
diff --git a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml
index f43f3a8bc..9343d2cb6 100644
--- a/yuthon_property/views/yuthon_resource_mgmt_config_views.xml
+++ b/yuthon_property/views/yuthon_resource_mgmt_config_views.xml
@@ -76,4 +76,19 @@
tree
+
+ yuthon.property.source.tree
+ yuthon.property.source
+
+
+
+
+
+
+
+ 物业来源
+ yuthon.property.source
+ tree
+
+
diff --git a/yuthon_property_approval/__init__.py b/yuthon_property_approval/__init__.py
index 9a7e03ede..c536983e2 100644
--- a/yuthon_property_approval/__init__.py
+++ b/yuthon_property_approval/__init__.py
@@ -1 +1,2 @@
-from . import models
\ No newline at end of file
+from . import models
+from . import wizard
\ No newline at end of file
diff --git a/yuthon_property_approval/__manifest__.py b/yuthon_property_approval/__manifest__.py
index 1ab94b39b..803b184df 100644
--- a/yuthon_property_approval/__manifest__.py
+++ b/yuthon_property_approval/__manifest__.py
@@ -11,6 +11,7 @@
'data/sale_renting_code_data.xml',
'security/ir.model.access.csv',
'views/property_billing_confirmation.xml',
+ 'views/property_approval_views.xml',
'views/property_business_confirm.xml',
'views/property_capacity.xml',
'views/property_collection_confirm.xml',
@@ -37,11 +38,12 @@
'views/property_construction_work.xml',
'views/property_confirm_views.xml',
'views/property_move_views.xml',
- 'views/property_assess_views.xml',
'views/property_contract_changes.xml',
'views/property_record_views.xml',
'views/property_equity_views.xml',
- 'views/property_approval_views.xml',
+ 'views/property_handover_views.xml',
+ 'views/property_evaluate_application_views.xml',
+ 'wizard/property_inducts_wizard.xml',
'views/property_menu_all.xml',
],
'demo': [],
diff --git a/yuthon_property_approval/data/sale_renting_code_data.xml b/yuthon_property_approval/data/sale_renting_code_data.xml
index 237791dca..7d36a54b5 100644
--- a/yuthon_property_approval/data/sale_renting_code_data.xml
+++ b/yuthon_property_approval/data/sale_renting_code_data.xml
@@ -189,6 +189,13 @@
3
+
+ 物业移交审批编号
+ property_handover_code
+ XZ%(y)s%(month)s%(day)s
+ 3
+
+
物业合同变更编号
property_contract_changes_code
diff --git a/yuthon_property_approval/models/__init__.py b/yuthon_property_approval/models/__init__.py
index 6435588fb..1ab8a69d7 100644
--- a/yuthon_property_approval/models/__init__.py
+++ b/yuthon_property_approval/models/__init__.py
@@ -1,6 +1,5 @@
from . import property_billing_confirmation
from . import property_business_confirm
-from . import property_approval
from . import property_capacity
from . import property_collection_confirm
from . import property_early_quitting
@@ -24,9 +23,11 @@ from . import property_open_rent
from . import property_confirm
from . import property_move
from . import property_equity
-from . import property_assess
from . import property_renamed
from . import property_record
from . import property_lessee_change
from . import property_contract_changes
-from . import property_construction_work
\ No newline at end of file
+from . import property_construction_work
+from . import property_evaluate_application
+from . import property_approval
+from . import property_handover
\ No newline at end of file
diff --git a/yuthon_property_approval/models/property_approval.py b/yuthon_property_approval/models/property_approval.py
index 5348150fe..a01b88488 100644
--- a/yuthon_property_approval/models/property_approval.py
+++ b/yuthon_property_approval/models/property_approval.py
@@ -1,35 +1,41 @@
- # -*- coding: utf-8 -*-
- # Part of Odoo. See LICENSE file for full copyright and licensing details.
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
class PropertyApproval(models.Model):
- _name = 'property.approval'
- _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
- _description = '新增物业审批'
+ _name = 'property.approval'
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
+ _description = '新增物业审批'
- name = fields.Char(string='标题')
- tip_description = fields.Html('正文')
- code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_approval_code'))
- property_documents_ids = fields.Many2many('documents.document', string="附件")
- source = fields.Char(string="来源")
-
- property_massage_ids = fields.One2many('property.approval.line', 'property_approval_id', string="审批信息")
+ name = fields.Char(string='标题')
+ tip_description = fields.Html('正文')
+ code = fields.Char(string="编号",
+ default=lambda self: self.env['ir.sequence'].next_by_code('property_approval_code'))
+ property_documents_ids = fields.Many2many('documents.document', string="附件")
+ source = fields.Many2one('yuthon.property.source', string="物业来源")
+ property_massage_ids = fields.One2many('property.approval.line', 'property_approval_id', string="审批信息")
+ def put_message_in(self): # 导入按钮
+ return {
+ "type": "ir.actions.act_window",
+ "name": "批量更新物业信息",
+ "res_model": "property.inducts.wizard",
+ "view_mode": "form",
+ "target": "new",
+ }
class PropertyApprovalLine(models.Model):
- _name = 'property.approval.line'
- _description = '新增物业审批信息'
-
- property_approval_id = fields.Many2one('property.approval', string="审批信息")
- property_address = fields.Char(string="物业地址")
- is_affirmation = fields.Boolean(string="是否确权")
- owner = fields.Char(string="权属人")
- title_number = fields.Char(string="产权编号")
- area = fields.Float(string="面积")
- purposes = fields.Char(string="用途")
- state = fields.Selection([('rental','出租中'), ('vacant', '空置中'), ('rented', '待出租')], string="状态")
-
-
+ _name = 'property.approval.line'
+ _description = '新增物业审批明细行'
+ property_approval_id = fields.Many2one('property.approval', string="审批信息")
+ property_address = fields.Char(string="物业地址")
+ is_affirmation = fields.Boolean(string="是否确权")
+ owner = fields.Char(string="权属人")
+ title_number = fields.Char(string="产权编号")
+ area = fields.Float(string="面积")
+ purposes = fields.Char(string="用途")
+ state = fields.Selection([('rental', '出租中'), ('vacant', '空置中'), ('rented', '待出租')], string="状态",
+ default="rented")
diff --git a/yuthon_property_approval/models/property_assess.py b/yuthon_property_approval/models/property_assess.py
deleted file mode 100644
index 6e8ea2ed8..000000000
--- a/yuthon_property_approval/models/property_assess.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-from odoo import models, fields, api, exceptions, _
-
-
-class PropertyAssess(models.Model):
- _name = 'property.assess'
- _description = '物业评估审批'
- _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
- _rec_name = 'name'
-
- name = fields.Char(string='标题')
- code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_assess_code'))
- property_documents_ids = fields.Many2many('documents.document', string="评估文件")
- property_assess_line_ids = fields.One2many('property.assess.line', 'property_assess_id', string="评估文件")
-
-
-class PropertyAssessLine(models.Model):
- _name = 'property.assess.line'
-
- property_assess_id = fields.Many2one('property.assess', string='关联审批')
- product_id = fields.Many2one('product.product', string="待评估物业")
- partner_id = fields.Many2one('res.partner', string="评估公司")
- assess_type = fields.Selection([('rent_money', '租金'), ('value', '价值')], string="评估类别")
-
-
-
-
-
-
-
diff --git a/yuthon_property_approval/models/property_evaluate_application.py b/yuthon_property_approval/models/property_evaluate_application.py
new file mode 100644
index 000000000..31bf9691d
--- /dev/null
+++ b/yuthon_property_approval/models/property_evaluate_application.py
@@ -0,0 +1,29 @@
+from odoo import models, fields, api
+
+
+class PropertyEvaluateApplication(models.Model):
+ _name = 'property.evaluate.application'
+ _description = '物业评估申请'
+ _inherit = ['soong.workflow.mixin']
+
+
+ name = fields.Char(string='标题')
+ code = fields.Char(string='编号', required=True, copy=False,
+ default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_property_code'))
+ main_text = fields.Html(string='正文')
+ is_meet = fields.Boolean(string="是否上会")
+ is_experts = fields.Boolean(string="是否需要专家评审")
+ notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
+ issue_library_id = fields.Many2one('issue.library', string='关联议题')
+ yuthon_property_ids = fields.One2many('yuthon.property', 'property_message_id', string='物业信息明细行')
+
+ # def put(self):
+ # done_ids = self.env["property.evaluate.application"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ # form_id = self.env.ref('yuthon_property_approval.view_property_handover_form').id
+ # return {
+ # 'name': '已评估',
+ # 'type': 'ir.actions.act_window',
+ # 'res_model': 'property.evaluate.application',
+ # 'view_mode': 'form',
+ # 'views': [(form_id, 'form')],
+
diff --git a/yuthon_property_approval/models/property_handover.py b/yuthon_property_approval/models/property_handover.py
new file mode 100644
index 000000000..07cb9f36b
--- /dev/null
+++ b/yuthon_property_approval/models/property_handover.py
@@ -0,0 +1,30 @@
+from odoo import models, fields, api, exceptions
+
+
+class PropertyHandover(models.Model):
+ _name = 'property.handover'
+ _description = '移交申请'
+ _inherit = ['soong.workflow.mixin']
+
+ name = fields.Char(string='标题')
+ tip_description = fields.Html('正文')
+ code = fields.Char(string="编号",
+ default=lambda self: self.env['ir.sequence'].next_by_code('property_handover_code'))
+ property_documents_ids = fields.Many2many('documents.document', string="附件")
+ source = fields.Char(string="移交单位")
+ property_handover_ids = fields.One2many('property.handover.line','property_handover_id',string="移交申请")
+
+class PropertyHandoverLine(models.Model):
+ _name = 'property.handover.line'
+ _description = '移交申请明细'
+
+ property_handover_id = fields.Many2one('property.handover', string="审批信息")
+ property_id = fields.Many2one('yuthon.property', string="关联物业信息")
+ property_address = fields.Char(related='property_id.property_room',string="物业地址")
+ is_affirmation = fields.Boolean(related='property_id.is_confirm_authorization',string="是否确权")
+ owner = fields.Many2one(related='property_id.owner_id',string="权属人")
+ title_number = fields.Char(string="产权编号")
+ area = fields.Float(related='property_id.actual_area',string="面积")
+ purposes = fields.Many2one(related='property_id.asset_type_id',string="用途")
+ state = fields.Selection(related='property_id.state', string="状态",
+ default="rented")
\ 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 d3d4fb3d4..0321f4e0a 100644
--- a/yuthon_property_approval/security/ir.model.access.csv
+++ b/yuthon_property_approval/security/ir.model.access.csv
@@ -23,12 +23,8 @@ access_property_utility_bills,property_utility_bills,model_property_utility_bill
access_property_open_rent,property_open_rent,model_property_open_rent,base.group_user,1,1,1,1
access_property_confirm,property_confirm,model_property_confirm,base.group_user,1,1,1,1
access_property_move,property_move,model_property_move,base.group_user,1,1,1,1
-access_property_assess,property_assess,model_property_assess,base.group_user,1,1,1,1
-access_property_assess_line,property_assess_line,model_property_assess_line,base.group_user,1,1,1,1
access_property_record,property_record,model_property_record,base.group_user,1,1,1,1
-access_property_approval,property_approval,model_property_approval,base.group_user,1,1,1,1
access_property_equity,property_equity,model_property_equity,base.group_user,1,1,1,1
-access_property_approval_line,property_approval_line,model_property_approval_line,base.group_user,1,1,1,1
access_property_information_detail_lines,property_information_detail_lines,model_property_information_detail_lines,base.group_user,1,1,1,1
access_property_lease_contract_line,property_lease_contract_line,model_property_lease_contract_line,base.group_user,1,1,1,1
access_property_rent_breakdown_line,property_rent_breakdown_line,model_property_rent_breakdown_line,base.group_user,1,1,1,1
@@ -40,4 +36,10 @@ access_property_penalty_relief_line,property_penalty_relief_line,model_property_
access_property_repair_relief_line,property_repair_relief_line,model_property_repair_relief_line,base.group_user,1,1,1,1
access_property_contract_changes,property_contract_changes,model_property_contract_changes,base.group_user,1,1,1,1
access_property_construction_work,property_construction_work,model_property_construction_work,base.group_user,1,1,1,1
-access_property_eligibility_line,property_eligibility_line,model_property_eligibility_line,base.group_user,1,1,1,1
\ No newline at end of file
+access_property_eligibility_line,property_eligibility_line,model_property_eligibility_line,base.group_user,1,1,1,1
+access_property_evaluate_application,property_evaluate_application,model_property_evaluate_application,base.group_user,1,1,1,1
+access_property_approval,property_approval,model_property_approval,base.group_user,1,1,1,1
+access_property_approval_line,property_approval_line,model_property_approval_line,base.group_user,1,1,1,1
+access_property_handover,property_handover,model_property_handover,base.group_user,1,1,1,1
+access_property_handover_line,property_handover_line,model_property_handover_line,base.group_user,1,1,1,1
+access_property_inducts_wizard,property_inducts_wizard,model_property_inducts_wizard,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_property_approval/views/property_approval_views.xml b/yuthon_property_approval/views/property_approval_views.xml
index 3114fcce7..608429a10 100644
--- a/yuthon_property_approval/views/property_approval_views.xml
+++ b/yuthon_property_approval/views/property_approval_views.xml
@@ -26,36 +26,40 @@
-
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
新增物业审批
property.approval
tree,form
diff --git a/yuthon_property/views/property_evaluate_application_views.xml b/yuthon_property_approval/views/property_evaluate_application_views.xml
similarity index 80%
rename from yuthon_property/views/property_evaluate_application_views.xml
rename to yuthon_property_approval/views/property_evaluate_application_views.xml
index 984ddc6eb..6f7366b43 100644
--- a/yuthon_property/views/property_evaluate_application_views.xml
+++ b/yuthon_property_approval/views/property_evaluate_application_views.xml
@@ -7,7 +7,6 @@
-
@@ -18,15 +17,18 @@
diff --git a/yuthon_property_approval/views/property_handover_views.xml b/yuthon_property_approval/views/property_handover_views.xml
new file mode 100644
index 000000000..685552884
--- /dev/null
+++ b/yuthon_property_approval/views/property_handover_views.xml
@@ -0,0 +1,65 @@
+
+
+
+ property.handover.tree
+ property.handover
+
+
+
+
+
+
+
+
+
+
+ property.handover.form
+ property.handover
+
+
+
+
+
+ 移交审批
+ property.handover
+ tree,form
+
+
diff --git a/yuthon_property_approval/views/property_menu_all.xml b/yuthon_property_approval/views/property_menu_all.xml
index 2a1240a48..6f2b1b520 100644
--- a/yuthon_property_approval/views/property_menu_all.xml
+++ b/yuthon_property_approval/views/property_menu_all.xml
@@ -2,177 +2,184 @@
+ id="property_approval_menu"
+ parent="yuthon_property.resource_management_menu"
+ name="新增物业审批"
+ action="property_approval_action"
+ sequence="3"/>
+ id="property_billing_confirmation_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="账单确认单审批"
+ action="property_billing_confirmation_action"
+ sequence="20"/>
+ id="property_business_confirm_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="经营报表确认单审批"
+ action="property_business_confirm_action"
+ sequence="21"/>
+ id="property_capacity_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="增容审批"
+ action="property_capacity_action"
+ sequence="22"/>
+ id="property_early_quitting_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="提前退租审批"
+ action="property_early_quitting_action"
+ sequence="24"/>
+ id="property_fitment_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="装修审批"
+ action="property_fitment_action"
+ sequence="26"/>
+ id="property_inventory_table_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="盘点表审批"
+ action="property_inventory_table_action"
+ sequence="27"/>
+ id="property_information_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="物业信息审批"
+ action="property_information_action"
+ sequence="28"/>
+ id="property_lease_alter_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="续租审批审批"
+ action="property_lease_alter_action"
+ sequence="29"/>
+ id="property_lease_contract_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="租赁合同审批"
+ action="property_lease_contract_action"
+ sequence="30"/>
+ id="property_lease_extension_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="延租审批"
+ action="property_lease_extension_action"
+ sequence="31"/>
+ id="property_lease_renewal_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="租赁合同变更审批"
+ action="property_lease_renewal_action"
+ sequence="32"/>
+ id="property_management_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="物业管理变更申请表"
+ action="property_management_action"
+ sequence="33"/>
+ id="property_management_fee_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="管理费审批"
+ action="property_management_fee_action"
+ sequence="34"/>
+ id="property_material_procurement_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="物资配件采购单审批"
+ action="property_material_procurement_action"
+ sequence="35"/>
+ id="property_penalty_proportion_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="违约金比例审批"
+ action="property_penalty_proportion_action"
+ sequence="36"/>
+ id="property_penalty_relief_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="违约金减免审批"
+ action="property_penalty_relief_action"
+ sequence="37"/>
+ id="property_rent_relief_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="租金减免审批"
+ action="property_rent_relief_action"
+ sequence="38"/>
+ id="property_report_repair_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="报事报修审批"
+ action="property_report_repair_action"
+ sequence="39"/>
+ id="property_utility_bills_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="水电费审批"
+ action="property_utility_bills_action"
+ sequence="40"/>
+ id="property_equity_approval_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="物业产权变更"
+ action="property_equity_action"
+ sequence="41"/>
-
-
-
-
-
-
+ id="property_renamed_approval_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="更名申请表"
+ action="property_renamed_action"
+ sequence="42"/>
+
+
+
+
+
+
+ id="property_construction_work_menu"
+ parent="yuthon_property.property_approval_menu"
+ name="建设工程审批"
+ action="action_property_construction_work"
+ sequence="44"/>
+ id="property_handover_approval_menu"
+ parent="yuthon_property.resource_management_menu"
+ name="物业移交审批"
+ action="property_handover_action"
+ sequence="7"/>
+
+
-
-
+ parent="yuthon_property.yuthon_property_menu"
+ name="评估申请"
+ action="property_evaluate_application_action"
+ sequence="7"/>
-
+ sequence="9"/>
+
+
\ No newline at end of file
diff --git a/yuthon_property_approval/views/property_record_views.xml b/yuthon_property_approval/views/property_record_views.xml
index ebcee0e57..8af6e11cf 100644
--- a/yuthon_property_approval/views/property_record_views.xml
+++ b/yuthon_property_approval/views/property_record_views.xml
@@ -26,7 +26,7 @@
-
+
@@ -48,12 +48,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/yuthon_property_approval/wizard/__init__.py b/yuthon_property_approval/wizard/__init__.py
new file mode 100644
index 000000000..fb0111b21
--- /dev/null
+++ b/yuthon_property_approval/wizard/__init__.py
@@ -0,0 +1 @@
+from . import property_inducts_wizard
\ No newline at end of file
diff --git a/yuthon_property_approval/wizard/property_inducts_wizard.py b/yuthon_property_approval/wizard/property_inducts_wizard.py
new file mode 100644
index 000000000..120bd3f69
--- /dev/null
+++ b/yuthon_property_approval/wizard/property_inducts_wizard.py
@@ -0,0 +1,35 @@
+from odoo import models, fields, api, _, SUPERUSER_ID
+from odoo.exceptions import ValidationError, UserError
+import xlrd
+import base64
+import datetime
+from datetime import datetime
+
+
+class PropertyInductsWizard(models.Model):
+ _name = 'property.inducts.wizard'
+
+ excel_file = fields.Binary(string="上传Excel表")
+ excel_name = fields.Char(string="文件名")
+
+ def confirm(self):
+ """
+ 导入excel文件,按行读取数据并处理
+ :return: 导入新增物业明细行并更新
+ """
+ if not self.excel_file:
+ raise ValidationError('请上传文件。')
+ book = xlrd.open_workbook(file_contents=base64.decodebytes(self.excel_file))
+ sh = book.sheet_by_index(0)
+ for rx in range(1, sh.nrows):
+ row = sh.row(rx)
+ self.employee_user_data(row)
+ return {
+ 'name': '批量更新新物业信息',
+ 'type': 'ir.actions.act_window',
+ 'view_mode': 'tree',
+ 'res_model': 'property.approval.line',
+ }
+
+ def employee_user_data(self, row):
+ pass
\ No newline at end of file
diff --git a/yuthon_property_approval/wizard/property_inducts_wizard.xml b/yuthon_property_approval/wizard/property_inducts_wizard.xml
new file mode 100644
index 000000000..83095c1a0
--- /dev/null
+++ b/yuthon_property_approval/wizard/property_inducts_wizard.xml
@@ -0,0 +1,35 @@
+
+
+
+ 物业信息模板下载
+ self
+ ...
+
+
+
+ 物业信息导入弹窗
+ property.inducts.wizard
+
+
+
+
+
\ No newline at end of file