Skip to content

Commit 494616c

Browse files
authored
Merge pull request #89 from ShahalaKP-Tridz/feature/room-filter
Add restaurant-based filtering for room in URY Table
2 parents be48cf7 + 5738db9 commit 494616c

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
// Copyright (c) 2023, Tridz Technologies Pvt. Ltd. and contributors
22
// For license information, please see license.txt
33

4+
// frappe.ui.form.on('URY Table', {
5+
// // refresh: function(frm) {
6+
7+
// // }
8+
// });
9+
410
frappe.ui.form.on('URY Table', {
5-
// refresh: function(frm) {
11+
refresh(frm) {
12+
frm.set_query('restaurant_room', function () {
13+
if (!frm.doc.branch) {
14+
return {
15+
filters: {
16+
name: ['=', '']
17+
}
18+
};
19+
}
20+
return {
21+
filters: {
22+
branch: frm.doc.branch
23+
}
24+
};
25+
});
26+
},
627

7-
// }
28+
branch(frm) {
29+
// Clear room when restaurant changes
30+
frm.set_value('restaurant_room', null);
31+
}
832
});

0 commit comments

Comments
 (0)