!5570 添加功能

Merge pull request !5570 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-10-11 09:23:00 +00:00
committed by Gitee
12 changed files with 82 additions and 49 deletions
@@ -62,7 +62,7 @@
<field name="arch" type="xml">
<tree string="流程查询" action="open_record" type="object"
decoration-danger="approve_state == 'end'" delete="false"
create="false" default_order="write_date2 desc, id desc" expand="1">
create="false" default_order="write_date2 desc, id desc" expand="1" limit="15">
<header>
<button name="admin_end" type="object" string="管理员强制结束" class="oe_highlight" groups="soong_workflow.group_soong_workflow_manager"/>
<button name="delete_record" type="object" string="删除" class="oe_highlight" groups="soong_workflow.group_soong_workflow_manager"/>
@@ -141,7 +141,7 @@
<field name="arch" type="xml">
<tree string="工作流回收站" action="open_record" type="object"
decoration-muted="approve_state == 'end'" decoration-warning="approve_state != 'end'"
create="false" default_order="write_date2 desc">
create="false" default_order="write_date2 desc" limit="15">
<field name="name"/>
<field name="workflow_id" string="审批类型"/>
<field name="node_id" string="当前节点"/>
@@ -60,27 +60,28 @@
</group>
<group/>
</group>
<group col="4">
<group col="3">
<group>
<label for="start_time"/>
<div class="d-inline-flex w-100">
<field name="start_time" string="开始日期" class="me-2"
style="max-width: 17rem !important;"/>
style="max-width: 25rem !important;"/>
<field name="start_week" string=" " class="ms-2"
style="max-width: 5rem !important;"/>
</div>
<label for="end_time"/>
<div class="d-inline-flex w-100">
<field name="end_time" string="结束日期" class="me-2"
style="max-width: 17rem !important;" required="1"/>
style="max-width: 25rem !important;" required="1"/>
<field name="end_week" string=" " class="ms-2"
style="max-width: 5rem !important;"/>
</div>
<field name="type_overtime"/>
</group>
<group>
<button name="open_record" type="object" string="考勤查验" class="oe_highlight"/>
</group>
<group/>
<!-- <group>-->
<!-- <button name="open_record" type="object" string="考勤查验" class="oe_highlight"/>-->
<!-- </group>-->
<group/>
</group>
<group col="2">
@@ -489,7 +489,7 @@
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="replace">
<tree string="员工列表" banner_route="/employee/banner/route">
<tree string="员工列表" banner_route="/employee/banner/route" limit="15">
<header>
</header>
<field name="name"/>
+9 -9
View File
@@ -56,16 +56,16 @@ class YuthonProperty(models.Model):
rental_unit_price = fields.Float(string="评估单价")
title_number = fields.Char(string="产权编号")
suite_area = fields.Float(string="套内面积", digits=(16, 4))
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型", compute="_compute_information_fields", store=True)
admin_id = fields.Many2one('res.users', string="片区管理员", compute="_compute_information_fields", store=True)
purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型", compute="compute_information_fields", store=True)
admin_id = fields.Many2one('res.users', string="片区管理员", compute="compute_information_fields", store=True)
lessee_id = fields.Many2one('property.tenant.information', string='承租方')
title_address = fields.Many2one('yuthon.property.message', string="产权地址", compute="_compute_title_information_fields", store=True)
company_id = fields.Many2one('yuthon.property.company', string="公司", compute="_compute_information_fields", store=True)
company_id = fields.Many2one('yuthon.property.company', string="公司", compute="compute_information_fields", store=True)
rental_address = fields.Text(string="出租地址")
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型', compute="_compute_information_fields", store=True)
tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型', compute="compute_information_fields", store=True)
ame = fields.Char(string='标题')
management_area = fields.Float(string="管理面积", digits=(16, 4), compute="_compute_information_fields", store=True)
rent_area = fields.Float(string="可租面积", digits=(16, 4), compute="_compute_information_fields", store=True)
management_area = fields.Float(string="管理面积", digits=(16, 4), compute="compute_information_fields", store=True)
rent_area = fields.Float(string="可租面积", digits=(16, 4), compute="compute_information_fields", store=True)
equity_area = fields.Float(string="产权面积", group_operator=None, digits=(16, 4), compute="_compute_title_information_fields", store=True)
decoration_type = fields.Selection([('blank', '毛坯'), ('hardcover', '精装'), ('brands', '简装'), ('rsz', '豪装')],
string="装修类型")
@@ -155,7 +155,7 @@ class YuthonProperty(models.Model):
'manage_information_ids.rent_area', 'manage_information_ids.admin_id',
'manage_information_ids.purpose_id',
'manage_information_ids.company_id')
def _compute_information_fields(self):
def compute_information_fields(self):
for rec in self:
if rec.manage_information_ids:
latest_info = rec.manage_information_ids.sorted('start_time', reverse=True)[0]
@@ -226,7 +226,7 @@ class YuthonProperty(models.Model):
evaluation_asset = fields.Char(string='评估资产')
evaluation_area = fields.Float(string='评估面积(m²)')
evaluation_category = fields.Char(string='评估类别')
precinct_id = fields.Many2one('yuthon.precinct.message', string="所属片区", compute="_compute_information_fields", store=True)
precinct_id = fields.Many2one('yuthon.precinct.message', string="所属片区", compute="compute_information_fields", store=True)
last_hand_rent_price = fields.Float(string='上一手历史租金单价(元/m²•月)')
gov_rent_price = fields.Float(string='政府租金参考价')
evaluation_rent_price = fields.Float(string='评估散租单价(元/m²•月)')
@@ -238,7 +238,7 @@ class YuthonProperty(models.Model):
property_ids = self.env["yuthon.property"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for rec in property_ids:
rec._compute_information_fields()
rec.compute_information_fields()
def put_declare_approval(self):
@@ -4,7 +4,7 @@
<field name="name">property.management.list.tree</field>
<field name="model">property.management.list</field>
<field name="arch" type="xml">
<tree editable="bottom" string="管理费列表" edit="false" delete="false">
<tree editable="bottom" string="管理费列表" edit="false" delete="false" limit="15">
<field name="lessee_id" options="{'no_create': True}"/>
<field name="property_id" options="{'no_create': True}"/>
<field name="area"/>
@@ -351,10 +351,13 @@ class PropertyLeaseContract(models.Model):
contract_ids = self.env["property.lease.contract"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for rec in contract_ids:
if rec.lease_ids[0].address_id.asset_type_id.name == '广告位':
contract_sort = 'ads'
elif rec.lease_ids[0].address_id.asset_type_id.name == '管子间':
contract_sort = 'guan'
if rec.lease_ids:
if rec.lease_ids[0].address_id.asset_type_id.name == '广告位':
contract_sort = 'ads'
elif rec.lease_ids[0].address_id.asset_type_id.name == '管子间':
contract_sort = 'guan'
else:
contract_sort = 'property'
else:
contract_sort = 'property'
rec.write({'contract_sort': contract_sort})
@@ -80,25 +80,9 @@ class PropertyManagement(models.Model):
def approval_end(self):
for record in self:
for line in record.management_line2_ids:
# 准备要更新的字段值,只包含存在的值
property_values = {}
if record.company_id:
property_values['company_id'] = record.company_id.id
if record.precinct_id:
property_values['precinct_id'] = record.precinct_id.id
if record.admin_id_all:
property_values['admin_id'] = record.admin_id_all.id
if record.tenure_type:
property_values['tenure_type'] = record.tenure_type
if record.purpose_id:
property_values['purpose_id'] = record.purpose_id.id
# 更新物业记录
if property_values:
line.property_id.write(property_values)
# 更新信息行的结束日期
if line.information_line_id:
line.information_line_id.write({'end_date': fields.Date.today()})
# 直接从关联的上一条记录获取值(如果存在)
prev_info = line.information_line_id
# 创建新的信息行记录,从prev_info获取缺失的值
@@ -109,20 +93,15 @@ class PropertyManagement(models.Model):
'management_area': prev_info.management_area if prev_info else 0.0,
'tenure_type': record.tenure_type or prev_info.tenure_type,
'rent_area': prev_info.rent_area if prev_info else 0.0,
'admin_id': record.admin_id_all.id if record.admin_id_all else prev_info.admin_id.id,
'admin_id': record.precinct_id.employee_id.user_id.id if record.precinct_id else prev_info.admin_id.id,
'company_id': record.company_id.id if record.company_id else prev_info.company_id.id if prev_info else False,
'start_time': record.start_time,
}
prev_info.end_date = record.start_time - timedelta(days=1)
# 创建新记录
self.env['manage.information.line'].create(info_line_vals)
contract = self.env['property.lease.contract.line'].search(
[('address_id', '=', line.property_id.id)],
limit=1
)
if contract:
lease_id = contract.lease_id
lease_id.write({'admin_id': record.admin_id_all.id})
line.property_id.compute_information_fields()
record.write({'is_line': True})
def put_property_management(self):
@@ -294,7 +294,7 @@
<field name="name">管理费列表</field>
<field name="res_model">property.management.list</field>
<field name="view_mode">tree,search</field>
<field name="domain">[('is_push', '=', False)]</field>
<field name="domain">[('is_push', '=', False),('area', '!=', False)]</field>
<field name="context">{'search_default_group_admin_id': True, 'search_default_group_due_date': True}</field>
</record>
<!--应收账单 -->
@@ -794,6 +794,36 @@
</search>
</field>
</record>
<record id="property_my_lease_contract_search" model="ir.ui.view">
<field name="name">property.my.lease.contract.search</field>
<field name="model">property.lease.contract</field>
<field name="arch" type="xml">
<search>
<field name="name"
string="综合搜索"
filter_domain="['|', '|', ('property_name', 'ilike', self), ('contract_code', 'ilike', self), ('lessee_id.name', 'ilike', self)]"/>
<field name="lessee_id"/>
<field name="contract_code"/>
<field name="property_name"/>
<group expand="0" string="Group By">
<filter name="group_by_condition" context="{'group_by': 'condition'}"/>
<filter name="group_by_lessee_id" context="{'group_by': 'lessee_id'}"/>
<filter name="group_by_lessor_id" context="{'group_by': 'lessor_id'}"/>
<filter name="group_by_admin_id" context="{'group_by': 'admin_id'}"/>
<filter name="group_by_title_address" context="{'group_by': 'title_address'}"/>
</group>
<header_search>
<quick_filter string="状态">
<filter string="待执行" name="to" domain="[('contact_state', '=', 'to')]" />
<filter string="已执行" name="complete" domain="[('contact_state', '=', 'complete')]" />
<filter string="已作废" name="done" domain="[('contact_state', '=', 'terminate')]"/>
<filter string="历史" name="early" domain="[('contact_state', '=', 'early_termination')]"/>
<filter string="即将到期" name="reclaim" domain="[('expiration_coming', '=', 'coming')]"/>
</quick_filter>
</header_search>
</search>
</field>
</record>
<!-- 已租面积报表 -->
<record id="yuthon_property_rented_area_report" model="ir.ui.view">
<field name="name">yuthon.property.rented.area.report</field>
@@ -858,6 +888,17 @@
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_approval.view_property_lease_contract_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_approval.view_property_lease_contract_form')})]"/>
</record>
<record id="property_my_lease_contract_action" model="ir.actions.act_window">
<field name="name">我的合同</field>
<field name="res_model">property.lease.contract</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('admin_id', '=', uid)]</field>
<field name="context">{'search_default_group_by_admin_id': True}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_approval.view_property_lease_contract_tree1')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_approval.view_property_lease_contract_form1')})]"/>
<field name="search_view_id" ref="yuthon_property_approval.property_my_lease_contract_search"/>
</record>
<record id="all_data_write_property_contract" model="ir.actions.server">
<field name="name">批量导入合同</field>
<field name="model_id" ref="yuthon_property_approval.model_property_lease_contract"/>
@@ -227,11 +227,16 @@
parent="yuthon_property_customer_process_management"
action="property_eligibility_action"/>
<!-- 合同 -->
<menuitem id="property_my_lease_contract_approval_menu"
parent="yuthon_property.yuthon_property_estate_menu"
name="我的合同"
action="property_my_lease_contract_action"
sequence="1"/>
<menuitem id="property_lease_contract_approval_menu"
parent="yuthon_property.yuthon_property_estate_menu"
name="合同审批"
action="property_lease_contract_action"
sequence="1"/>
sequence="2"/>
<menuitem id="property_lease_contract_management_menu"
parent="yuthon_property.yuthon_property_estate_menu"
name="合同管理"
@@ -246,6 +246,7 @@ class PropertyRentalWizard(models.Model):
records = self.env['property.lease.contract'].search([
('actual_start_time', '<=', last_day),
('actual_end_time', '>=', first_day),
('contract_code', '=', '(租)(管)TX2019-121')
])
filtered_records = [
rec for rec in records
@@ -245,6 +245,7 @@
<field name="arch" type="xml">
<tree string="薪资审定">
<header>
<button name="action_refresh_from_work_entries" string="重新计算" type="object" class="oe_highlight"/>
<button name="all_put_release" type="object" string="推送" class="oe_highlight"/>
</header>
<field name="employee_id" string="姓名" readonly="1" options="{'no_open': True}"/>
@@ -315,6 +316,7 @@
<field name="arch" type="xml">
<tree string="薪资审定">
<header>
<button name="action_refresh_from_work_entries" string="重新计算" type="object" class="oe_highlight"/>
<button name="all_put_release" type="object" string="推送" class="oe_highlight"/>
</header>
<field name="employee_id" string="姓名" readonly="1" options="{'no_open': True}"/>
@@ -372,6 +374,7 @@
<field name="arch" type="xml">
<tree string="薪资审定">
<header>
<button name="action_refresh_from_work_entries" string="重新计算" type="object" class="oe_highlight"/>
<button name="all_put_release" type="object" string="推送" class="oe_highlight"/>
</header>
<field name="employee_id" string="姓名" readonly="1" options="{'no_open': True}"/>