diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index e42e2721f..f63b6ce0a 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -150,7 +150,7 @@ class PropertyLeaseContract(models.Model): def _onchange_unit_price(self): for i in self: if i.total_area and i.rent: - i.unit_price = i.total_area / i.rent + i.unit_price = i.rent / i.total_area @api.depends('breakdown_ids') def _compute_total_contract_receivables(self): @@ -369,8 +369,7 @@ class PropertyLeaseContract(models.Model): all_period_rent = record.do_generate_details_core(start_date, first_year_end_date, False) record.first_year_rent = all_period_rent - - def do_generate_details_core(self, start_date, end_date, write_db=False): + def do_generate_details_core(self, start_date=None, end_date=None, write_db=False): all_period_rent = 0 monthly_amount = self.total_area * self.unit_price