I tried editing and overriding this file but was not able to find a proper way. As a workaround I created my extra functionality in another prototype object and called it inside a phtml defined in the sales_order_create_index layout file.
example:
Namespace/Module/view/adminhtml/web/js/customscript.js
define([
"jquery",
"Magento_Ui/js/modal/modal",
"mage/loader",
"mage/translate",
"prototype",
], function (jQuery, modal,loader) {
window.addProduct = Class.create();
addProduct.prototype = {
//Custom code
initialize: function () {
//Code to run on Object Initialisation
},
setPopUpContainer: function (trigger) {
//Code to pull up a modal
},
reloadAreas: function () {
// this accesses the order object from the scripts.js file and reloads the various areas in the page
order.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true);
}
};
});
Namespace/Module/view/adminhtml/templates/custom-js.phtml
<script>
require(["jquery", "prototype", "Magento_Sales/order/create/form", "Namespace_Module/js/customscript"], function ($) {
window.CustomAddProduct = new addProduct();
});
</script>
Namespace/Module/view/adminhtml/layout/
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="js">
<block class="Namespace\Module\Block\Adminhtml\CustomBlock" template="Namespace_Module::custom-js.phtml" name="customblockname"/>
</referenceContainer>
</body>
</page>