跳至内容
菜单
此问题已终结
1 回复
1286 查看

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.
形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
0
6月 25
538
2
7月 25
1891
0
6月 25
935
0
2月 25
1049
1
1月 25
2013