Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FW] [14.0][REF] s_packaging_calculator: remove unneeded   constant #2175

Merged
Merged
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
5 changes: 1 addition & 4 deletions stock_packaging_calculator/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# @author: Simone Orsi <simone.orsi@camptocamp.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl)

import unicodedata
from collections import namedtuple

from odoo import api, models
Expand All @@ -13,8 +12,6 @@
# Unify records as we mix up w/ UoM
Packaging = namedtuple("Packaging", "id name qty barcode is_unit")

NO_BREAK_SPACE_CHAR = unicodedata.lookup("NO-BREAK SPACE")


class Product(models.Model):
_inherit = "product.product"
Expand Down Expand Up @@ -209,7 +206,7 @@ def product_qty_by_packaging_as_str(
as_string.append(f"{unit_qty} {self.uom_id.name}")
# We want to avoid line break here as this string
# can be used by reports
res = f",{NO_BREAK_SPACE_CHAR}".join(as_string)
res = ",\N{NO-BREAK SPACE}".join(as_string)
if include_total_units and not has_only_units:
res += " " + self._qty_by_packaging_total_units(prod_qty)
return res
Expand Down
Loading