Skip to content

Commit

Permalink
Merge pull request #493 from frePPLe/18.0
Browse files Browse the repository at this point in the history
Syncing from upstream frePPLe/odoo (18.0)
  • Loading branch information
bt-admin authored Dec 5, 2024
2 parents ed5604f + 38acbc9 commit fc96109
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion frepple/controllers/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,12 @@ def export_items(self):
supplierinfo.sequence -> itemsupplier.priority
"""

# Read the product tags
product_tags = {
i["id"]: i["name"]
for i in self.generator.getData("product.tag", fields=["name"])
}

# Read the product templates
self.product_product = {}
self.product_template_product = {}
Expand All @@ -1002,6 +1008,7 @@ def export_items(self):
"categ_id",
"product_variant_ids",
"route_ids",
"product_tag_ids",
]
+ (
[
Expand Down Expand Up @@ -1123,7 +1130,7 @@ def export_items(self):
self.product_template_product[i["product_tmpl_id"][0]] = prod_obj

# For make-to-order items the next line needs to XML snippet ' type="item_mto"'.
yield '<item name=%s %s uom=%s volume="%f" weight="%f" cost="%f" subcategory="%s,%s"%s%s>%s\n' % (
yield '<item name=%s %s uom=%s volume="%f" weight="%f" cost="%f" subcategory="%s,%s"%s%s%s>%s\n' % (
quoteattr(name),
(
("description=%s" % (quoteattr(description),))
Expand Down Expand Up @@ -1151,6 +1158,22 @@ def export_items(self):
and tmpl["expiration_time"] > 0
else ""
),
(
(
" category=%s"
% quoteattr(
", ".join(
[
product_tags[i]
for i in tmpl["product_tag_ids"]
if i in product_tags
]
)
)
)
if tmpl["product_tag_ids"]
else ""
),
(
(
"<owner name=%s/>"
Expand Down

0 comments on commit fc96109

Please sign in to comment.