Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4961 Widoki

I am in situation have to create many2one ean13 field in product when we use any one at barcode reader of POS it should fetch the all the data related to the product

Awatar
Odrzuć
Autor Najlepsza odpowiedź

I have created one2may field in product.product to assign the ean13 and got the data at point of sale then update the code

point_of_sale in db.js

        _product_search_string: function(product){
            1000
            var str = '' + product.id + ':' + product.name;
            if(product.ean13){
                str += '|' + product.ean13;
            }
            //added
            if(product.code){
                 str += '|' + product.code;

                }   
            //end
            // added customised for multiple bar codes for single product
            if(product.bar_code_ids){
                for (i in product.bar_code_ids){
                    for (j in this.bar_codes){
                        if (this.bar_codes[j].id === product.bar_code_ids[i]){
                            str += '|' + this.bar_codes[j].name;
                        }
                    }
                }
            }
            // end
            var packagings = this.packagings_by_product_id[product.id] || [];
            for(var i = 0; i < packagings.length; i++){
                str += '|' + packagings[i].ean;
            }
            return str + '\n';
        },

Awatar
Odrzuć

Where do i get this.bar_codes in this function ?

Can you please tell me ? I have go t the id of barcodes in one2many field but hoe can i make it searchable with the name of barcodes ?

Najlepsza odpowiedź

There are modules to handle multiple ean13 per product. But i dont think it can work on pos front end.why not duplicate the product and just change the ean13 field

Awatar
Odrzuć