添加功能

This commit is contained in:
zhouzhou
2024-10-31 19:54:26 +08:00
parent 97788349d0
commit 44dd7fff59
54 changed files with 1198 additions and 813 deletions
+22 -22
View File
@@ -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'
@@ -9,7 +9,7 @@
<field name="name" required="1"/>
<field name="user_type"/>
<field name="department_id"/>
<field name="yuthon_company"/>
<field name="yuthon_company" readonly="0"/>
<field name="create_time"/>
<field name="end_time"/>
</tree>
@@ -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', '特殊排版')])
@@ -6,7 +6,7 @@
<field name="inherit_id" ref="hr_contract.hr_contract_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="after">
<field name="job_lv_id" required="1"/>
<field name="job_lv_id"/>
<field name="code"/>
</xpath>
<xpath expr="//page[@name='information']" position="replace">
+33 -15
View File
@@ -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
@@ -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')
@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hr_leave_batch hr.leave.batch model_hr_leave_batch 1 1 1 1
3 access_hr_leave_line hr.leave.line model_hr_leave_line 1 1 1 1
+65 -23
View File
@@ -6,14 +6,19 @@
<field name="name">hr.leave.batch.tree</field>
<field name="model">hr.leave.batch</field>
<field name="arch" type="xml">
<tree string="Time Off Batches">
<field name="employee_id"/>
<tree string="请假审批">
<field name="employee_id" column_invisible="1"/>
<field name="name"/>
<field name="state"/>
<field name="state" column_invisible="1"/>
<field name="company_page"/>
<field name="leave_id"/>
<field name="days"/>
<field name="hours"/>
<!-- <field name="holiday_status_id" string="Leave Type" column_invisible="1"/>-->
<!-- <field name="leave_ids"/> -->
<button name="action_validate" type="object" class="oe_highlight" string="Validate" invisible="state != 'confirm'"/>
<button name="action_refuse" type="object" class="oe_highlight" string="Refuse" invisible="state != 'confirm'"/>
<button name="action_draft" type="object" class="oe_highlight" string="Retract" invisible="state == 'draft' or id == False"/>
<button name="action_validate" type="object" class="oe_highlight" string="Validate" invisible="1"/>
<button name="action_refuse" type="object" class="oe_highlight" string="Refuse" invisible="1"/>
<button name="action_draft" type="object" class="oe_highlight" string="Retract" invisible="1"/>
</tree>
</field>
</record>
@@ -25,24 +30,46 @@
<field name="arch" type="xml">
<form>
<header>
<field name="state" widget="statusbar"/>
<button name="action_submit" type="object" class="oe_highlight" string="Submit" invisible="state != 'draft'"/>
<button name="action_validate" type="object" class="oe_highlight" string="Validate" invisible="state != 'confirm'"/>
<button name="action_refuse" type="object" class="oe_highlight" string="Refuse" invisible="state != 'confirm'"/>
<button name="action_draft" type="object" class="oe_highlight" string="Retract" invisible="state == 'draft' or id == False"/>
<field name="state" widget="statusbar" invisible="1"/>
<button name="action_submit" type="object" class="oe_highlight" string="Submit" invisible="1"/>
<button name="action_validate" type="object" class="oe_highlight" string="Validate" invisible="1"/>
<button name="action_refuse" type="object" class="oe_highlight" string="Refuse" invisible="1"/>
<button name="action_draft" type="object" class="oe_highlight" string="Retract" invisible="1"/>
</header>
<sheet>
<group>
<field name="employee_id" readonly="1" forcesave="1"/>
<field name="name"/>
</group>
<!-- <group>-->
<!-- <field name="employee_id" readonly="1" forcesave="1"/>-->
<!-- <field name="name"/>-->
<!-- </group>-->
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="company_page"/>
<field name="leave_id"/>
<field name="text"/>
</group>
<group>
<field name="department_id"/>
<field name="users_id"/>
</group>
<group>
<field name="days"/>
<field name="hours"/>
<field name="is_issues" invisible="1"/>
</group>
</group>
<notebook>
<page string="Details">
<page string="详情" invisible="1">
<field name="leave_ids" mode="tree" context="{'form_view_ref': 'hr_holidays.hr_leave_view_form_dashboard_new_time_off'}">
<tree>
<field name="state" column_invisible="True"/>
<field name="holiday_type"/>
<field name="holiday_status_id" class="fw-bold" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
<!-- <field name="holiday_status_id" class="fw-bold" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>-->
<field name="name"/>
<field name="date_from" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
<field name="date_to" readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"/>
@@ -50,12 +77,27 @@
</tree>
</field>
</page>
<page string="请假详情">
<field name="leave_line_ids">
<tree editable="bottom">
<field name="leave_batch_id" column_invisible="1"/>
<field name="leave_type_id"/>
<field name="available_days"/>
<field name="applicants"/>
<field name="start_time"/>
<field name="end_time"/>
<field name="days"/>
<field name="residual"/>
<field name="leave_documents_ids" widget="preview_many2many"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" options="{'open_attachments': True}"/>
<field name="message_ids"/>
</div>
<!-- <div class="oe_chatter">-->
<!-- <field name="message_follower_ids" options="{'open_attachments': True}"/>-->
<!-- <field name="message_ids"/>-->
<!-- </div>-->
</form>
</field>
</record>
@@ -80,7 +122,7 @@
<!-- Action My Time Off -->
<record id="hr_leave_batch_action_my" model="ir.actions.act_window">
<field name="name">My Time Off</field>
<field name="name">我的休假</field>
<field name="res_model">hr.leave.batch</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
@@ -97,7 +139,7 @@
<!-- Action My Time Off -->
<record id="hr_leave_batch_action_all" model="ir.actions.act_window">
<field name="name">All Time Off</field>
<field name="name">所有休息时间</field>
<field name="res_model">hr.leave.batch</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
@@ -8,6 +8,9 @@
<xpath expr="//field[@name='display_name']" position="attributes">
<attribute name="string">假期类型</attribute>
</xpath>
<xpath expr="//field[@name='display_name']" position="after">
<field name="available_days"/>
</xpath>
<xpath expr="//field[@name='allocation_validation_type']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
@@ -23,6 +26,9 @@
<field name="leave_documents_id" widget="preview_many2many"/>
</group>
</xpath>
<xpath expr="//field[@name='leave_documents_id']" position="after">
<field name="available_days"/>
</xpath>
<xpath expr="//group[@name='leave_validation']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
+42 -12
View File
@@ -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):
@@ -65,17 +65,17 @@
<field name="birthday"/>
<label for="old"/>
<div>
<field name="old" style="width: 5%"/>岁
<field name="old" style="width: 5%"/>
</div>
<label for="birthday_month"/>
<div>
<field name="birthday_month" style="width: 5%"/>月
<field name="birthday_month" style="width: 5%"/>
</div>
<field name="user_type"/>
<field name="retire_date"/>
<label for="retire_years"/>
<div>
<field name="retire_years" style="width: 5%"/>年
<field name="retire_years" style="width: 5%"/>
</div>
<field name="political_aspects"/>
<field name="dang_data"/>
@@ -258,4 +258,15 @@
<field name="view_mode">tree,kanban,form,activity,graph,pivot,hierarchy</field>
</record>
<record id="view_employee_form_inherit_hr_attendance" model="ir.ui.view">
<field name="name">hr.employee.attendance.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr_attendance.view_employee_form_inherit_hr_attendance"/>
<field name="arch" type="xml">
<!-- 源码的信息暂时隐藏 -->
<xpath expr="//group[@name='managers']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</odoo>
@@ -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='议题附件')
+14 -8
View File
@@ -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 = []
+1 -1
View File
@@ -36,7 +36,7 @@
<sheet>
<group>
<group>
<field name="name" required="1"/>
<field name="name" required="1" force_save="1"/>
<field name="name_text" invisible="1"/>
<field name="code"/>
<field name="approval_decision_sequence" invisible="1"/>
+3 -3
View File
@@ -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': [],
@@ -85,27 +85,4 @@
<field name="name">全电票</field>
</record>
<record model="property.type" id="yuthon_property_type_data0">
<field name="name">待评估</field>
</record>
<record model="property.type" id="yuthon_property_type_data1">
<field name="name">评估中</field>
</record>
<record model="property.type" id="yuthon_property_type_data2">
<field name="name">评估备案</field>
</record>
<record model="property.type" id="yuthon_property_type_data3">
<field name="name">挂网</field>
</record>
<record model="property.type" id="yuthon_property_type_data4">
<field name="name">签约中</field>
</record>
<record model="property.type" id="yuthon_property_type_data5">
<field name="name">已出租</field>
</record>
<record model="property.type" id="yuthon_property_type_data6">
<field name="name">闲置</field>
</record>
</odoo>
@@ -7,5 +7,4 @@
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
</odoo>
+4 -2
View File
@@ -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
+12
View File
@@ -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'
@@ -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='物业信息明细行')
@@ -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='行业')
-39
View File
@@ -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
+127 -21
View File
@@ -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="失效日期")
@@ -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='物业信息明细行')
@@ -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)]},
}
@@ -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='开票类型')
@@ -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="资产来源")
+7 -5
View File
@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 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
3 access_property_patrol_duty property_patrol_duty model_property_patrol_duty base.group_user 1 1 1 1
4 access_property_patrol_plan property_patrol_plan model_property_patrol_plan base.group_user 1 1 1 1
5 access_property_route_management property_route_management model_property_route_management base.group_user 1 1 1 1
14 access_yuthon_resource_purpose yuthon_resource_purpose model_yuthon_resource_purpose base.group_user 1 1 1 1
15 access_yuthon_resource_management_type yuthon_resource_management_type model_yuthon_resource_management_type base.group_user 1 1 1 1
16 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
17 access_property_rental_form property_rental_form model_property_rental_form base.group_user 1 1 1 1
18 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
19 access_property_meter_archives property_meter_archives model_property_meter_archives base.group_user 1 1 1 1
20 access_property_meter_water property_meter_water model_property_meter_water base.group_user 1 1 1 1
21 access_yuthon_property_evaluated yuthon_property_evaluated model_yuthon_property_evaluated base.group_user 1 1 1 1
22 access_yuthon_property_lessee yuthon_property_lessee model_yuthon_property_lessee base.group_user 1 1 1 1
23 access_property_prospective_customers property_prospective_customers model_property_prospective_customers base.group_user 1 1 1 1
24 access_title_information_line title_information_line model_title_information_line base.group_user 1 1 1 1
25 access_manage_information_line manage_information_line model_manage_information_line base.group_user 1 1 1 1
26 access_disassembly_information_line disassembly_information_line model_disassembly_information_line base.group_user 1 1 1 1
27 access_yuthon_property_source yuthon_property_source model_yuthon_property_source base.group_user 1 1 1 1
Binary file not shown.
+8 -12
View File
@@ -21,19 +21,14 @@
sequence="1"
name="待评估"
parent="yuthon_property_menu"
action="yuthon_property_evaluation_action1"/>
<menuitem id="yuthon_property_evaluate_application_menu"
sequence="3"
name="评估申请"
parent="yuthon_property_menu"
action="property_evaluate_application_action"/>
action="yuthon_on_property_action"/>
<menuitem id="yuthon_property_evaluated_menu"
sequence="5"
name="已评估"
parent="yuthon_property_menu"
action="yuthon_property_evaluation_action2"/>
action="action_yuthon_property_evaluated"/>
<menuitem id="yuthon_property_evaluation_experts_menu"
sequence="7"
sequence="20"
name="评估专家库(二期)"
parent="yuthon_property_menu"/>
<menuitem id="yuthon_property_evaluation_list_menu"
@@ -138,12 +133,12 @@
sequence="1"
name="意向客户管理"
parent="yuthon_customer_management_menu"
action="property_assess_action"/>
action="action_property_prospective_customers"/>
<menuitem id="yuthon_property_customer_management"
sequence="3"
name="承租方管理"
parent="yuthon_customer_management_menu"
action="property_assess_action"/>
action="action_yuthon_property_lessee"/>
<menuitem id="yuthon_financial_management_menu"
sequence="17"
name="财务管理"
@@ -281,7 +276,7 @@
parent="resource_management_menu"
name="配置"
action="yuthon_resource_mgmt_config_action"
sequence="2"/>
sequence="50"/>
<menuitem id="yuthon_resource_type_menu" parent="resource_mgmt_config_menu" name="资产类型"
action="yuthon_resource_type_action" sequence="10"/>
@@ -293,7 +288,8 @@
action="yuthon_resource_management_type_action" sequence="10"/>
<menuitem id="yuthon_resource_mgmt_config_menu" parent="resource_mgmt_config_menu" name="开票类型"
action="yuthon_resource_mgmt_config_action" sequence="10"/>
<menuitem id="yuthon_property_source_action_menu" parent="resource_mgmt_config_menu" name="物业来源配置"
action="yuthon_property_source_action" sequence="12"/>
<menuitem
id="property_approval_management_menu"
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_prospective_customers_tree" model="ir.ui.view">
<field name="name">property.prospective.customers.tree</field>
<field name="model">property.prospective.customers</field>
<field name="arch" type="xml">
<tree string="意向客户列表">
<field name="name"/>
<field name="customer_name"/>
<field name="entity_type"/>
<field name="phone"/>
<field name="phone_number"/>
<field name="industry"/>
</tree>
</field>
</record>
<record id="view_property_prospective_customers_form" model="ir.ui.view">
<field name="name">property.prospective.customers.form</field>
<field name="model">property.prospective.customers</field>
<field name="arch" type="xml">
<form string="意向客户">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group col="3">
<group>
<field name="customer_name"/>
<field name="phone_number"/>
</group>
<group>
<field name="entity_type"/>
<field name="industry"/>
</group>
<group>
<field name="phone"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_property_prospective_customers" model="ir.actions.act_window">
<field name="name">意向客户列表</field>
<field name="res_model">property.prospective.customers</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_type_tree" model="ir.ui.view">
<field name="name">property.type.tree</field>
<field name="model">property.type</field>
<field name="arch" type="xml">
<tree string="物业状态" editable="bottom">
<field name="name"/>
<field name="create_time"/>
<field name="start_time" required="1"/>
<field name="end_time" required="1"/>
<field name="is_enable"/>
</tree>
</field>
</record>
<record id="property_type_action" model="ir.actions.act_window">
<field name="name">物业调拨审批</field>
<field name="res_model">property.type</field>
<field name="view_mode">tree</field>
</record>
</odoo>
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id='view_yuthon_property_evaluated_tree' model='ir.ui.view'>
<field name="name">yuthon.property.evaluated.tree</field>
<field name="model">yuthon.property.evaluated</field>
<field name="arch" type="xml">
<tree string="评估备案表">
<field name="name"/>
<field name="other_company_id"/>
<field name="base_date"/>
<field name="evaluation_code"/>
<field name="evaluation_way"/>
<field name="expert_review_time"/>
</tree>
</field>
</record>
<record id='view_yuthon_property_evaluated_form' model='ir.ui.view'>
<field name="name">yuthon.property.evaluated.form</field>
<field name="model">yuthon.property.evaluated</field>
<field name="arch" type="xml">
<form string="评估备案表">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group col="3">
<group>
<field name="other_company_id"/>
<field name="base_date"/>
</group>
<group>
<field name="evaluation_code"/>
<field name="expert_review_time"/>
</group>
<group>
<field name="evaluation_way"/>
</group>
</group>
<group>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<!-- <notebook>-->
<!-- <page string="评估项目详情">-->
<!-- <field name="yuthon_property_evaluation_ids">-->
<!-- <tree editable="bottom">-->
<!-- <field name="yuthon_property_evaluated_id" column_invisible="1"/>-->
<!-- <field name="property_address" string="评估资产"/>-->
<!-- <field name="rentable_area" string="评估面积m²"/>-->
<!-- <field name="assessment_category" string="评估类别"/>-->
<!-- <field name="owner"/>-->
<!-- <field name="registered_use"/>-->
<!-- <field name="rental_use" string="设定用途"/>-->
<!-- <field name="current_status"/>-->
<!-- <field name="unit_price" string="上一手历史租金单价" help="(元/m².月)"/>-->
<!-- <field name="rental_conditions" string="出租条件"/>-->
<!-- <field name="remarks" string="备注"/>-->
<!-- <field name="gov_rent_price" column_invisible="1"/>-->
<!-- <field name="evaluation_rent_price" column_invisible="1"/>-->
<!-- <field name="evaluation_rent_total" column_invisible="1"/>-->
<!-- <field name="evaluation_whole_rent_price" column_invisible="1"/>-->
<!-- <field name="evaluation_whole_rent_total" column_invisible="1"/>-->
<!-- </tree>-->
<!-- </field>-->
<!-- </page>-->
<!-- </notebook>-->
</sheet>
</form>
</field>
</record>
<record id="action_yuthon_property_evaluated" model="ir.actions.act_window">
<field name="name">评估项目备案表</field>
<field name="res_model">yuthon.property.evaluated</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
@@ -1,185 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--待评估物业-->
<record id="yuthon_property_evaluation_view_tree1" model="ir.ui.view">
<field name="name">yuthon_property_evaluation_view_tree</field>
<field name="model">yuthon.property.evaluation</field>
<field name="arch" type="xml">
<tree>
<field name="owner"/>
<field name="property_address"/>
<field name="property_area"/>
<field name="rentable_area"/>
<field name="unit_price"/>
<field name="current_status" optional="hide"/>
<field name="registered_use" optional="hide"/>
<field name="rental_use"/>
<field name="rental_conditions" optional="hide"/>
<field name="district_manager" optional="hide"/>
<field name="company" optional="show"/>
<field name="remarks" optional="hide"/>
<field name="state"/>
<button name="all_issue_pull" string="提交" type="object" class="btn btn-primary"/>
</tree>
</field>
</record>
<record id="yuthon_property_evaluation_view_form1" model="ir.ui.view">
<field name="name">yuthon_property_evaluation_view_form1</field>
<field name="model">yuthon.property.evaluation</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="owner"/>
<field name="property_address"/>
<field name="property_area"/>
<field name="rentable_area"/>
<field name="unit_price"/>
</group>
<group>
<field name="current_status"/>
<field name="registered_use"/>
<field name="rental_use"/>
<field name="district_manager"/>
<field name="company"/>
<field name="state" invisible="1"/>
</group>
</group>
<group>
<field name="rental_conditions"/>
<field name="remarks"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<!-- 已评估物业-->
<record id="yuthon_property_evaluation_view_tree2" model="ir.ui.view">
<field name="name">yuthon_property_evaluation_view_tree</field>
<field name="model">yuthon.property.evaluation</field>
<field name="arch" type="xml">
<tree>
<field name="sequence" widget="handle"/>
<field name="evaluation_asset"/>
<field name="evaluation_area"/>
<field name="evaluation_category"/>
<field name="owner"/>
<field name="registered_use" optional="hide"/>
<field name="set_purpose" optional="hide"/>
<field name="current_status" optional="hide"/>
<field name="rental_conditions"/>
<field name="remarks"/>
<field name="last_hand_rent_price"/>
<field name="state"/>
<field name="gov_rent_price" optional="hide"/>
<field name="evaluation_rent_price" optional="hide"/>
<field name="evaluation_rent_total" optional="hide"/>
<field name="evaluation_whole_rent_price" optional="hide"/>
<field name="evaluation_whole_rent_total" optional="hide"/>
</tree>
</field>
</record>
<record id="yuthon_property_evaluation_view_form2" model="ir.ui.view">
<field name="name">yuthon_property_evaluation_view_form1</field>
<field name="model">yuthon.property.evaluation</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="evaluation_asset"/>
<field name="evaluation_area"/>
<field name="evaluation_category"/>
<field name="owner"/>
<field name="rental_conditions"/>
<field name="last_hand_rent_price"/>
<field name="gov_rent_price"/>
<field name="evaluation_rent_price"/>
</group>
<group>
<field name="registered_use"/>
<field name="set_purpose"/>
<field name="current_status"/>
<field name="remarks"/>
<field name="evaluation_rent_total" />
<field name="evaluation_whole_rent_price" />
<field name="evaluation_whole_rent_total"/>
<field name="state" invisible="1"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="yuthon_property_evaluation_view_search" model="ir.ui.view">
<field name="name">yuthon_property_evaluation_view_search</field>
<field name="model">yuthon.property.evaluation</field>
<field name="arch" type="xml">
<search>
<field name="property_address"/>
<field name="property_area"/>
<field name="rentable_area"/>
<field name="unit_price"/>
<field name="current_status"/>
<field name="registered_use"/>
<field name="rental_use"/>
<field name="rental_conditions"/>
<field name="district_manager"/>
<field name="company"/>
<separator/>
<group expand="0">
<filter name="owner" context="{'group_by':'owner'}"/>
</group>
</search>
</field>
</record>
<record id="yuthon_property_evaluation_action1" model="ir.actions.act_window">
<field name="name">待评估物业</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">yuthon.property.evaluation</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_evaluation_view_tree1')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_evaluation_view_form1')})]"/>
<field name="search_view_id" ref="yuthon_property_evaluation_view_search"/>
</record>
<record id="yuthon_property_evaluation_action2" model="ir.actions.act_window">
<field name="name">已评估物业</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">yuthon.property.evaluation</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','ing')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_evaluation_view_tree2')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_evaluation_view_form2')})]"/>
<field name="search_view_id" ref="yuthon_property_evaluation_view_search"/>
</record>
evaluated
<record id="all_issue_pull" model="ir.actions.server">
<field name="name">批量提交</field>
<field name="model_id" ref="yuthon_property.model_yuthon_property_evaluation"/>
<field name="binding_model_id" ref="yuthon_property.model_yuthon_property_evaluation"/>
<field name="state">code</field>
<field name="code">action = model.all_issue_pull()</field>
</record>
</odoo>
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id='yuthon_property_lessee_tree_view' model='ir.ui.view'>
<field name='name'>yuthon.property.lessee.tree</field>
<field name='model'>yuthon.property.lessee</field>
<field name='arch' type='xml'>
<tree string="承租方信息">
<field name="name"/>
<field name="customer_name"/>
<field name="entity_type"/>
<field name="phone"/>
<field name="phone_number"/>
<field name="industry"/>
<field name="invoicing_type"/>
</tree>
</field>
</record>
<record id='yuthon_property_lessee_form_view' model='ir.ui.view'>
<field name='name'>yuthon.property.lessee.form</field>
<field name='model'>yuthon.property.lessee</field>
<field name='arch' type='xml'>
<form string="承租方信息">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group col="3">
<group>
<field name="customer_name"/>
<field name="phone_number"/>
</group>
<group>
<field name="entity_type"/>
<field name="industry"/>
</group>
<group>
<field name="phone"/>
<field name="invoicing_type"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_yuthon_property_lessee" model="ir.actions.act_window">
<field name="name">承租方信息</field>
<field name="res_model">yuthon.property.lessee</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
+137 -98
View File
@@ -6,33 +6,16 @@
<field name="arch" type="xml">
<tree string="物业管理">
<header>
<button name="put_change_title" string="提交产权变更审批" type="object"/>
<button name="put_change_manage" string="提交管理变更审批" type="object"/>
<button name="put_property_handover" string="提交物业移交审批" type="object"/>
</header>
<field name="name" required="1"/>
<field name="premises"/>
<field name="units"/>
<field name="house_type_id" optional="hide"/>
<field name="property_room" optional="hide"/>
<field name="building_area" optional="hide"/>
<field name="actual_area" optional="hide"/>
<field name="management_area" optional="hide"/>
<field name="effective_date" optional="hide"/>
<field name="property_source" optional="hide"/>
<field name="property_floor" optional="hide"/>
<field name="property_orientation" optional="hide"/>
<field name="street" optional="hide"/>
<field name="property_area"/>
<field name="pooled_area"/>
<field name="rentable_area"/>
<field name="owner_id"/>
<field name="state"/>
<field name="start_time"/>
<field name="end_date"/>
<field name="state_id"/>
<field name="is_meter"/>
<field name="is_electricity_meter"/>
</tree>
</field>
</record>
<record id="yuthon_property_form" model="ir.ui.view">
<field name="name">yuthon.property.form</field>
<field name="model">yuthon.property</field>
@@ -50,14 +33,14 @@
<field name="actual_area"/>
<field name="management_area"/>
<field name="effective_date"/>
<field name="property_source"/>
<field name="end_date"/>
<field name="remark"/>
<field name="vr_link"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<group>
<field name="image_1920" widget="image" class="oe_avatar"
optional="{'preview_image': 'image_128'}"/>
optional="{'preview_image': 'image_128'}"/>
<field name="abbreviation"/>
<field name="property_floor"/>
<field name="property_orientation"/>
@@ -65,29 +48,29 @@
<field name="property_area"/>
<field name="pooled_area"/>
<field name="rentable_area"/>
<field name="end_date"/>
<field name="state_id"/>
<field name="property_source"/>
<field name="state" readonly="1"/>
<field name="is_meter"/>
<field name="is_electricity_meter"/>
</group>
</group>
<group string="属性价值" col="2">
<group>
<field name="company_page"/>
<field name="admin_id"/>
<field name="purpose_id"/>
<field name="mgmt_type_id"/>
<field name="is_confirm_authorization"/>
<field name="owner_id"/>
<field name="property_card"/>
</group>
<group>
<field name="property_precinct"/>
<field name="asset_type_id"/>
<field name="is_hvac"/>
<field name="is_handle_land"/>
</group>
<group>
<field name="company_page"/>
<field name="admin_id"/>
<field name="purpose_id"/>
<field name="mgmt_type_id"/>
<field name="is_confirm_authorization"/>
<field name="owner_id"/>
<field name="property_card"/>
</group>
<group>
<field name="property_precinct"/>
<field name="asset_type_id"/>
<field name="is_hvac"/>
<field name="is_handle_land"/>
</group>
</group>
<group col="2">
<group>
<field name="life_timer"/>
@@ -102,21 +85,60 @@
<field name="decoration_type"/>
</group>
</group>
<notebook>
<page string="产权信息">
<field name="title_information_ids">
<tree editable="bottom">
<field name="yuthon_property_id" column_invisible="1"/>
<field name="address"/>
<field name="equity_area"/>
<field name="management_area"/>
<field name="building_area"/>
<field name="rent_area"/>
<field name="owner"/>
<field name="title_certificate"/>
<field name="start_time"/>
<field name="end_date"/>
</tree>
</field>
</page>
<page string="管理信息">
<field name="manage_information_ids">
<tree editable="bottom">
<field name="yuthon_property_id" column_invisible="1"/>
<field name="purpose_id"/>
<field name="precinct"/>
<field name="admin_id"/>
<field name="company_page"/>
<field name="start_time"/>
<field name="end_date"/>
</tree>
</field>
</page>
<page string="拆合信息">
<field name="disassembly_information_ids">
<tree editable="bottom">
<field name="yuthon_property_id" column_invisible="1"/>
<field name="property_name"/>
<field name="rent_area"/>
<field name="start_time"/>
<field name="end_date"/>
</tree>
</field>
</page>
<page string="水表列表" invisible="is_meter == False">
<field name="water_meter_ids">
<tree editable="bottom">
<field name="yuthon_property_id" column_invisible="1"/>
<field name="property_meter_water_id"/>
<field name="code"/>
<field name="rate"/>
<field name="standard"/>
<field name="installation_date"/>
<field name="demolition_date"/>
<field name="location"/>
</tree>
</field>
<field name="water_meter_ids">
<tree editable="bottom">
<field name="yuthon_property_id" column_invisible="1"/>
<field name="property_meter_water_id"/>
<field name="code"/>
<field name="rate"/>
<field name="standard"/>
<field name="installation_date"/>
<field name="demolition_date"/>
<field name="location"/>
</tree>
</field>
</page>
<page string="电表列表" invisible="is_electricity_meter == False">
<field name="energy_meter_ids">
@@ -134,12 +156,6 @@
</page>
</notebook>
</sheet>
<div class="o_attachment_preview"/>
<div class="oe_chatter">
<field name="message_follower_ids" groups="base.group_user"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
@@ -153,7 +169,7 @@
<field name="property_precinct" string="片区"/>
<separator/>
<group expand="0">
<filter name="group_statu" string="物业状态" context="{'group_by': 'state_id'}"/>
<filter name="group_statu" string="物业状态" context="{'group_by': 'state'}"/>
<filter name="group_purpose" string="资产用途" context="{'group_by': 'purpose_id'}"/>
</group>
</search>
@@ -166,8 +182,6 @@
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<!-- <field name="lst_price"/>-->
<!-- <field name="activity_state"/>-->
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
@@ -194,20 +208,7 @@
<field name="admin_id"/>
</div>
</div>
<!-- <field name="priority" widget="priority"/>-->
</div>
<!-- <t t-if="record.default_code.value">[<field name="default_code"/>]-->
<!-- </t>-->
<!-- <div class="o_kanban_tags_section">-->
<!-- <field name="product_template_variant_value_ids"-->
<!-- groups="product.group_product_variant" widget="many2many_tags"-->
<!-- optional="{'color_field': 'color'}"/>-->
<!-- </div>-->
<!-- <div name="product_lst_price" class="mt-1">-->
<!-- Price:-->
<!-- <field name="lst_price"></field>-->
<!-- </div>-->
<div name="tags"/>
</div>
</div>
@@ -222,36 +223,74 @@
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="yuthon_property_search"/>
</record>
<record id="view_yuthon_property_water_tree" model="ir.ui.view">
<field name="name">yuthon.property.water.tree</field>
<field name="model">yuthon.property.water</field>
<!--待评估-->
<record id="yuthon_property_view_tree2" model="ir.ui.view">
<field name="name">yuthon_property_tree2</field>
<field name="model">yuthon.property</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="code"/>
<field name="rate"/>
<field name="standard"/>
<field name="installation_date"/>
<field name="demolition_date"/>
<field name="location"/>
<tree>
<header>
<button name="put_assessment_approval" type="object" string="提交评估申请"/>
</header>
<field name="name"/>
<field name="owner_id"/>
<field name="property_room"/>
<field name="property_area"/>
<field name="rentable_area"/>
<field name="unit_price"/>
<field name="current_status" optional="hide"/>
<field name="registered_use" optional="hide"/>
<field name="purpose_id"/>
<field name="rental_conditions" optional="hide"/>
<field name="district_manager" optional="hide"/>
<field name="company_page" optional="show"/>
<field name="remarks" optional="hide"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_yuthon_property_energy_tree" model="ir.ui.view">
<field name="name">yuthon.property.energy.tree</field>
<field name="model">yuthon.property.energy</field>
<record id="yuthon_property_view_form2" model="ir.ui.view">
<field name="name">yuthon_property_form2</field>
<field name="model">yuthon.property</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="code"/>
<field name="rate"/>
<field name="standard"/>
<field name="installation_date"/>
<field name="demolition_date"/>
<field name="location"/>
</tree>
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="owner_id"/>
<field name="property_area"/>
<field name="property_room"/>
<field name="rentable_area"/>
<field name="unit_price"/>
</group>
<group>
<field name="current_status"/>
<field name="registered_use"/>
<field name="purpose_id"/>
<field name="district_manager"/>
<field name="company_page"/>
<field name="state" readonly="1"/>
</group>
</group>
<group>
<field name="rental_conditions"/>
<field name="remarks"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="yuthon_on_property_action" model="ir.actions.act_window">
<field name="name">待评估物业</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">yuthon.property</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','to')]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property.yuthon_property_view_tree2')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property.yuthon_property_view_form2')})]"/>
</record>
</odoo>
@@ -76,4 +76,19 @@
<field name="view_mode">tree</field>
</record>
<record id="view_yuthon_property_source_tree" model="ir.ui.view">
<field name="name">yuthon.property.source.tree</field>
<field name="model">yuthon.property.source</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="name"/>
</tree>
</field>
</record>
<record id="yuthon_property_source_action" model="ir.actions.act_window">
<field name="name">物业来源</field>
<field name="res_model">yuthon.property.source</field>
<field name="view_mode">tree</field>
</record>
</odoo>
+2 -1
View File
@@ -1 +1,2 @@
from . import models
from . import models
from . import wizard
+4 -2
View File
@@ -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': [],
@@ -189,6 +189,13 @@
<field name="padding">3</field>
</record>
<record id="property_handover_sequence" model="ir.sequence">
<field name="name">物业移交审批编号</field>
<field name="code">property_handover_code</field>
<field name="prefix">XZ%(y)s%(month)s%(day)s</field>
<field name="padding">3</field>
</record>
<record id="property_contract_changes_sequence" model="ir.sequence">
<field name="name">物业合同变更编号</field>
<field name="code">property_contract_changes_code</field>
+4 -3
View File
@@ -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
from . import property_construction_work
from . import property_evaluate_application
from . import property_approval
from . import property_handover
@@ -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")
@@ -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="评估类别")
@@ -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')],
@@ -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")
@@ -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
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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
23 access_property_open_rent property_open_rent model_property_open_rent base.group_user 1 1 1 1
24 access_property_confirm property_confirm model_property_confirm base.group_user 1 1 1 1
25 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
26 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
27 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
28 access_property_information_detail_lines property_information_detail_lines model_property_information_detail_lines base.group_user 1 1 1 1
29 access_property_lease_contract_line property_lease_contract_line model_property_lease_contract_line base.group_user 1 1 1 1
30 access_property_rent_breakdown_line property_rent_breakdown_line model_property_rent_breakdown_line base.group_user 1 1 1 1
36 access_property_repair_relief_line property_repair_relief_line model_property_repair_relief_line base.group_user 1 1 1 1
37 access_property_contract_changes property_contract_changes model_property_contract_changes base.group_user 1 1 1 1
38 access_property_construction_work property_construction_work model_property_construction_work base.group_user 1 1 1 1
39 access_property_eligibility_line property_eligibility_line model_property_eligibility_line base.group_user 1 1 1 1
40 access_property_evaluate_application property_evaluate_application model_property_evaluate_application base.group_user 1 1 1 1
41 access_property_approval property_approval model_property_approval base.group_user 1 1 1 1
42 access_property_approval_line property_approval_line model_property_approval_line base.group_user 1 1 1 1
43 access_property_handover property_handover model_property_handover base.group_user 1 1 1 1
44 access_property_handover_line property_handover_line model_property_handover_line base.group_user 1 1 1 1
45 access_property_inducts_wizard property_inducts_wizard model_property_inducts_wizard base.group_user 1 1 1 1
@@ -26,36 +26,40 @@
</div>
<group col="2">
<group>
<field name="property_documents_ids" widget="many2many_tags"/>
<field name="code"/>
</group>
<group>
<field name="source"/>
<field name="source"/>
</group>
</group>
<group>
<field name="property_documents_ids" widget="many2many_tags"/>
</group>
<group>
<field name="tip_description" type="html"/>
</group>
<group>
<field name="property_massage_ids">
<tree editable="bottom">
<field name="property_approval_id" column_invisible="1"/>
<field name="property_address"/>
<field name="is_affirmation"/>
<field name="owner"/>
<field name="title_number"/>
<field name="area"/>
<field name="purposes"/>
<field name="state"/>
</tree>
</field>
</group>
</sheet>
</form>
</field>
</record>
<record id="property_approval_action" model="ir.actions.act_window">
<notebook>
<page string="审批信息">
<button name="put_message_in" string="导入" type="object" class="oe_highlight"/>
<field name="property_massage_ids" string=" ">
<tree editable="bottom">
<field name="property_approval_id" column_invisible="1"/>
<field name="property_address"/>
<field name="is_affirmation"/>
<field name="owner"/>
<field name="title_number"/>
<field name="area"/>
<field name="purposes"/>
<field name="state"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="property_approval_action" model="ir.actions.act_window">
<field name="name">新增物业审批</field>
<field name="res_model">property.approval</field>
<field name="view_mode">tree,form</field>
@@ -7,7 +7,6 @@
<tree string="评估申请">
<field name="name"/>
<field name="code"/>
<field name="is_meet"/>
<field name="is_experts"/>
</tree>
</field>
@@ -18,15 +17,18 @@
<field name="arch" type="xml">
<form string="评估申请">
<sheet>
<group col="3">
<div class="col-12 text-center">
<h1>
<field name="name"/>
</h1>
</div>
<group col="2">
<group>
<field name="code"/>
</group>
<group>
<field name="is_meet"/>
</group>
<group>
<field name="is_experts"/>
<field name="is_meet" invisible="1"/>
<field name="is_experts"/>
</group>
</group>
<group string="审批事项">
@@ -36,15 +38,15 @@
</group>
<notebook>
<page string="评估项目详情">
<field name="property_message_ids">
<field name="yuthon_property_ids">
<tree editable="bottom">
<field name="property_message_id" column_invisible="1"/>
<field name="property_address" string="评估资产"/>
<field name="name" string="评估资产"/>
<field name="rentable_area" string="评估面积m²"/>
<field name="assessment_category" string="评估类别"/>
<field name="owner"/>
<field name="owner_id"/>
<field name="registered_use"/>
<field name="rental_use" string="设定用途"/>
<field name="purpose_id" string="设定用途"/>
<field name="current_status"/>
<field name="unit_price" string="上一手历史租金单价" help="(元/m².月)"/>
<field name="rental_conditions" string="出租条件"/>
@@ -57,6 +59,9 @@
</tree>
</field>
</page>
<page string="关联议题" invisible="not is_meet">
<field name="issue_library_id"/>
</page>
</notebook>
</sheet>
</form>
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_property_handover_tree" model="ir.ui.view">
<field name="name">property.handover.tree</field>
<field name="model">property.handover</field>
<field name="arch" type="xml">
<tree string="移交审批">
<field name="name"/>
<field name="code"/>
<field name="source"/>
</tree>
</field>
</record>
<record id="view_property_handover_form" model="ir.ui.view">
<field name="name">property.handover.form</field>
<field name="model">property.handover</field>
<field name="arch" type="xml">
<form string="移交审批">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" required="1"/>
</h1>
</div>
<group col="2">
<group>
<field name="code"/>
</group>
<group>
<field name="source"/>
</group>
</group>
<group>
<field name="property_documents_ids" widget="many2many_tags"/>
</group>
<group>
<field name="tip_description" type="html"/>
</group>
<group>
<field name="property_handover_ids">
<tree editable="bottom">
<field name="property_handover_id" column_invisible="1"/>
<field name="property_id" string="物业信息"/>
<field name="property_address"/>
<field name="is_affirmation"/>
<field name="owner"/>
<field name="title_number"/>
<field name="area"/>
<field name="purposes"/>
<field name="state"/>
</tree>
</field>
</group>
</sheet>
</form>
</field>
</record>
<record id="property_handover_action" model="ir.actions.act_window">
<field name="name">移交审批</field>
<field name="res_model">property.handover</field>
<field name="view_mode">tree,form</field>
</record>
</odoo>
@@ -2,177 +2,184 @@
<odoo>
<menuitem
id="property_approval_menu"
parent="yuthon_property.property_approval_menu"
name="新增物业审批"
action="property_approval_action"
sequence="19"/>
id="property_approval_menu"
parent="yuthon_property.resource_management_menu"
name="新增物业审批"
action="property_approval_action"
sequence="3"/>
<menuitem
id="property_billing_confirmation_menu"
parent="yuthon_property.property_approval_menu"
name="账单确认单审批"
action="property_billing_confirmation_action"
sequence="20"/>
id="property_billing_confirmation_menu"
parent="yuthon_property.property_approval_menu"
name="账单确认单审批"
action="property_billing_confirmation_action"
sequence="20"/>
<menuitem
id="property_business_confirm_menu"
parent="yuthon_property.property_approval_menu"
name="经营报表确认单审批"
action="property_business_confirm_action"
sequence="21"/>
id="property_business_confirm_menu"
parent="yuthon_property.property_approval_menu"
name="经营报表确认单审批"
action="property_business_confirm_action"
sequence="21"/>
<menuitem
id="property_capacity_menu"
parent="yuthon_property.property_approval_menu"
name="增容审批"
action="property_capacity_action"
sequence="22"/>
id="property_capacity_menu"
parent="yuthon_property.property_approval_menu"
name="增容审批"
action="property_capacity_action"
sequence="22"/>
<menuitem
id="property_early_quitting_menu"
parent="yuthon_property.property_approval_menu"
name="提前退租审批"
action="property_early_quitting_action"
sequence="24"/>
id="property_early_quitting_menu"
parent="yuthon_property.property_approval_menu"
name="提前退租审批"
action="property_early_quitting_action"
sequence="24"/>
<menuitem
id="property_fitment_menu"
parent="yuthon_property.property_approval_menu"
name="装修审批"
action="property_fitment_action"
sequence="26"/>
id="property_fitment_menu"
parent="yuthon_property.property_approval_menu"
name="装修审批"
action="property_fitment_action"
sequence="26"/>
<menuitem
id="property_inventory_table_menu"
parent="yuthon_property.property_approval_menu"
name="盘点表审批"
action="property_inventory_table_action"
sequence="27"/>
id="property_inventory_table_menu"
parent="yuthon_property.property_approval_menu"
name="盘点表审批"
action="property_inventory_table_action"
sequence="27"/>
<menuitem
id="property_information_menu"
parent="yuthon_property.property_approval_menu"
name="物业信息审批"
action="property_information_action"
sequence="28"/>
id="property_information_menu"
parent="yuthon_property.property_approval_menu"
name="物业信息审批"
action="property_information_action"
sequence="28"/>
<menuitem
id="property_lease_alter_menu"
parent="yuthon_property.property_approval_menu"
name="续租审批审批"
action="property_lease_alter_action"
sequence="29"/>
id="property_lease_alter_menu"
parent="yuthon_property.property_approval_menu"
name="续租审批审批"
action="property_lease_alter_action"
sequence="29"/>
<menuitem
id="property_lease_contract_menu"
parent="yuthon_property.property_approval_menu"
name="租赁合同审批"
action="property_lease_contract_action"
sequence="30"/>
id="property_lease_contract_menu"
parent="yuthon_property.property_approval_menu"
name="租赁合同审批"
action="property_lease_contract_action"
sequence="30"/>
<menuitem
id="property_lease_extension_menu"
parent="yuthon_property.property_approval_menu"
name="延租审批"
action="property_lease_extension_action"
sequence="31"/>
id="property_lease_extension_menu"
parent="yuthon_property.property_approval_menu"
name="延租审批"
action="property_lease_extension_action"
sequence="31"/>
<menuitem
id="property_lease_renewal_menu"
parent="yuthon_property.property_approval_menu"
name="租赁合同变更审批"
action="property_lease_renewal_action"
sequence="32"/>
id="property_lease_renewal_menu"
parent="yuthon_property.property_approval_menu"
name="租赁合同变更审批"
action="property_lease_renewal_action"
sequence="32"/>
<menuitem
id="property_management_menu"
parent="yuthon_property.property_approval_menu"
name="物业管理变更申请表"
action="property_management_action"
sequence="33"/>
id="property_management_menu"
parent="yuthon_property.property_approval_menu"
name="物业管理变更申请表"
action="property_management_action"
sequence="33"/>
<menuitem
id="property_management_fee_menu"
parent="yuthon_property.property_approval_menu"
name="管理费审批"
action="property_management_fee_action"
sequence="34"/>
id="property_management_fee_menu"
parent="yuthon_property.property_approval_menu"
name="管理费审批"
action="property_management_fee_action"
sequence="34"/>
<menuitem
id="property_material_procurement_menu"
parent="yuthon_property.property_approval_menu"
name="物资配件采购单审批"
action="property_material_procurement_action"
sequence="35"/>
id="property_material_procurement_menu"
parent="yuthon_property.property_approval_menu"
name="物资配件采购单审批"
action="property_material_procurement_action"
sequence="35"/>
<menuitem
id="property_penalty_proportion_menu"
parent="yuthon_property.property_approval_menu"
name="违约金比例审批"
action="property_penalty_proportion_action"
sequence="36"/>
id="property_penalty_proportion_menu"
parent="yuthon_property.property_approval_menu"
name="违约金比例审批"
action="property_penalty_proportion_action"
sequence="36"/>
<menuitem
id="property_penalty_relief_menu"
parent="yuthon_property.property_approval_menu"
name="违约金减免审批"
action="property_penalty_relief_action"
sequence="37"/>
id="property_penalty_relief_menu"
parent="yuthon_property.property_approval_menu"
name="违约金减免审批"
action="property_penalty_relief_action"
sequence="37"/>
<menuitem
id="property_rent_relief_menu"
parent="yuthon_property.property_approval_menu"
name="租金减免审批"
action="property_rent_relief_action"
sequence="38"/>
id="property_rent_relief_menu"
parent="yuthon_property.property_approval_menu"
name="租金减免审批"
action="property_rent_relief_action"
sequence="38"/>
<menuitem
id="property_report_repair_menu"
parent="yuthon_property.property_approval_menu"
name="报事报修审批"
action="property_report_repair_action"
sequence="39"/>
id="property_report_repair_menu"
parent="yuthon_property.property_approval_menu"
name="报事报修审批"
action="property_report_repair_action"
sequence="39"/>
<menuitem
id="property_utility_bills_menu"
parent="yuthon_property.property_approval_menu"
name="水电费审批"
action="property_utility_bills_action"
sequence="40"/>
id="property_utility_bills_menu"
parent="yuthon_property.property_approval_menu"
name="水电费审批"
action="property_utility_bills_action"
sequence="40"/>
<menuitem
id="property_equity_approval_menu"
parent="yuthon_property.property_approval_menu"
name="物业产权变更"
action="property_equity_action"
sequence="41"/>
id="property_equity_approval_menu"
parent="yuthon_property.property_approval_menu"
name="物业产权变更"
action="property_equity_action"
sequence="41"/>
<menuitem
id="property_renamed_approval_menu"
parent="yuthon_property.property_approval_menu"
name="更名申请表"
action="property_renamed_action"
sequence="42"/>
<!-- <menuitem-->
<!-- id="property_contract_changes_menu"-->
<!-- parent="yuthon_property.property_approval_menu"-->
<!-- name="租聘合同变更审批"-->
<!-- action="action_property_contract_changes"-->
<!-- sequence="43"/>-->
id="property_renamed_approval_menu"
parent="yuthon_property.property_approval_menu"
name="更名申请表"
action="property_renamed_action"
sequence="42"/>
<!-- <menuitem-->
<!-- id="property_contract_changes_menu"-->
<!-- parent="yuthon_property.property_approval_menu"-->
<!-- name="租聘合同变更审批"-->
<!-- action="action_property_contract_changes"-->
<!-- sequence="43"/>-->
<menuitem
id="property_construction_work_menu"
parent="yuthon_property.property_approval_menu"
name="建设工程审批"
action="action_property_construction_work"
sequence="44"/>
id="property_construction_work_menu"
parent="yuthon_property.property_approval_menu"
name="建设工程审批"
action="action_property_construction_work"
sequence="44"/>
<menuitem
id="property_open_rent_approval_menu"
parent="yuthon_property.property_approval_menu"
name="公开招租审批"
action="property_open_rent_action"
sequence="4"/>
id="property_handover_approval_menu"
parent="yuthon_property.resource_management_menu"
name="物业移交审批"
action="property_handover_action"
sequence="7"/>
<menuitem
id="property_open_rent_approval_menu"
parent="yuthon_property.property_approval_menu"
name="公开招租审批"
action="property_open_rent_action"
sequence="4"/>
<menuitem
id="property_confirm_approval_menu"
@@ -181,25 +188,24 @@
action="property_confirm_action"
sequence="5"/>
<menuitem
id="property_move_approval_menu"
parent="yuthon_property.property_approval_menu"
name="调拨审批"
action="property_move_action"
sequence="1"/>
<menuitem
id="property_assess_approval_menu"
parent="yuthon_property.property_approval_menu"
name="评估审批"
action="property_assess_action"
sequence="2"/>
parent="yuthon_property.yuthon_property_menu"
name="评估申请"
action="property_evaluate_application_action"
sequence="7"/>
<menuitem
id="property_record_approval_menu"
parent="yuthon_property.property_approval_menu"
name="备案审批"
parent="yuthon_property.yuthon_property_menu"
name="备案申请"
action="property_record_action"
sequence="3"/>
sequence="9"/>
<menuitem
id="property_special_approval_menu"
parent="yuthon_property.yuthon_property_menu"
name="专项审批"
action="property_record_action"
sequence="11"/>
</odoo>
@@ -26,7 +26,7 @@
<group>
<group>
<field name="code"/>
<field name="property_documents_ids">
<field name="property_documents_ids" widget="many2many_tags">
<tree>
<field name="name"/>
</tree>
@@ -48,12 +48,12 @@
</page>
</notebook>
</sheet>
<div class="o_attachment_preview"/>
<div class="oe_chatter">
<field name="message_follower_ids" groups="base.group_user"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
<!-- <div class="o_attachment_preview"/>-->
<!-- <div class="oe_chatter">-->
<!-- <field name="message_follower_ids" groups="base.group_user"/>-->
<!-- <field name="activity_ids"/>-->
<!-- <field name="message_ids"/>-->
<!-- </div>-->
</form>
</field>
</record>
@@ -0,0 +1 @@
from . import property_inducts_wizard
@@ -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
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="user_template_downloads_tian_he_action" model="ir.actions.act_url">
<field name="name">物业信息模板下载</field>
<field name="target">self</field>
<field name="url">...</field>
</record>
<record id="property_inducts_wizard_form" model="ir.ui.view">
<field name="name">物业信息导入弹窗</field>
<field name="model">property.inducts.wizard</field>
<field name="arch" type="xml">
<form>
<sheet>
<header>
<button name="%(user_template_downloads_tian_he_action)d" string="模板下载" type="action"
class="btn btn-primary"/>
</header>
<group>
<group>
<field name="excel_file" filename="excel_name"/>
<field name="excel_name" invisible="1"/>
</group>
<group>
</group>
</group>
</sheet>
<footer>
<button name="confirm" string="确认" type="object" class="oe_highlight"/>
<button string="返回" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
</odoo>