mirror of
https://github.com/frappe/books.git
synced 2024-11-08 23:00:56 +00:00
fix: validation
This commit is contained in:
parent
890f5aa6bb
commit
9347acc0aa
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user