fix: reset voucher_type
and voucher_no
if based_on
is set to Item and Warehouse
This commit is contained in:
parent
9fd70a6827
commit
eeec008547
@ -34,6 +34,22 @@ frappe.ui.form.on('Repost Item Valuation', {
|
||||
frm.trigger('setup_realtime_progress');
|
||||
},
|
||||
|
||||
based_on: function(frm) {
|
||||
var fields_to_reset = [];
|
||||
|
||||
if (frm.doc.based_on == 'Transaction') {
|
||||
fields_to_reset = ['item_code', 'warehouse'];
|
||||
} else if (frm.doc.based_on == 'Item and Warehouse') {
|
||||
fields_to_reset = ['voucher_type', 'voucher_no'];
|
||||
}
|
||||
|
||||
if (fields_to_reset) {
|
||||
fields_to_reset.forEach(field => {
|
||||
frm.set_value(field, undefined);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setup_realtime_progress: function(frm) {
|
||||
frappe.realtime.on('item_reposting_progress', data => {
|
||||
if (frm.doc.name !== data.name) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user