fix: Query filter fields from Website Item instead of Item master

- tweak `filters.py` to correctly query filter field values from Website Item
- Use Website Item for filter field options in Settings and Item Group Field Filter table
This commit is contained in:
marination
2022-04-18 18:01:48 +05:30
parent 15576c1ce8
commit c993ac09df
3 changed files with 19 additions and 13 deletions

View File

@@ -72,17 +72,17 @@ frappe.ui.form.on("Item Group", {
});
}
frappe.model.with_doctype('Item', () => {
const item_meta = frappe.get_meta('Item');
frappe.model.with_doctype('Website Item', () => {
const web_item_meta = frappe.get_meta('Website Item');
const valid_fields = item_meta.fields.filter(
const valid_fields = web_item_meta.fields.filter(
df => ['Link', 'Table MultiSelect'].includes(df.fieldtype) && !df.hidden
).map(df => ({ label: df.label, value: df.fieldname }));
frm.fields_dict.filter_fields.grid.update_docfield_property(
frm.get_field("filter_fields").grid.update_docfield_property(
'fieldname', 'fieldtype', 'Select'
);
frm.fields_dict.filter_fields.grid.update_docfield_property(
frm.get_field("filter_fields").grid.update_docfield_property(
'fieldname', 'options', valid_fields
);
});