Skip to content

Commit

Permalink
[FIX] pos_product_multi_barcode: incoherent data
Browse files Browse the repository at this point in the history
If a `barcode` is already in `product_by_barcode`, do not override
it, as Odoo does with `product_by_id`. This can lead to incoherent
data if something changes after product is first loaded and then
reloads (if limited loading is enabled), or it is modified in
`product_by_id` and not in `product_by_barcode`.
  • Loading branch information
danielduqma committed Dec 26, 2024
1 parent 65a85f9 commit aa51e5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pos_product_multi_barcode/static/src/js/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ odoo.define("pos_product_multi_barcode.db", function (require) {
var barcodes = JSON.parse(product.barcodes_json);

barcodes.forEach(function (barcode) {
if (barcode in self.product_by_barcode) {
return;
}
self.product_by_barcode[barcode] = product;
});
});
Expand Down

0 comments on commit aa51e5f

Please sign in to comment.