From 0ec0f812576b551dcea58752bf081facc4ecf5ca Mon Sep 17 00:00:00 2001 From: ljmwkx <1340053001@qq.com> Date: Wed, 8 Jan 2025 17:49:21 +0800 Subject: [PATCH] 1 --- .../models/property_lease_contract.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 888bd306c..b4323ad52 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -4,7 +4,7 @@ import pandas as pd import calendar from dateutil.relativedelta import relativedelta from datetime import datetime, timedelta - +from odoo.tools.float_utils import float_round from numpy.ma.core import default_filler from odoo import models, fields, api, exceptions, _ @@ -367,7 +367,9 @@ class PropertyLeaseContract(models.Model): all_period_rent = 0 first_years_begin = self.first_years_begin if self.first_years_begin else 0 increments_every_few_years = self.increments_every_few_years - monthly_amount = self.total_area * self.unit_price # 月租金 + monthly_amount = self.total_area * self.unit_price + monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金 + # 月租金 unit_price = self.unit_price # 单价 rent_free_period_month = 0 if self.rent_free_period_month: @@ -488,11 +490,14 @@ class PropertyLeaseContract(models.Model): if self.increment_method == "increment_price" and self.increment_value: unit_price = unit_price + self.increment_value monthly_amount = self.total_area * unit_price + monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金 if self.increment_method == "percentage" and self.increment_value: monthly_amount = monthly_amount * (1 + (self.increment_value / 100)) + monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金 unit_price = monthly_amount / self.total_area if self.increment_method == "increment_amount" and self.increment_value: monthly_amount = monthly_amount + self.increment_value + monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金 unit_price = monthly_amount / self.total_area delta = relativedelta(increments_year[1], increments_year[0])