Skip to content

Commit

Permalink
[Karthi] | BAH-3589 | Refactor. Marhup range issue has been fixed. (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyansp91 authored Feb 23, 2024
1 parent 7e1641c commit a144f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bahmni_purchase/models/price_markup_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

0 comments on commit a144f96

Please sign in to comment.