168 lines
9.6 KiB
XML
168 lines
9.6 KiB
XML
<odoo>
|
|
<record id="estate_property_model_action" model="ir.actions.act_window">
|
|
<field name="name">房地产信息</field>
|
|
<field name="res_model">estate.property</field>
|
|
<field name="view_mode">tree,form,kanban</field>
|
|
<field name="context">{}</field>
|
|
</record>
|
|
<!-- 列表视图配置 -->
|
|
<record id="estate_property_view_tree" model="ir.ui.view">
|
|
<field name="name">estate.property.tree</field>
|
|
<field name="model">estate.property</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="房地产列表" decoration-danger="state == 'canceled'" decoration-success="state in ['offer_received', 'offer_accepted']" decoration-bf="state == 'offer_accepted'" decoration-muted="state == 'sold'"
|
|
default_order="create_date_month desc">
|
|
<field name="state" />
|
|
<field name="name" string="房产名称" width="600px" />
|
|
<field name="expected_price" string="预期价格" />
|
|
<field name="selling_price" string="成交价格" />
|
|
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" context="{'open_form_view': 'estate.estate_property_tag_view_form02'}"/>
|
|
<field name="bedrooms" string="卧室数" />
|
|
<field name="living_area" string="面积(㎡)" />
|
|
<field name="state" string="状态" />
|
|
<field name="date_availability" string="可用日期" optional="True" />
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<!-- 表单视图配置 -->
|
|
<record id="view_estate_property_form_custom" model="ir.ui.view">
|
|
<field name="name">estate.property.form.custom</field>
|
|
<field name="model">estate.property</field>
|
|
<field name="arch" type="xml">
|
|
<form string="房地产信息" class="estate_form">
|
|
<header>
|
|
<field name="state" widget="statusbar" statusbar_visible="new,offer_received,offer_accepted,sold,canceled" statusbar_colors='{"sold":"success","canceled":"danger"}' class="oe_statusbar_buttons" />
|
|
<!-- 标记已售按钮 -->
|
|
<button name="action_sold" type="object" string="标记已售" class="oe_highlight" confirm="确认完成交易?" invisible="state in ['sold','canceled']" domain="[('state','=','offer_accepted')]">
|
|
<field name="state" invisible="1" />
|
|
</button>
|
|
<!-- 取消交易按钮 -->
|
|
<button name="action_cancel" type="object" string="取消交易" class="oe_unlink" confirm="确认取消该交易?" invisible="state in ['sold','canceled']" domain="[('state','!=','canceled')]">
|
|
<field name="state" invisible="1" />
|
|
</button>
|
|
</header>
|
|
<sheet>
|
|
<!-- 标题 -->
|
|
<div class="oe_title">
|
|
<h1 style="font-size:24px; font-weight:700; color:#1E90FF; margin-bottom:12px;">
|
|
<field name="name"/>
|
|
</h1>
|
|
</div>
|
|
<div class="o_row" style="margin-top: 20px;">
|
|
<!-- 房屋报价 -->
|
|
<div class="o_box" style="flex:1; margin-right:10px; padding:15px; border:1px solid #ddd; border-radius:6px;">
|
|
<h3 style="border-bottom:2px solid #4CAF50; padding-bottom:6px; margin-bottom:12px; font-weight:600; color:#333;">📑 房屋报价</h3>
|
|
<field name="offer_ids" context="{'default_property_id': id}" options="{'no_create': True, 'no_open': True}" readonly='state in ["offer_accepted","sold","canceled"]' />
|
|
</div>
|
|
</div>
|
|
<!-- 两栏布局:基础信息 + 费用信息 -->
|
|
<div class="o_row" style="margin-top: 20px; display:flex; align-items:stretch;">
|
|
<!-- 基础信息 -->
|
|
<div class="o_box" style="flex:1; margin-right:10px; padding:15px; border:1px solid #ddd; border-radius:6px; display:flex; flex-direction:column;">
|
|
<h3 style="border-bottom:2px solid #2196F3; padding-bottom:6px; margin-bottom:12px; font-weight:600; color:#333;">📅 基础信息</h3>
|
|
<group col="2" style="flex:1;">
|
|
<field name="postcode" placeholder="6位邮政编码" />
|
|
<field name="date_availability" widget="daterange" options="{'endDateField': 'date_availability'}" />
|
|
<field name="property_type_id" options="{'no_create': True, 'no_open': True}" />
|
|
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" />
|
|
<field name="garage" widget="boolean_toggle" options='{"terminology": {"active": "有车库","inactive": "无车库"}}' />
|
|
<field name="active" widget="boolean_toggle" options='{"terminology": {"active": "可用","inactive": "不可用"}}' />
|
|
<field name="garden" />
|
|
<field name="garden_orientation" widget="selection_badge" options="{'horizontal': True, 'max_items': 4}" invisible="not garden" />
|
|
</group>
|
|
</div>
|
|
<!-- 费用信息 -->
|
|
<div class="o_box" style="flex:2; margin-left:10px; padding:15px; border:1px solid #ddd; border-radius:6px; display:flex; flex-direction:column;">
|
|
<h3 style="border-bottom:2px solid #FF9800; padding-bottom:6px; margin-bottom:12px; font-weight:600; color:#333;">💰 费用信息</h3>
|
|
<group col="2" style="flex:1;">
|
|
<field name="bedrooms" default="2" />
|
|
<field name="living_area" string="面积(㎡)" />
|
|
<field name="garden_area" invisible="not garden" />
|
|
<field name="facades" />
|
|
<field name="seller_id" string="销售专员" />
|
|
<field name="buyer_id" string="客户名称" />
|
|
</group>
|
|
<!-- 金额卡片展示区 -->
|
|
<div class="o_row" style="margin-top:20px; display:flex; flex:0;">
|
|
<div class="o_box stat-card" style="flex:1; margin:5px; padding:15px; text-align:center; border-radius:8px; border:1px solid #ddd; background:#f9fafb;">
|
|
<span style="font-size:14px; color:#555;">总面积 (㎡)</span>
|
|
<h3 style="margin-top:8px; color:#333;">
|
|
<field name="total_area"/>
|
|
</h3>
|
|
</div>
|
|
<div class="o_box stat-card" style="flex:1; margin:5px; padding:15px; text-align:center; border-radius:8px; border:1px solid #ddd; background:#f9fafb;">
|
|
<span style="font-size:14px; color:#555;">销售价格</span>
|
|
<h3 style="margin-top:8px; color:blue;">
|
|
<field name="selling_price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
|
</h3>
|
|
</div>
|
|
<div class="o_box stat-card" style="flex:1; margin:5px; padding:15px; text-align:center; border-radius:8px; border:1px solid #ddd; background:#f9fafb;">
|
|
<span style="font-size:14px; color:#555;">预期价格</span>
|
|
<h3 style="margin-top:8px; color:red;">
|
|
<field name="expected_price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
|
</h3>
|
|
</div>
|
|
<div class="o_box stat-card" style="flex:1; margin:5px; padding:15px; text-align:center; border-radius:8px; border:1px solid #ddd; background:#f9fafb;">
|
|
<span style="font-size:14px; color:#555;">最佳报价</span>
|
|
<h3 style="margin-top:8px; color:#333;">
|
|
<field name="best_price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<!-- 搜索视图配置 -->
|
|
<record id="estate_property_search_view" model="ir.ui.view">
|
|
<field name="name">estate.property.search</field>
|
|
<field name="model">estate.property</field>
|
|
<field name="arch" type="xml">
|
|
<search string="搜索">
|
|
<field name="name" />
|
|
<field name="postcode" />
|
|
<field name="expected_price" />
|
|
<field name="bedrooms" />
|
|
<field name="living_area" string="面积至少为(㎡)" filter_domain="[('living_area','>=',self)]" />
|
|
<field name="facades" />
|
|
<field name="garage" />
|
|
<separator />
|
|
<filter string="可用的" name="available" domain="['|',('state', '=', 'new'),('state', '=', 'offer_received')]" />
|
|
<group expand="1" string="Group By">
|
|
<filter string="邮编" name="postcode" context="{'group_by':'postcode'}" />
|
|
<filter string="创建月份" name="create_date_month" context="{'group_by': 'create_date_month'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
<!-- 看板试图配置 -->
|
|
<record id="estate_property_kanban" model="ir.ui.view">
|
|
<field name="model">estate.property</field>
|
|
<field name="arch" type="xml">
|
|
<kanban default_group_by="property_type_id" string="房地产信息" records_draggable="1">
|
|
<!-- 新增字段声明 tag也要显示-->
|
|
<field name="state" />
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div>
|
|
<div class="o_kanban_details">
|
|
<strong>
|
|
<field name="name" />
|
|
</strong>
|
|
<div class="o_kanban_description"> 预期价格:
|
|
<field name="expected_price" widget="monetary" options="{'currency_field': 'currency_id'}" />
|
|
<field name="state" widget="statusbar" statusbar_visible="new,offer_received,offer_accepted,sold,canceled" />
|
|
</div>
|
|
<div class="o_kanban_tags" style="margin-top: 5px;">
|
|
<field name="tag_ids" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
</odoo> |