Skip to content

Commit

Permalink
fix product_barcode_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-champonnois authored and github-grap-bot committed Dec 14, 2022
1 parent 737d320 commit 0f3996a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions product_barcode_generator/data/barcode_rule.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<record model="barcode.rule" id="beesdoo_product_barcode_rule">
<field name="name">Beescoop Product Barcodes</field>
<record model="barcode.rule" id="product_barcode_rule">
<field name="name">product_barcode_generator</field>
<field name="barcode_nomenclature_id">1</field>
<field name="type">product</field>
<field name="pattern">043</field>
Expand Down
4 changes: 2 additions & 2 deletions product_barcode_generator/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def generate_barcode(self):
self.ensure_one()
if self.to_weight:
seq_internal_code = self.env.ref(
"beesdoo_product.seq_ean_product_internal_ref"
"product_barcode_generator.seq_ean_product_internal_ref"
)
bc = ""
if not self.default_code:
Expand All @@ -38,7 +38,7 @@ def generate_barcode(self):
bc = ean[0:12] + str(self.env["barcode.nomenclature"].ean_checksum(ean))
else:
rule = self.env["barcode.rule"].search(
[("name", "=", "Beescoop Product Barcodes")]
[("name", "=", "product_barcode_generator")]
)[0]
size = 13 - len(rule.pattern)
ean = rule.pattern + str(uuid.uuid4().fields[-1])[:size]
Expand Down

0 comments on commit 0f3996a

Please sign in to comment.