Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions product_multi_barcode/models/product_barcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ProductBarcode(models.Model):
name = fields.Char(
string="Barcode",
required=True,
index="trigram",
)
sequence = fields.Integer(
default=0,
Expand Down
6 changes: 2 additions & 4 deletions product_multi_barcode/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class ProductProduct(models.Model):
comodel_name="product.barcode",
inverse_name="product_id",
string="Barcodes",
auto_join=True,
)
barcode = fields.Char(
string="Main barcode",
Expand Down Expand Up @@ -60,11 +61,8 @@ def _search(self, domain, *args, **kwargs):
def _get_barcode_domain(self, sub_domain, domain):
barcode_operator = sub_domain[1]
barcode_value = sub_domain[2]
barcodes = self.env["product.barcode"].search(
[("name", barcode_operator, barcode_value)]
)
domain = [
("barcode_ids", "in", barcodes.ids)
("barcode_ids.name", barcode_operator, barcode_value)
if x[0] == "barcode" and x[2] == barcode_value
else x
for x in domain
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.