Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1314 Ansichten

Hello team, I need assistance with extending or overriding a file in Odoo 17 POS, specifically the db.js file. I would like to modify the _product_search_string(product) function and add a new condition. Could someone provide guidance on how to achieve this? I want to include the following condition in the function:

if (product.barcodes_json) {
    str += "|" + product.barcodes_json;
}



Any help or suggestions on how to implement this modification would be greatly appreciated. Thank you.
Avatar
Verwerfen
Beste Antwort

Hi,

To override a function in POS, you can include the function and add the modifications you need.
odoo.define('your_module.your_js', function (require) {
"use strict";

var core = require('web.Core');
   core.include({
      _product_search_string: function(product){//Add the code to override      },})
})


Hope it helps

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Juni 25
634
2
Juli 25
1971
0
Juni 25
1019
0
Feb. 25
1114
1
Jan. 25
2081