I am new to Openerp 7.0 and finding it difficult to add an extra search parameter in the js file in the point of sale module.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
In db.js, modify the _product_search_string
function as you need. For example, if you want to add searching for default_code also, then the function can be written as,
_product_search_string: function(product){
var str = '' + product.id + ':' + product.name;
if(product.ean13){
str += '|' + product.ean13;
}
if(product.default_code){
str += '|' + product.default_code;
}
var packagings = this.packagings_by_product_id[product.id] || [];
for(var i = 0; i < packagings.length; i++){
str += '|' + packagings[i].ean;
}
return str + '\n';
},
And in the models.js file, in the function load_server_data, in the delf.fetch part of product.product, add the field default_code.
return self.fetch(
'product.product',
fields=['name', 'list_price','price','pos_categ_id', 'taxes_id', 'ean13', 'default_code',
'to_weight', 'uom_id', 'uos_id', 'uos_coeff', 'mes_type', 'description_sale', 'description'],
domain=[['sale_ok','=',true],['available_in_pos','=',true]],
{pricelist: self.get('shop').pricelist_id[0]} // context for price
);
The example above doesn't do anything for me.
I have updated my answer
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 11 24
|
1503 | ||
|
4
thg 10 24
|
3827 | ||
|
0
thg 10 22
|
5197 | ||
|
0
thg 9 22
|
38 | ||
|
2
thg 1 25
|
1172 |