From 4a2dbc24b7c72ceaec9aadca615885e797ec6540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 23 Sep 2026 17:59:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/property_confirm.py | 16 ++++++++++ .../report/property_confirm_template.xml | 23 ++++++++++++++ .../static/src/scss/approval.scss | 30 ++++++++++++++++++- .../views/property_confirm_views.xml | 17 +++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) diff --git a/yuthon_property_approval/models/property_confirm.py b/yuthon_property_approval/models/property_confirm.py index e20105cd4..8f500dd21 100644 --- a/yuthon_property_approval/models/property_confirm.py +++ b/yuthon_property_approval/models/property_confirm.py @@ -25,6 +25,22 @@ class PropertyConfirm(models.Model): type_stamp_ids = fields.Many2many('seals.type.setting', string='用章类型', domain="['&', ('start_date', '<=', context_today()), '|', ('end_date', '=', False), ('end_date', '>=', context_today())]") documents_ids = fields.Many2many('ir.attachment', string="附件") lease_ids = fields.One2many('property.lease.contract.line', 'confirm_id', string="物业列表") + # 面积:下方物业明细行「可租面积(property_area)」的合计 + property_area = fields.Float(string="面积", compute="_compute_property_area", digits=(16, 4)) + # 租期年限(整型) + lease_term_years = fields.Integer(string="租期年限") + # 免租天数(整型) + rent_free_days = fields.Integer(string="免租天数") + # 每几年递增(整型,与递增百分比组合成「每 __ 年递增 __ %」) + increments_few_years = fields.Integer(string="每几年递增") + # 递增百分比 + annual_increase_percentage = fields.Float(string="递增百分比", digits=(6, 2)) + + @api.depends('lease_ids', 'lease_ids.property_area') + def _compute_property_area(self): + # 汇总每条成交确认单下所有物业明细行的可租面积 + for rec in self: + rec.property_area = sum(rec.lease_ids.mapped('property_area')) def _get_default_name_title(self): return '成交确认书' diff --git a/yuthon_property_approval/report/property_confirm_template.xml b/yuthon_property_approval/report/property_confirm_template.xml index d2deef134..8b7ba1e13 100644 --- a/yuthon_property_approval/report/property_confirm_template.xml +++ b/yuthon_property_approval/report/property_confirm_template.xml @@ -84,6 +84,29 @@ + + + + 面积 + + + 租期年限 + 年 + + + + 免租天数 + 天 + + 每几年递增 + + + 每 年递增 % + + — + + + diff --git a/yuthon_property_approval/static/src/scss/approval.scss b/yuthon_property_approval/static/src/scss/approval.scss index 12bca7a6f..b0ed2a625 100644 --- a/yuthon_property_approval/static/src/scss/approval.scss +++ b/yuthon_property_approval/static/src/scss/approval.scss @@ -1,4 +1,32 @@ .list_width{ width: 300px !important; max-width: 300px !important; -} \ No newline at end of file +} + +// 成交确认:「每 __ 年递增 __ %」紧凑单行组合 +// 根因:可编辑表单里 .o_form_editable .o_row > .o_field_widget 会被设成 flex:1 1 auto;width:0,把字段拉满整行, +// 导致末尾的「%」被顶到最右边。故不用 o_row,改用自定义类 + 固定窄宽度。 +.o_confirm_increase_combo { + display: flex !important; // 单行 flex 排列 + flex-flow: row nowrap !important; // 禁止换行 + align-items: center !important; // 垂直居中 + gap: 6px !important; // 元素间距 + + > * { + flex: 0 0 auto !important; // 所有子项均不拉伸 + } + + > span { + white-space: nowrap !important; // 文字不换行 + } + + // 两个数字字段固定窄宽度 + .o_field_widget { + width: 90px !important; + } + + // 输入框填满字段宽度 + .o_field_widget input { + width: 100% !important; + } +} diff --git a/yuthon_property_approval/views/property_confirm_views.xml b/yuthon_property_approval/views/property_confirm_views.xml index d68a5bc57..cfbdf17b4 100644 --- a/yuthon_property_approval/views/property_confirm_views.xml +++ b/yuthon_property_approval/views/property_confirm_views.xml @@ -51,6 +51,23 @@ + + + + + + + + + + +
+ 每 + + 年递增 + + % +