diff --git a/frepple/controllers/outbound.py b/frepple/controllers/outbound.py index 6bb9431..c965202 100644 --- a/frepple/controllers/outbound.py +++ b/frepple/controllers/outbound.py @@ -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 = {} @@ -1002,6 +1008,7 @@ def export_items(self): "categ_id", "product_variant_ids", "route_ids", + "product_tag_ids", ] + ( [ @@ -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 '%s\n' % ( + yield '%s\n' % ( quoteattr(name), ( ("description=%s" % (quoteattr(description),)) @@ -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 "" + ), ( ( ""