Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
1256 Vizualizări

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.
Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
iun. 25
461
2
iul. 25
1799
0
iun. 25
907
0
feb. 25
1013
1
ian. 25
1945