33 lines
812 B
JavaScript
33 lines
812 B
JavaScript
/**
|
||
* Интеграция формы подбора с Request for Quotation
|
||
*/
|
||
|
||
frappe.ui.form.on('Request for Quotation', {
|
||
refresh: function(frm) {
|
||
if (frm.doc.docstatus === 0) {
|
||
setup_selection_button(frm);
|
||
}
|
||
}
|
||
});
|
||
|
||
function setup_selection_button(frm) {
|
||
const grid = frm.fields_dict.items.grid;
|
||
|
||
grid.wrapper.find('.grid-add-multiple-rows').remove();
|
||
|
||
$('<button type="button" class="grid-add-multiple-rows btn btn-xs btn-secondary">')
|
||
.html(__('Add Multiple'))
|
||
.insertAfter(grid.wrapper.find('.grid-add-row'))
|
||
.on('click', function(e) {
|
||
e.stopImmediatePropagation();
|
||
|
||
const selection_dialog = new SelectionDialog({
|
||
frm: frm,
|
||
doctype: 'Request for Quotation',
|
||
child_doctype: 'Request for Quotation Item',
|
||
has_rate: false
|
||
});
|
||
selection_dialog.show();
|
||
});
|
||
}
|