Skip to content

Commit

Permalink
Merge pull request #504 from frePPLe/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream frePPLe/odoo (17.0)
  • Loading branch information
bt-admin authored Feb 19, 2025
2 parents 4aff5df + 471b69f commit 5ad9ba8
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions frepple/controllers/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,18 +1222,26 @@ def export_items(self):
if i["product_tmpl_id"][0] not in self.product_templates:
continue
tmpl = self.product_templates[i["product_tmpl_id"][0]]
if i["code"]:
# generate variant name and description in frepple
if i["product_template_attribute_value_ids"]:
if use_short_names:
name = (i["code"])[:300]
description = i["name"][:500]
else:
name = (
(("[%s] %s %s" % (i["code"], i["name"], i["id"]))[:300])
if i["code"]
else "%s %s" % (i["name"], i["id"])[:300]
)
description = None
# generate name and description for non-variant products
elif i["code"]:
name = (
(("[%s] %s" % (i["code"], i["name"]))[:300])
if not use_short_names
else i["code"][:300]
)
description = i["name"][:500] if use_short_names else None
# product is a variant and has no internal reference
# we use the product id as code
elif i["product_template_attribute_value_ids"]:
name = ("[%s] %s" % (i["id"], i["name"]))[:300]
description = i["name"][:500] if use_short_names else None
else:
name = i["name"][:300]
description = i["name"][:500] if use_short_names else None
Expand Down

0 comments on commit 5ad9ba8

Please sign in to comment.