mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19:01 +00:00
21 lines
623 B
JavaScript
21 lines
623 B
JavaScript
import frappe from 'frappe';
|
|
|
|
async function setAugmentedModel(model, regionalInfo) {
|
|
const getAugmentedModel = (
|
|
await import('./doctype/' + model + '/RegionalChanges')
|
|
).default;
|
|
const augmentedModel = getAugmentedModel(regionalInfo);
|
|
frappe.models[model] = augmentedModel;
|
|
frappe.models[model].augmented = 1;
|
|
}
|
|
|
|
export default async function regionalModelUpdates(regionalInfo) {
|
|
for (let model in frappe.models) {
|
|
const { regional, basedOn, augmented } = frappe.models[model];
|
|
if (!regional || basedOn || augmented) {
|
|
continue;
|
|
}
|
|
await setAugmentedModel(model, regionalInfo);
|
|
}
|
|
}
|