添加功能

This commit is contained in:
zhou
2025-01-21 15:58:51 +08:00
parent 10c433cc4e
commit 3417077f73
51 changed files with 641 additions and 197 deletions
@@ -21,6 +21,9 @@
<header>
<field name="statu" widget="statusbar"/>
</header>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<sheet>
<div class="oe_title">
<label for="name"/>
@@ -28,9 +31,6 @@
<field name="name" required="1"/>
</h1>
</div>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group>
<group>
<field name="reference_cold"/>
-1
View File
@@ -22,7 +22,6 @@
'views/yuthon_expert_database_views.xml',
'views/yuthon_property_message_views.xml',
'views/yuthon_precinct_message_views.xml',
'views/property_transaction_confirmed.xml',
'views/yuthon_resource_mgmt_config_views.xml',
'views/property_message_fee_views.xml',
'views/property_meter_archives_views.xml',
-1
View File
@@ -8,7 +8,6 @@ from . import yuthon_resource_mgmt_config
from . import yuthon_draw_result
from . import yuthon_expert_database
from . import yuthon_property_evaluation
from . import property_transaction_confirmed
from . import property_meter_archives
from . import property_meter_water
from . import property_assess
@@ -29,3 +29,6 @@ class PropertyMeterReading(models.Model):
code = fields.Char(string="Code")
current_meter = fields.Float(string='本次')
class PropertyTransactionConfirmed(models.Model):
_name = 'property.transaction.confirmed'
@@ -1,15 +0,0 @@
from odoo import models, fields, api, exceptions, _
from datetime import datetime
from odoo.exceptions import UserError, ValidationError
class PropertyTransactionConfirmed(models.Model):
_name = 'property.transaction.confirmed'
_description = '成交确认书'
name = fields.Char(string='标题')
property_id = fields.Char(string='物业') #后续many2many字段
lessee = fields.Char(string='承租人')
entity_type = fields.Selection([('person', '个人'), ('enterprise', '企业')], string='实体类型')
details = fields.Text(string='详情') #这里可以完善承租方信息,为租赁合同服务
@@ -14,7 +14,6 @@ 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_transaction_confirmed,property_transaction_confirmed,model_property_transaction_confirmed,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_title_information_line,title_information_line,model_title_information_line,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
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_transaction_confirmed property_transaction_confirmed model_property_transaction_confirmed base.group_user 1 1 1 1
17 access_property_meter_archives property_meter_archives model_property_meter_archives base.group_user 1 1 1 1
18 access_property_meter_water property_meter_water model_property_meter_water base.group_user 1 1 1 1
19 access_title_information_line title_information_line model_title_information_line base.group_user 1 1 1 1
-6
View File
@@ -55,12 +55,6 @@
name="招租"
parent="yuthon_property_menu_root"/>
<menuitem id="yuthon_property_confirmation_of_transaction_menu"
sequence="5"
name="成交确认书"
parent="yuthon_property_menu_data"
action="action_property_transaction_confirmed"/>
<menuitem id="yuthon_customer_management_menu"
sequence="8"
name="客户管理"
+3 -1
View File
@@ -54,13 +54,15 @@
'views/property_project_works_viwes.xml',
'views/property_sporadic_works_views.xml',
'views/property_delegated_agent_views.xml',
'views/property_transaction_confirmed.xml',
'wizard/property_add_wizard_views.xml',
'wizard/property_contract_wizard.xml',
'wizard/choose_contract_wizard_views.xml',
'wizard/property_rental_wizard_views.xml',
'views/property_menu_all.xml',
],
'demo': [],
'depends': ['mail', 'soong_workflow', 'documents', 'yuthon_property', 'hr'],
'depends': ['mail', 'soong_workflow', 'documents', 'yuthon_property', 'hr', 'yuthon_issue'],
'installable': True,
'application': True,
}
@@ -259,4 +259,14 @@
<field name="code">property_delegated_agent_code</field>
<field name="prefix">LS%(y)s%(month)s%(day)s</field>
</record>
<record id="property_record_sequence" model="ir.sequence">
<field name="name">物业备案编号</field>
<field name="code">property_record_code</field>
<field name="prefix">BA%(y)s%(month)s%(day)s</field>
</record>
<record id="property_transaction_confirmed_sequence" model="ir.sequence">
<field name="name">交易确认编号</field>
<field name="code">property_transaction_confirmed_code</field>
<field name="prefix">JY%(y)s%(month)s%(day)s</field>
</record>
</odoo>
@@ -34,6 +34,7 @@ from . import property_offline_registration
from . import property_rental_form
from . import property_rental_conditions
from . import property_merge_approval
from . import property_transaction_confirmed
from . import property_split_approval
from . import property_intention_approval
from . import property_transfer_approval
@@ -2,6 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyApproval(models.Model):
@@ -11,8 +12,12 @@ class PropertyApproval(models.Model):
name = fields.Char(string='标题')
tip_description = fields.Html('正文')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_approval_code'))
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
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="审批信息")
@@ -21,11 +26,52 @@ class PropertyApproval(models.Model):
return {
"type": "ir.actions.act_window",
"name": "批量更新物业信息",
"res_model": "property.inducts.wizard",
"res_model": "property.add.wizard",
"view_mode": "form",
"target": "new",
"context": {
'default_property_approval_id': self.id
}
}
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
# 审批触发按钮
def button_property_approval(self):
for massage_id in self.property_massage_ids:
property_message_id = self.env['yuthon.property.message'].search([('name', '=', massage_id.property_address)])
if not property_message_id:
property_message_id = self.env['yuthon.property.message'].create({
'name': massage_id.property_address,
'owner_id': massage_id.owner_id.id,
'equity_area': massage_id.area,
'title_certificate': massage_id.title_number,
'registered_id': massage_id.registered_id.id,
})
property_id = self.env['yuthon.property'].create({
'name': massage_id.property_address,
'is_confirm_authorization': massage_id.is_affirmation,
})
self.env['title.information.line'].create({
'yuthon_property_id': property_id.id,
'property_message_id': property_message_id.id,
})
class PropertyApprovalLine(models.Model):
_name = 'property.approval.line'
_description = '新增物业审批明细行'
@@ -33,9 +79,9 @@ class PropertyApprovalLine(models.Model):
property_approval_id = fields.Many2one('property.approval', string="审批信息")
property_address = fields.Text(string="物业地址")
is_affirmation = fields.Boolean(string="是否确权")
owner = fields.Char(string="权属人")
owner_id = fields.Many2one('yuthon.owner.message', string="权属人")
title_number = fields.Char(string="产权编号")
area = fields.Float(string="面积")
purposes = fields.Char(string="用途")
state = fields.Selection([('rental', '出租中'), ('vacant', '空置中'), ('rented', '待出租')], string="状态",
registered_id = fields.Many2one('yuthon.purpose.evidence', string='用途')
condition = fields.Selection([('rental', '出租中'), ('vacant', '空置中'), ('rented', '待出租')], string="状态",
default="rented")
@@ -13,10 +13,30 @@ class PropertyCapacity(models.Model):
name = fields.Char(string='标题')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_capacity_code'))
address = fields.Char(string="地址")
lessee = fields.Char(string="承租方")
address_id = fields.Many2one('yuthon.property', string="物业地址")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one('hr.department', string="部门", related='users_id.employee_id.department_id')
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
contact = fields.Char(string="联系人")
phone = fields.Char(string="联系电话")
#增容类型
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
is_water = fields.Boolean(string="水")
is_electricity = fields.Boolean(string="电")
is_electricity = fields.Boolean(string="电")
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
@@ -2,6 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyEarlyQuitting(models.Model):
@@ -14,6 +15,8 @@ class PropertyEarlyQuitting(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_early_quitting_code'))
property_documents_ids = fields.Many2many('ir.attachment', string="提前退租文件")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
lessee_id = fields.Many2one(related='address_id.lessee_id', string="承租方")
address_id = fields.Many2one('yuthon.property', string="物业地址")
start_data = fields.Date(string="合同开始日期")
@@ -21,9 +24,28 @@ class PropertyEarlyQuitting(models.Model):
early_quitting_date = fields.Date(string="提前退租日期")
original_contract_id = fields.Many2one('ir.attachment', string="合同")
contract_id = fields.Many2one('property.lease.contract', string="合同")
reason = fields.Char(string="退租原因")
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
reason = fields.Text(string="退租原因")
def button_approval(self):
for rec in self:
rec.contract_id.write({
'actual_end_time': rec.new_end_date})
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
@@ -1,4 +1,5 @@
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
class PropertyEvaluateApplication(models.Model):
@@ -11,7 +12,10 @@ class PropertyEvaluateApplication(models.Model):
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="是否上会")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
is_experts = fields.Boolean(string="是否需要专家评审")
notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
issue_library_id = fields.Many2one('issue.library', string='关联议题')
@@ -41,6 +45,23 @@ class PropertyEvaluateApplication(models.Model):
}
}
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class EvaluateApplicationLine(models.Model):
_name = 'evaluate.application.line'
_description = '物业信息明细行'
@@ -1,4 +1,5 @@
from odoo import models, fields, api, exceptions
from odoo.exceptions import UserError, ValidationError
class PropertyHandover(models.Model):
@@ -8,12 +9,34 @@ class PropertyHandover(models.Model):
name = fields.Char(string='标题')
tip_description = fields.Html('正文')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_handover_code'))
property_documents_ids = fields.Many2many('documents.document', string="附件")
source = fields.Char(string="移交单位")
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
property_handover_ids = fields.One2many('property.handover.line', 'property_handover_id', string="移交申请")
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class PropertyHandoverLine(models.Model):
_name = 'property.handover.line'
_description = '移交申请明细'
@@ -2,6 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyLeaseExtension(models.Model):
@@ -11,6 +12,9 @@ class PropertyLeaseExtension(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
reason = fields.Html(string="正文")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_lease_extension_code'))
property_documents_ids = fields.Many2many('ir.attachment', string="延租文件")
@@ -21,8 +25,27 @@ class PropertyLeaseExtension(models.Model):
end_date = fields.Date(string="原到期时间")
new_end_date = fields.Date(string="延期至")
reason_extension = fields.Char(string="延期原因")
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
def button_approval(self):
for rec in self:
rec.contract_id.write({
'actual_end_time': rec.new_end_date})
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
@@ -11,11 +11,14 @@ class PropertyManagementFee(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_management_fee_code'))
property_documents_ids = fields.Many2many('documents.document', string="管理费整理材料")
start_date = fields.Date(string="生效日期")
#类型
is_water_fee = fields.Boolean(string="水费")
is_electricity_fee = fields.Boolean(string="电费")
@@ -1,4 +1,5 @@
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyMergeApproval(models.Model):
@@ -9,6 +10,8 @@ class PropertyMergeApproval(models.Model):
name = fields.Char(string='标题')
reason = fields.Html(string="正文")
notice_documents_ids = fields.Many2many('ir.attachment', string="附件")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_merge_approval_code'))
property_merge_approval_line_ids = fields.One2many('property.merge.approval.line', 'property_merge_approval_id', string='关联物业合并审批行')
@@ -53,6 +56,23 @@ class PropertyMergeApproval(models.Model):
'property_id': record.property_id.id}])
property_id.write({'disassembly_information_ids': property_list})
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class PropertyMergeApprovalLine(models.Model):
_name = 'property.merge.approval.line'
@@ -1,12 +1,16 @@
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
class PropertyOfflineRegistration(models.Model):
_name = 'property.offline.registration'
_description = '线下意向承租方报名表'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].
next_by_code('property_offline_registration_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
property_id = fields.Many2one('yuthon.property',string='物业名称')
address = fields.Char(related='property_id.name',string='物业地址')
area = fields.Float(related='property_id.rent_area',string='面积(m²)')
@@ -21,12 +25,30 @@ class PropertyOfflineRegistration(models.Model):
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class QuoteMessageLine(models.Model):
_name = 'quote.message.line'
_description = '报价信息明细行'
property_offline_registration_id = fields.Many2one('property.offline.registration', string='关联线下报表表')
name = fields.Char(string='客户名称', required=True)
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
start_data = fields.Date(string="报价日期")
lease = fields.Char(string='租期')
quote = fields.Float(string='报价(元/m²)')
@@ -11,6 +11,8 @@ class PropertyPenaltyProportion(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_penalty_proportion_code'))
calculate_time_point = fields.Char(string='违约金计算时间点')
@@ -2,6 +2,8 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyPenaltyRelief(models.Model):
_name = 'property.penalty.relief'
@@ -10,16 +12,36 @@ class PropertyPenaltyRelief(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
reason = fields.Html(string="正文")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one('hr.department', string="部门", related='users_id.employee_id.department_id')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_rent_relief_code'))
property_documents_ids = fields.Many2many('documents.document', string="违约金减免文件")
reason_abatement = fields.Char(string="减免原因")
contract_id = fields.Many2one('documents.document', string="合同")
lessee = fields.Char(string="承租方")
property_name = fields.Char(string="物业名称")
contract_id = fields.Many2one('property.lease.contract', string="合同")
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
property_id = fields.Many2one('yuthon.property', string='物业')
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
penalty_relief_line_ids = fields.One2many('property.penalty.relief.line', 'penalty_relief_id', string="违约金列表")
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class PropertyPenaltyReliefLine(models.Model):
_name = 'property.penalty.relief.line'
@@ -2,6 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyRecord(models.Model):
@@ -11,15 +12,38 @@ class PropertyRecord(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_record_code'))
other_company_id = fields.Many2one('res.company', string="评估单位")
evaluation_code = fields.Char(string="评估编号")
evaluation_way = fields.Char(string='评估方法')
base_date = fields.Date(string="基准日")
is_issues = fields.Boolean(string='是否上会')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
expert_review_time = fields.Date(string="专家评审时间")
notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
evaluate_application_ids = fields.One2many('evaluated.application.line', 'yuthon_property_evaluated_id',
string='关联物业信息明细行')
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class EvaluatedApplicationLine(models.Model):
_name = 'evaluated.application.line'
_description = '物业信息明细行(已评估)'
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, exceptions, _
from odoo.exceptions import UserError, ValidationError
class PropertyRentRelief(models.Model):
_name = 'property.rent.relief'
@@ -10,16 +11,38 @@ class PropertyRentRelief(models.Model):
_rec_name = 'name'
name = fields.Char(string='标题')
reason = fields.Html(string="正文")
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_penalty_relief_code'))
contract_id = fields.Many2one('documents.document', string="合同")
lessee = fields.Char(string="承租方")
property_name = fields.Char(string="物业名称")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
contract_id = fields.Many2one('property.lease.contract', string="合同")
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
property_id = fields.Many2one('yuthon.property', string='物业')
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
abatement_reason = fields.Text(string="减免原因")
property_documents_ids = fields.Many2many('documents.document', string="减免材料")
property_documents_ids = fields.Many2many('ir.document', string="附件")
property_rent_relief_ids = fields.One2many('property.rent.relief.line', 'property_rent_relief_id', string="租金列表")
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
class PropertyRentReliefLine(models.Model):
_name = 'property.rent.relief.line'
_description = '租金列表'
@@ -6,7 +6,8 @@ class PropertyRentalConditions(models.Model):
_description = '出租调整表'
property_id = fields.Many2one('yuthon.property',string='物业名称')
address = fields.Char(related='property_id.name',string='物业地址')
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].
next_by_code('property_rental_conditions_code'))
registered_id = fields.Many2one(related='property_id.registered_id',string='证载用途')
@@ -5,8 +5,13 @@ class PropertyRentalForm(models.Model):
_name = 'property.rental.form'
_description = '出租申报表'
_rec_name = 'name'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
name = fields.Char(string="名称", required=True)
reason = fields.Html(string="正文")
documents_ids = fields.Many2many('ir.attachment', string="附件")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
property_rental_form_line_ids = fields.One2many('property.rental.form.line', 'property_rental_form_id', string="关联出租申报表明细行")
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
@@ -20,7 +25,6 @@ class PropertyRentalFormLine(models.Model):
property_rental_form_id = fields.Many2one('property.rental.form', string="关联出租申报表")
property_id = fields.Many2one('yuthon.property', string='物业名称', required=True)
property_address = fields.Char(related='property_id.name', string='物业地址')
registered_id = fields.Many2one(related='property_id.registered_id', string='证载用途')
evaluation_area = fields.Float(related='property_id.evaluation_area', string='出租面积(m²)')
current_status = fields.Date(related='property_id.current_status', string='租聘到期日')
@@ -0,0 +1,40 @@
from odoo import models, fields, api, exceptions, _
from datetime import datetime
from odoo.exceptions import UserError, ValidationError
class PropertyTransactionConfirmed(models.Model):
_name = 'property.transaction.confirmed'
_description = '成交确认书'
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
name = fields.Char(string='标题')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_transaction_confirmed_code'))
property_ids = fields.Many2many('yuthon.property', string='物业') #后续many2many字段
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
entity_type = fields.Selection([('person', '个人'), ('enterprise', '企业')], string='实体类型')
details = fields.Text(string='详情') #这里可以完善承租方信息,为租赁合同服务
reason = fields.Html(string="正文")
documents_ids = fields.Many2many('ir.attachment', string="附件")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
is_issues = fields.Boolean(string='是否上会')
related_issues_id = fields.Many2one('issue.library', string="关联议题")
@api.onchange('is_issues')
def _onchange_is_issues(self):
if self.is_issues:
issue_id = self.env['issue.library'].create({'name': self.name})
self.related_issues_id = issue_id.id
workflow_record_id = self.env["soong.workflow.record"].search(
[("res_model", "=", self._name), ("res_id", "=", self.id)])
self.env['issue.library.approval.line'].create({
'issue_library_id': issue_id.id,
'workflow_record_id': workflow_record_id.id,
'approval_type': workflow_record_id.workflow_id.id,
'code': self.code,
'approval_date': fields.Datetime.now(),
})
elif self.related_issues_id:
raise UserError("已经创建了相关的上会记录,不能取消勾选")
@@ -65,6 +65,8 @@ access_property_sporadic_works,property_sporadic_works,model_property_sporadic_w
access_payment_methods_line,payment.methods.line,model_payment_methods_line,base.group_user,1,1,1,1
access_property_project_works,property_project_works,model_property_project_works,base.group_user,1,1,1,1
access_property_delegated_agent,property_delegated_agent,model_property_delegated_agent,base.group_user,1,1,1,1
access_property_transaction_confirmed,property_transaction_confirmed,model_property_transaction_confirmed,base.group_user,1,1,1,1
access_property_add_wizard,property_add_wizard,model_property_add_wizard,base.group_user,1,1,1,1
access_property_contract_line,property_contract_line,model_property_contract_line,base.group_user,1,1,1,1
access_choose_property_wizard,choose_property_wizard,model_choose_property_wizard,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
65 access_payment_methods_line payment.methods.line model_payment_methods_line base.group_user 1 1 1 1
66 access_property_project_works property_project_works model_property_project_works base.group_user 1 1 1 1
67 access_property_delegated_agent property_delegated_agent model_property_delegated_agent base.group_user 1 1 1 1
68 access_property_transaction_confirmed property_transaction_confirmed model_property_transaction_confirmed base.group_user 1 1 1 1
69 access_property_add_wizard property_add_wizard model_property_add_wizard base.group_user 1 1 1 1
70 access_property_contract_line property_contract_line model_property_contract_line base.group_user 1 1 1 1
71 access_choose_property_wizard choose_property_wizard model_choose_property_wizard base.group_user 1 1 1 1
72 access_property_rental_wizard property_rental_wizard model_property_rental_wizard base.group_user 1 1 1 1
@@ -18,22 +18,22 @@
<field name="arch" type="xml">
<form string="新增物业审批">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<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"/>
<field name="source"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="property_documents_ids" widget="preview_many2many"/>
</group>
<group>
<field name="tip_description" type="html"/>
@@ -46,11 +46,11 @@
<field name="property_approval_id" column_invisible="1"/>
<field name="property_address"/>
<field name="is_affirmation"/>
<field name="owner"/>
<field name="owner_id"/>
<field name="title_number"/>
<field name="area"/>
<field name="purposes"/>
<field name="state"/>
<field name="registered_id"/>
<field name="condition"/>
</tree>
</field>
</page>
@@ -16,6 +16,9 @@
<field name="arch" type="xml">
<form string="增容审批">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<div class="oe_title">
<label for="name"/>
<h1>
@@ -24,12 +27,13 @@
</div>
<group col="2">
<group>
<field name="code"/>
<field name="lessee"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="lessee_id"/>
<field name="phone"/>
</group>
<group>
<field name="address"/>
<field name="address_id"/>
<field name="contact"/>
</group>
</group>
@@ -6,7 +6,9 @@
<field name="arch" type="xml">
<tree string="提前退租审批">
<field name="name"/>
<field name="code"/>
<field name="address_id"/>
<field name="early_quitting_date"/>
<field name="start_data"/>
</tree>
</field>
</record>
@@ -17,26 +19,29 @@
<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="3">
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="name"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="contract_id" widget="preview_many2one"/>
<field name="property_documents_ids" widget="preview_many2many"/>
</group>
<group col="3" string="出租信息">
<group>
<field name="code"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="address_id"/>
<field name="start_data"/>
<field name="reason"/>
<field name="property_documents_ids" widget="preview_many2many"/>
</group>
<group>
<field name="lessee_id"/>
<field name="end_data"/>
<field name="contract_id" widget="preview_many2one"/>
</group>
<group>
<field name="address_id"/>
<field name="early_quitting_date"/>
</group>
</group>
@@ -44,7 +49,6 @@
</form>
</field>
</record>
<record id="property_early_quitting_action" model="ir.actions.act_window">
<field name="name">提前退租审批</field>
<field name="res_model">property.early.quitting</field>
@@ -22,19 +22,15 @@
<group string="审批事项">
<field name="name" required="1"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<group col="2" string="个人信息">
<group>
<field name="users_id"/>
<field name="department_id"/>
<field name="sincerity_gold"/>
<field name="yuthon_company" invisible="1"/>
</group>
<group>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
</group>
<group string="个人信息">
<field name="users_id"/>
<field name="department_id"/>
<field name="sincerity_gold"/>
<field name="yuthon_company" invisible="1"/>
</group>
<notebook>
<page string="承租方列表">
@@ -26,11 +26,14 @@
<group string="审批事项">
<field name="name" required="1"/>
<field name="main_text"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<group>
<field name="is_meet" invisible="1"/>
<field name="is_experts"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="is_experts"/>
</group>
<notebook>
<page string="评估项目详情">
@@ -56,9 +59,6 @@
</tree>
</field>
</page>
<page string="关联议题" invisible="not is_meet">
<field name="issue_library_id"/>
</page>
</notebook>
</sheet>
</form>
@@ -18,22 +18,22 @@
<field name="arch" type="xml">
<form string="移交审批">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<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"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="source"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="property_documents_ids" widget="preview_many2many"/>
</group>
<group>
<field name="tip_description" type="html"/>
@@ -23,18 +23,14 @@
<group string="审批事项">
<field name="name" required="1"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<group col="2" string="个人信息">
<group>
<field name="users_id"/>
<field name="department_id"/>
<field name="yuthon_company" invisible="1"/>
</group>
<group>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
</group>
<group string="个人信息">
<field name="users_id"/>
<field name="department_id"/>
<field name="yuthon_company" invisible="1"/>
</group>
<notebook>
<page string="意向客户信息">
@@ -6,7 +6,9 @@
<field name="arch" type="xml">
<tree string="续租审批">
<field name="name"/>
<field name="code"/>
<field name="address_id"/>
<field name="contract_id"/>
<field name="new_end_date"/>
</tree>
</field>
</record>
@@ -17,25 +19,29 @@
<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="3">
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="name"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="original_contract_id" widget="preview_many2one"/>
<field name="property_documents_ids" widget="preview_many2many"/>
</group>
<group col="3" string="物业信息">
<group>
<field name="code"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="address_id"/>
<field name="new_end_date"/>
<field name="original_contract_id" widget="preview_many2one"/>
</group>
<group>
<group>
<field name="lessee_id"/>
<field name="contract_id"/>
<field name="property_documents_ids" widget="preview_many2many"/>
</group>
<group>
<field name="address_id"/>
<field name="end_date"/>
<field name="reason_extension"/>
</group>
@@ -17,6 +17,9 @@
<field name="arch" type="xml">
<form string="管理费审批">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<div class="oe_title">
<label for="name"/>
<h1>
@@ -25,7 +28,8 @@
</div>
<group>
<group>
<field name="code"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="start_date"/>
</group>
</group>
@@ -162,8 +162,14 @@
parent="yuthon_property.yuthon_property_menu_data"
action="property_offline_registration_action"/>
<menuitem id="property_rental_conditions_menu"
<menuitem id="yuthon_property_confirmation_of_transaction_menu"
sequence="5"
name="成交确认书"
parent="yuthon_property.yuthon_property_menu_data"
action="action_property_transaction_confirmed"/>
<menuitem id="property_rental_conditions_menu"
sequence="10"
name="出租条件调整表"
parent="yuthon_property.yuthon_property_menu_data"
action="property_rental_conditions_action"/>
@@ -26,9 +26,12 @@
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="name"/>
<field name="reason"/>
<field name="is_issues" invisible="1"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<notebook>
@@ -19,17 +19,20 @@
<field name="arch" type="xml">
<form string="线下承租方报名表">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="招租信息" col="3">
<group>
<field name="property_id"/>
<field name="monthly_rent"/>
<field name="contract_years"/>
<field name="area"/>
<field name="is_issues" invisible="1"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
</group>
<group>
<field name="code"/>
<field name="increment_rate"/>
<field name="area"/>
<field name="start_data"/>
</group>
<group>
@@ -43,7 +46,7 @@
<field name="quote_message_line_ids">
<tree editable="bottom">
<field name="property_offline_registration_id" column_invisible="1"/>
<field name="name"/>
<field name="lessee_id"/>
<field name="start_data"/>
<field name="lease"/>
<field name="quote"/>
@@ -17,6 +17,9 @@
<field name="arch" type="xml">
<form string="违约金比例审批">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<div class="oe_title">
<label for="name"/>
<h1>
@@ -25,7 +28,8 @@
</div>
<group>
<group>
<field name="code"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="calculate_time_point"/>
<field name="percentage_damages"/>
<field name="date_payment"/>
@@ -17,21 +17,22 @@
<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"/>
<field name="lessee"/>
</group>
<group>
<field name="contract_id"/>
<field name="property_name"/>
</group>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="name"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="1"/>
<field name="property_documents_ids" widget="many2many_tags"/>
</group>
<group string="物业信息">
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="lessee_id"/>
<field name="contract_id"/>
<field name="property_id"/>
</group>
<notebook>
<page string="违约金列表">
@@ -47,8 +48,9 @@
</field>
</page>
</notebook>
<field name="property_documents_ids" string="违约金减免文件" widget="many2many_tags"/>
<field name="reason_abatement"/>
<group>
<field name="reason_abatement"/>
</group>
</sheet>
</form>
</field>
@@ -20,6 +20,9 @@
<field name="arch" type="xml">
<form string="评估备案">
<sheet>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<div class="oe_title">
<label for="name"/>
<h1>
@@ -28,6 +31,8 @@
</div>
<group col="3">
<group>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="other_company_id"/>
<field name="base_date"/>
</group>
@@ -40,6 +45,8 @@
</group>
</group>
<group>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<notebook>
@@ -6,7 +6,9 @@
<field name="arch" type="xml">
<tree string="租金减免审批">
<field name="name"/>
<field name="code"/>
<field name="property_id"/>
<field name="lessee_id"/>
<field name="contract_id"/>
</tree>
</field>
</record>
@@ -17,22 +19,24 @@
<field name="arch" type="xml">
<form string="租金减免审批">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name" required="1"/>
</h1>
</div>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="name"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="1"/>
<field name="property_documents_ids" widget="many2many_tags"/>
</group>
<group col="2">
<group>
<field name="code"/>
<field name="property_id"/>
<field name="abatement_reason"/>
<field name="property_name"/>
</group>
<group>
<field name="contract_id"/>
<field name="lessee"/>
<field name="property_documents_ids" widget="many2many_tags"/>
<field name="lessee_id"/>
</group>
</group>
<notebook>
@@ -20,22 +20,22 @@
<field name="arch" type="xml">
<form string="出租条件调整">
<sheet>
<div class="oe_title">
<label for="property_id"/>
<h1>
<field name="property_id"/>
</h1>
</div>
<group>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="物业信息" col="3">
<group>
<field name="address"/>
<field name="property_id"/>
<field name="code"/>
<field name="lease_expiration_date"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
</group>
<group>
<field name="registered_id"/>
<field name="evaluation_area"/>
<field name="is_issues" invisible="1"/>
<field name="related_issues_id" invisible="not is_issues"/>
</group>
<group>
<field name="now_rent_price"/>
@@ -16,14 +16,17 @@
<field name="arch" type="xml">
<form string="出租申报表">
<sheet>
<div class="oe_title">
<label for="name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<field name="is_issues" invisible="1"/>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="name"/>
<field name="reason"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
<notebook>
<page string="出租申报表">
@@ -31,19 +34,18 @@
<tree editable="bottom">
<field name="property_rental_form_id" column_invisible="1"/>
<field name="property_id"/>
<field name="property_address"/>
<field name="registered_id"/>
<field name="evaluation_area"/>
<field name="registered_id" optional="hide"/>
<field name="evaluation_area" optional="hide"/>
<field name="current_status"/>
<field name="now_rent_price"/>
<field name="now_rent_price" optional="hide"/>
<field name="evaluate_rent_price"/>
<field name="upset_square"/>
<field name="upset"/>
<field name="upset" optional="hide"/>
<field name="lease_period"/>
<field name="increment_rate"/>
<field name="rental_use"/>
<field name="other"/>
<field name="remarks"/>
<field name="increment_rate" optional="hide"/>
<field name="rental_use" optional="hide"/>
<field name="other" optional="hide"/>
<field name="remarks" optional="hide"/>
</tree>
</field>
</page>
@@ -29,6 +29,7 @@
<field name="name"/>
<field name="reason"/>
<field name="is_issues" invisible="1"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="notice_documents_ids" widget="preview_many2many"/>
</group>
<group col="2" string="物业信息">
@@ -6,8 +6,7 @@
<field name="arch" type="xml">
<tree string="成交确认书">
<field name="name"/>
<field name="property_id"/>
<field name="lessee"/>
<field name="lessee_id"/>
<field name="entity_type"/>
</tree>
</field>
@@ -18,14 +17,19 @@
<field name="arch" type="xml">
<form string="成交确认书">
<sheet>
<div class="col-12 text-center">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<field name="property_id"/>
<field name="lessee"/>
<field name="code" readonly="1" string="流水号:"/>
</group>
<group string="审批事项">
<field name="name"/>
<field name="reason"/>
<field name="is_issues"/>
<field name="related_issues_id" invisible="not is_issues"/>
<field name="documents_ids" widget="preview_many2many"/>
</group>
<group string="物业信息">
<field name="property_ids" widget="many2many_tags"/>
<field name="lessee_id"/>
<field name="entity_type"/>
<field name="details"/>
</group>
@@ -6,8 +6,9 @@
<field name="arch" type="xml">
<tree string="物业移交">
<field name="name"/>
<field name="code"/>
<field name="users_id"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>
</field>
</record>
@@ -1,3 +1,4 @@
from . import property_contract_wizard
from . import choose_property_wizard
from . import property_rental_wizard
from . import property_add_wizard
@@ -0,0 +1,51 @@
from odoo import models, fields, api, _, SUPERUSER_ID
from odoo.exceptions import ValidationError, UserError
import xlrd
import base64
import datetime
from datetime import datetime
import pandas as pd
class PropertyAddWizard(models.Model):
_name = 'property.add.wizard'
excel_file = fields.Binary(string="上传Excel表")
property_approval_id = fields.Many2one('property.approval', string="新增物业审批")
excel_name = fields.Char(string="文件名")
def confirm(self):
"""
导入excel文件,按行读取数据并处理
"""
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.yuthon_property_add_data(row)
def yuthon_property_add_data(self, row):
name = row[0].value
is_affirmation = row[1].value
owner_id = self.env['yuthon.owner.message'].search([('name', '=', row[2].value)])
title_number = row[3].value
rent_area = row[4].value
condition_data = {'出租中': 'rental', '空置中': 'vacant', '待出租': 'rented'}
condition = condition_data.get(row[6].value)
registered_id = self.env['yuthon.purpose.evidence'].search([('name', '=', row[5].value)])
if not registered_id:
self.env['yuthon.purpose.evidence'].create({'name': row[5].value})
approval_list =[]
approval_list.append({
'property_approval_id': self.property_approval_id.id,
'name': name,
'is_affirmation': is_affirmation,
'owner': owner_id.id,
'title_number': title_number,
'area': rent_area,
'condition': condition,
'registered_id':registered_id.id,
})
self.env['yuthon.property.approval.line'].create(approval_list)
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="property_add_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_add_wizard_form" model="ir.ui.view">
<field name="name">薪资物业合同</field>
<field name="model">property.add.wizard</field>
<field name="arch" type="xml">
<form>
<sheet>
<header>
<button name="%(property_add_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>