From a144f96062ba32911847705547c6e0e04945f71c Mon Sep 17 00:00:00 2001 From: Karthikeyan Date: Fri, 23 Feb 2024 16:15:30 +0530 Subject: [PATCH] [Karthi] | BAH-3589 | Refactor. Marhup range issue has been fixed. (#59) --- bahmni_purchase/models/price_markup_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bahmni_purchase/models/price_markup_table.py b/bahmni_purchase/models/price_markup_table.py index ba05c9f..b8839ad 100644 --- a/bahmni_purchase/models/price_markup_table.py +++ b/bahmni_purchase/models/price_markup_table.py @@ -16,9 +16,9 @@ def _check_fields_values(self): raise ValidationError('Minimum cost should not be greater than maximum cost.') # Add any other conditions you need to check for data in self.env['price.markup.table'].search([]): - if data.lower_price <= self.lower_price <= data.higher_price and data.id != self.id: + if data.lower_price < self.lower_price < data.higher_price and data.id != self.id: raise ValidationError('Your minimum cost is available within the range of minimum cost and maximum cost of previous records.') - if data.higher_price <= self.higher_price <= data.higher_price and data.id != self.id: + if data.lower_price < self.higher_price < data.higher_price and data.id != self.id: raise ValidationError('Your maximum cost is available within the range of minimum cost and maximum cost of previous records.')