diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index 387bd1684..282fc61f8 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -18,7 +18,6 @@ class YuthonProperty(models.Model): building_area = fields.Float(string="建筑面积") title_deed = fields.Char(string="产权证编号") - actual_area = fields.Float(string="实际面积", digits=(16, 4)) effective_date = fields.Date(string="生效日期") property_source = fields.Selection([('cut', '划入'), ('self', '自建'), ('replace', '置换'), ('buy', '购入'), @@ -34,7 +33,6 @@ class YuthonProperty(models.Model): property_orientation = fields.Selection([('north', '东'), ('south', '南'), ('east', '西'), ('west', '北')], string="朝向") street = fields.Char(string="街道") - pooled_area = fields.Float(string="公摊面积", digits=(16, 4)) state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中'), ('ing_handover', '移交中'), ('done_handover', '已移交'), ('filing', '备案中'), ('net', '挂网'), ('signing', '签约中'), @@ -318,7 +316,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('yuthon.precinct.message',string="所属片区") + precinct_id = fields.Many2one(related='yuthon_property_id.precinct_id',string="所属片区", readonly=False) tenure_type = fields.Selection([('self', '自营'), ('agency', '代管')], string='权属类型') management_area = fields.Float(string="管理面积", digits=(16, 4)) rent_area = fields.Float(string="可租面积", digits=(16, 4)) diff --git a/yuthon_property/models/yuthon_property_message.py b/yuthon_property/models/yuthon_property_message.py index d63eea638..c059f2d0a 100644 --- a/yuthon_property/models/yuthon_property_message.py +++ b/yuthon_property/models/yuthon_property_message.py @@ -9,6 +9,8 @@ class YuthonPropertyMessage(models.Model): name = fields.Char(string='产权地址') owner_id = fields.Many2one('yuthon.owner.message', string="权属人") title_certificate = fields.Char(string="产权证号") + pooled_area = fields.Float(string="公摊面积", digits=(16, 4)) + ctual_area = fields.Float(string="实际面积", digits=(16, 4)) equity_area = fields.Float(string="产权面积", digits=(16, 4)) documents_ids = fields.Many2many('ir.attachment', string="附件") diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml index 30ee533fb..8eafd665b 100644 --- a/yuthon_property/views/yuthon_property_views.xml +++ b/yuthon_property/views/yuthon_property_views.xml @@ -50,20 +50,15 @@ - - - - + - + - - @@ -72,6 +67,9 @@ + + + diff --git a/yuthon_property_approval/models/property_handover.py b/yuthon_property_approval/models/property_handover.py index c06c5fe94..e8b1df0d6 100644 --- a/yuthon_property_approval/models/property_handover.py +++ b/yuthon_property_approval/models/property_handover.py @@ -23,6 +23,6 @@ class PropertyHandoverLine(models.Model): property_address = fields.Char(related='property_id.name',string="资产名称") is_affirmation = fields.Boolean(related='property_id.is_confirm_authorization',string="是否确权") title_number = fields.Char(string="产权编号") - area = fields.Float(related='property_id.actual_area',string="面积") + area = fields.Float(related='property_id.rent_area',string="面积") purposes = fields.Many2one(related='property_id.asset_type_id',string="用途") state = fields.Selection(related='property_id.state', string="状态",) \ No newline at end of file diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index c8972c955..b94964a39 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -113,33 +113,33 @@ class PropertyLeaseContract(models.Model): responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书") handover_time = fields.Date(string="交接日期") - @api.onchange("term_start_time", "term_end_time", - "increments_every_few_years", "unit_price", - "first_years_begin", "increment_method", - "increment_price", "increment_percentage", "increment_amount", - "rent_free_period_year", "rent_free_period_month", "total_area") - def onchange_first_year_rent(self): - for record in self: - if record.term_start_time and record.term_end_time: - start_date = record.term_start_time - end_date = record.term_end_time + relativedelta(days=1) - if start_date + relativedelta(months=12) < end_date: - end_date = start_date + relativedelta(months=12) - all_period_rent = record.my_compute_all_period_rent(start_date, end_date) - record.first_year_rent = all_period_rent - all_start_date = record.term_start_time - all_end_date = record.term_end_time + relativedelta(days=1) - record.total_contract_receivables = record.my_compute_all_period_rent(all_start_date, all_end_date) + # @api.onchange("term_start_time", "term_end_time", + # "increments_every_few_years", "unit_price", + # "first_years_begin", "increment_method", + # "increment_price", "increment_percentage", "increment_amount", + # "rent_free_period_year", "rent_free_period_month", "total_area") + # def onchange_first_year_rent(self): + # for record in self: + # if record.term_start_time and record.term_end_time: + # start_date = record.term_start_time + # end_date = record.term_end_time + relativedelta(days=1) + # if start_date + relativedelta(months=12) < end_date: + # end_date = start_date + relativedelta(months=12) + # all_period_rent = record.my_compute_all_period_rent(start_date, end_date) + # record.first_year_rent = all_period_rent + # all_start_date = record.term_start_time + # all_end_date = record.term_end_time + relativedelta(days=1) + # record.total_contract_receivables = record.my_compute_all_period_rent(all_start_date, all_end_date) - @api.onchange("lease_term_year", "lease_term_month", "term_start_time") - def onchange_lease_term_year(self): - for record in self: - if record.lease_term_year or record.lease_term_month: - if record.term_start_time: - year = record.lease_term_year if record.lease_term_year else 0 - month = record.lease_term_month if record.lease_term_month else 0 - months = year * 12 + month - record.term_end_time = record.term_start_time + relativedelta(months=months) - relativedelta(days=1) + # @api.onchange("lease_term_year", "lease_term_month", "term_start_time") + # def onchange_lease_term_year(self): + # for record in self: + # if record.lease_term_year or record.lease_term_month: + # if record.term_start_time: + # year = record.lease_term_year if record.lease_term_year else 0 + # month = record.lease_term_month if record.lease_term_month else 0 + # months = year * 12 + month + # record.term_end_time = record.term_start_time + relativedelta(months=months) - relativedelta(days=1) @staticmethod def divide_time_range_fixed(start_time, end_time, months): diff --git a/yuthon_property_approval/models/property_offline_registration.py b/yuthon_property_approval/models/property_offline_registration.py index 19f0e2b9b..3779479e4 100644 --- a/yuthon_property_approval/models/property_offline_registration.py +++ b/yuthon_property_approval/models/property_offline_registration.py @@ -9,7 +9,7 @@ class PropertyOfflineRegistration(models.Model): next_by_code('property_offline_registration_code')) property_id = fields.Many2one('yuthon.property',string='物业名称') address = fields.Char(related='property_id.name',string='物业地址') - area = fields.Float(related='property_id.actual_area',string='面积(m²)') + area = fields.Float(related='property_id.rent_area',string='面积(m²)') rental_price = fields.Float(string='租金底价(元/m²)') monthly_rent = fields.Float(string='月租金(元)') increment_rate = fields.Char(string='递增率') diff --git a/yuthon_property_approval/models/property_rental_conditions.py b/yuthon_property_approval/models/property_rental_conditions.py index cc7e75ead..3aa3e05c2 100644 --- a/yuthon_property_approval/models/property_rental_conditions.py +++ b/yuthon_property_approval/models/property_rental_conditions.py @@ -10,7 +10,7 @@ class PropertyRentalConditions(models.Model): code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence']. next_by_code('property_rental_conditions_code')) registered_use = fields.Char(related='property_id.registered_use',string='证载用途') - evaluation_area = fields.Float(related='property_id.actual_area',string='出租面积(m²)') + evaluation_area = fields.Float(related='property_id.rent_area',string='出租面积(m²)') lease_expiration_date = fields.Date(string='租赁到期日') now_rent_price = fields.Float(related='property_id.current_rent',string='现租价(元/m² •月)') appraisal_price = fields.Float(string='评估价(元/m² •月)')