From e9561af9bbdfb8f6564e28b63ba4d962fb4da61b Mon Sep 17 00:00:00 2001 From: ljmwkx <1340053001@qq.com> Date: Tue, 7 Jan 2025 20:44:21 +0800 Subject: [PATCH 1/4] 1 --- .../views/property_lease_contract.xml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 87f8d8ede..a52373982 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -229,11 +229,7 @@ style="max-width: 3rem !important;"/>年递增 - - - @@ -498,11 +494,7 @@ style="max-width: 3rem !important;"/>年递增 - - - From b2b60399e3d052276e96e67e4f0a0e2a08caf41b Mon Sep 17 00:00:00 2001 From: ljmwkx <1340053001@qq.com> Date: Tue, 7 Jan 2025 21:14:57 +0800 Subject: [PATCH 2/4] 1 --- yuthon_property_approval/models/property_lease_contract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 0bc7dd86c..4a0a52912 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -451,7 +451,7 @@ class PropertyLeaseContract(models.Model): "monthly_amount": monthly_amount, "breakdown_id": self.id, "start_data": free_start, - "end_data": first_years_begin_end, + "end_data": first_years_begin_end - relativedelta(days=1), "month_number": first_months, "period_rent": first_months * monthly_amount, })]}) From 81e4ae5f1b22057a522f6d9acb778c2fc6acda09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Wed, 8 Jan 2025 10:11:06 +0800 Subject: [PATCH 3/4] pengyu --- .../wizard/choose_contract_wizard_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yuthon_property_approval/wizard/choose_contract_wizard_views.xml b/yuthon_property_approval/wizard/choose_contract_wizard_views.xml index 3b84e7fdf..6cb5b970d 100644 --- a/yuthon_property_approval/wizard/choose_contract_wizard_views.xml +++ b/yuthon_property_approval/wizard/choose_contract_wizard_views.xml @@ -8,7 +8,7 @@ - + From 8a426a3b5fa86c49905f47ec6f7617e6558df74a Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Wed, 8 Jan 2025 10:12:42 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_property/models/yuthon_property.py | 8 ++- .../models/yuthon_property_message.py | 1 + .../views/yuthon_property_message_views.xml | 1 + .../views/yuthon_property_views.xml | 1 + .../models/property_lease_contract.py | 53 ++++++++++--------- .../views/property_lease_contract.xml | 28 ++++++++-- 6 files changed, 63 insertions(+), 29 deletions(-) diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index a2966529b..697f5f2d0 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -42,7 +42,7 @@ class YuthonProperty(models.Model): is_confirm_authorization = fields.Boolean(string="确权") property_card = fields.Html(string="产权证") life_timer = fields.Datetime(string="使用时间") - property_use_time = fields.Selection([('a', '70年'), ('b', '40年')], string="使用年限") + property_use_time = fields.Selection([('a', '70年'), ('b', '40年'), ('c', '50年'), ('e', '30年'), ('f', '60年')], string="产权年限") asset_type_id = fields.Many2one('yuthon.resource.type', string="出租类型") is_hvac = fields.Boolean(string="使用中央空调") is_handle_land = fields.Boolean(string="办理土地有偿使用手续") @@ -89,6 +89,8 @@ class YuthonProperty(models.Model): 'rent_area': latest_record_id.rent_area, 'admin_id':latest_record_id.admin_id.id, 'company_id':latest_record_id.company_id.id, + 'property_type':latest_record_id.property_type, + 'tenure_type': latest_record_id.tenure_type, }) @api.onchange('energy_meter_ids') @@ -310,7 +312,9 @@ class TitleInformationLine(models.Model): property_message_id = fields.Many2one('yuthon.property.message', string='产权地址') owner_id = fields.Many2one(related='property_message_id.owner_id', string="权属人") equity_area = fields.Float(related='property_message_id.equity_area', string="产权面积", digits=(16, 4)) + registered_use = fields.Char(related='property_message_id.registered_use', string='证载用途') title_certificate = fields.Char(related='property_message_id.title_certificate', string="产权证号") + start_time = fields.Date(string="生效日期", default=fields.Date.today) end_date = fields.Date(string="失效日期") @@ -322,7 +326,7 @@ class ManageInformationLine(models.Model): yuthon_property_id = fields.Many2one('yuthon.property', string="关联物业信息") purpose_id = fields.Many2one('yuthon.resource.purpose', string="管理类型") precinct_id = fields.Many2one(related='yuthon_property_id.precinct_id',string="所属片区", readonly=False) - tenure_type = fields.Selection([('self', '自营'), ('agency', '代管')], string='权属类型') + tenure_type = fields.Selection([('self', '自有'), ('agency', '代管')], string='权属类型') management_area = fields.Float(string="管理面积", digits=(16, 4)) rent_area = fields.Float(string="可租面积", digits=(16, 4)) admin_id = fields.Many2one('res.users', string="管理员") diff --git a/yuthon_property/models/yuthon_property_message.py b/yuthon_property/models/yuthon_property_message.py index 5b2a85046..d054f01bf 100644 --- a/yuthon_property/models/yuthon_property_message.py +++ b/yuthon_property/models/yuthon_property_message.py @@ -12,5 +12,6 @@ class YuthonPropertyMessage(models.Model): pooled_area = fields.Float(string="公摊面积", digits=(16, 4)) ctual_area = fields.Float(string="实际面积", digits=(16, 4)) equity_area = fields.Float(string="产权面积", digits=(16, 4)) + registered_use = fields.Char(string='证载用途') documents_ids = fields.Many2many('ir.attachment', string="附件") diff --git a/yuthon_property/views/yuthon_property_message_views.xml b/yuthon_property/views/yuthon_property_message_views.xml index bf4b09330..3e2cc72b6 100644 --- a/yuthon_property/views/yuthon_property_message_views.xml +++ b/yuthon_property/views/yuthon_property_message_views.xml @@ -11,6 +11,7 @@ + diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml index bef6ef716..f3a2dc87b 100644 --- a/yuthon_property/views/yuthon_property_views.xml +++ b/yuthon_property/views/yuthon_property_views.xml @@ -93,6 +93,7 @@ + diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 4a0a52912..c8b0aa656 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -94,8 +94,8 @@ class PropertyLeaseContract(models.Model): is_split = fields.Boolean(string="是否合同拆分") split_context = fields.Char(string="拆分内容", default="该合同已拆分") percentage_liquidated_damages = fields.Many2one('yuthon.penalty.setting', string="违约金比例") - date_payment_month = fields.Date(string="支付日期") - date_payment_day = fields.Date(string="支付日期") + date_payment_month = fields.Char(string="支付日期") + date_payment_day = fields.Char(string="支付日期") first_pay = fields.Date(string="首次付款日") unit_price = fields.Float(string="单价") deposit_type = fields.Selection([('deposit', '押金'), ('performance', '履约保证金')], string="押金/履约保证金") @@ -117,6 +117,9 @@ class PropertyLeaseContract(models.Model): condition = fields.Selection([('new', '新建'),('approval','审批'),('cancel','作废')], string="状态", default='new') message_type = fields.Selection([('be_executed','待执行'), ('executed','已执行'), ('expired','已终止'), ('advance','提前终止')], string="合同状态") contract_type = fields.Selection([('lease_renewal', '续租'), ('interim', '临租'), ('new', '补充协议'), ('first', '首租')], string="合同类型", default='first') + performance_bonds = fields.Float(string="经营履约保证金") + utility_bills = fields.Float(string="水电费押金") + renovation_deposit = fields.Float(string="装修押金") lease_ids = fields.One2many('property.lease.contract.line', 'lease_id',string="物业信息明细行") subset_ids = fields.One2many('property.subset.contract', 'subset_id',string="子集明细") breakdown_ids = fields.One2many('property.rent.breakdown.line', 'breakdown_id', string="物业租金明细行") @@ -140,7 +143,8 @@ class PropertyLeaseContract(models.Model): @api.onchange('total_area', 'rent') def _onchange_unit_price(self): for i in self: - i.unit_price = i.total_area / i.rent + if i.total_area and i.rent: + i.unit_price = i.total_area / i.rent @api.depends('breakdown_ids') def _compute_total_contract_receivables(self): @@ -332,27 +336,27 @@ class PropertyLeaseContract(models.Model): "original_amount": record.total_area * record.management_fee * months, }) - @api.onchange("term_start_time", "term_end_time", - "increments_every_few_years", "unit_price", - "first_years_begin", "increment_method", "increment_value", - "rent_free_period_month", "rent_free_period_days", "total_area") - def _onchange_action_generate_details(self): - """ - 生产租金明细 - :return: - """ - # todo 还没有计算递增递减 - # todo 还没有计算首月优惠 - # todo 还没有计算开始和结束不足月份和季度的计算比例 - for record in self: - if not record.term_start_time: - raise UserError(_("请填写租期开始时间!")) - if not record.term_end_time: - raise UserError(_("请填写租期结束时间!")) - record.write({'breakdown_ids': [(5, 0, 0)]}) - start_date = record.term_start_time - end_date = record.term_end_time + relativedelta(days=1) - record.do_generate_details_core(start_date, end_date) + # @api.onchange("term_start_time", "term_end_time", + # "increments_every_few_years", "unit_price", + # "first_years_begin", "increment_method", "increment_value", + # "rent_free_period_month", "rent_free_period_days", "total_area") + # def _onchange_action_generate_details(self): + # """ + # 生产租金明细 + # :return: + # """ + # # todo 还没有计算递增递减 + # # todo 还没有计算首月优惠 + # # todo 还没有计算开始和结束不足月份和季度的计算比例 + # for record in self: + # if not record.term_start_time: + # raise UserError(_("请填写租期开始时间!")) + # if not record.term_end_time: + # raise UserError(_("请填写租期结束时间!")) + # record.write({'breakdown_ids': [(5, 0, 0)]}) + # start_date = record.term_start_time + # end_date = record.term_end_time + relativedelta(days=1) + # record.do_generate_details_core(start_date, end_date) def do_generate_details_core(self, start_date, end_date): """ @@ -619,6 +623,7 @@ class PropertyLeaseContract(models.Model): self._context.get('active_ids', self._context.get('active_id'))) for record in contract_ids: record.use_address = record.name + record.address_for_delivery = record.name def action_update_contract(self): contract_ids = self.env["property.lease.contract"].browse(self._context.get('active_ids', self._context.get('active_id'))) diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index 32e6629ee..26019e40b 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -247,7 +247,7 @@