2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 23:00:56 +00:00

fix: validation

This commit is contained in:
AbleKSaju 2024-09-11 10:19:59 +05:30
parent 890f5aa6bb
commit 9347acc0aa

View File

@ -1,10 +1,7 @@
import { Doc } from 'fyo/model/doc';
import { Money } from 'pesa';
import { PricingRuleItem } from '../PricingRuleItem/PricingRuleItem';
import {
getIsDocEnabledColumn,
getPricingRulesConflicts,
} from 'models/helpers';
import { getIsDocEnabledColumn } from 'models/helpers';
import {
HiddenMap,
ListViewSettings,
@ -128,20 +125,6 @@ export class PricingRule extends Doc {
);
}
},
priority: async (value: DocValue) => {
const pricingRuleConflicts = await getPricingRulesConflicts(
this,
value as number
);
if (!pricingRuleConflicts) {
return;
}
throw new ValidationError(
t`Pricing Rules ${pricingRuleConflicts.pricingRule} has the same Priority for the Item ${pricingRuleConflicts.item}.`
);
},
};
required: RequiredMap = {