Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1269 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
čvn 25
471
2
čvc 25
1802
0
čvn 25
909
0
úno 25
1017
1
led 25
1963