I have created a custom JavaScript file to modify the get_full_product_name function in the Odoo Point of Sale (PoS) module. However, the changes made in the custom JavaScript file are not taking effect as expected.
Problem Details:
Custom JavaScript File Location: My custom JavaScript file is located at point_of_sale/static/src/js/custom_pos_models.js.
JavaScript File Content:
odoo.define('pos_custom.models', function (require) {
"use strict";
var Orderline = require('point_of_sale.models');
Orderline.models = Orderline.include({
get_full_product_name: function () {
console.log(this.full_product_name);
if (this.full_product_name) {
return this.full_product_name;
}
var full_name = this.product.display_name;
console.log(full_name);
if (this.description && this.description !== "with") {
full_name += ` (${this.description})`;
}
console.log(full_name);
return full_name;
},
});
return Orderline;
});
Expected Behavior:
The expected behavior is that the get_full_product_name function in the Orderline class should be modified as per the changes made in the custom JavaScript file.
Actual Behavior: Despite the custom JavaScript file being correctly defined and included in the assets, the changes to the get_full_product_name function are not having any effect in the Odoo PoS system.
.