In Odoo, the relationship between JavaScript and XML files is that XML files are used to define the structure and layout of views, while JavaScript is used to add logic and interactivity to the views. In your case, you can use JavaScript to split the barcode into its different parts, and then use the $el property of the view to access the corresponding XML elements and update their values.
For example, to set the value of a field with the id attribute set to barcode_field, you can use the following code:
var barcodeField = this.$el.find('#barcode_field');
barcodeField.val(barcodeValue);
This code will find the element with the id attribute set to barcode_field in the view's XML, and set its value to barcodeValue. You can use a similar approach to set the values of the other fields.
Keep in mind that you need to make sure that the JavaScript code is executed after the view has been rendered, so you may need to use a deferred object or the on_attach_callback function to make sure that the fields are available when the code is executed.