{"id":2014,"date":"2025-02-28T20:47:44","date_gmt":"2025-02-28T19:47:44","guid":{"rendered":"https:\/\/hobbykeller.spdns.de\/?p=2014"},"modified":"2025-02-28T20:49:41","modified_gmt":"2025-02-28T19:49:41","slug":"tryton-units-of-measure","status":"publish","type":"post","link":"https:\/\/hobbykeller.spdns.de\/?p=2014","title":{"rendered":"Tryton Units of Measure"},"content":{"rendered":"\n<div class=\"wp-block-simple-alerts-for-gutenberg-alert-boxes sab-alert sab-alert-info\" role=\"alert\">These instructions are based on the <a href=\"https:\/\/hub.docker.com\/layers\/tryton\/tryton\/7.0\/images\/sha256-9947ef6cb677b7e29d7432572b6328caae0bb4f72554066fe58ea9e15c55b6e0\">tryton\/tryton:7.0 Docker image<\/a>.<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">\u00d7<\/span><\/button><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Categories for Units of Measure<\/h2>\n\n\n\n<p>Each Unit of Measure (UoM) in Tryton belongs to one and only one pre-defined <strong>Category<\/strong> which normally tells us what the UoM is supposed to measure (e.g. time, energy, units).<\/p>\n\n\n\n<p>You can find a list of the pre-defined categories by selecting <strong>Products<\/strong> \/ <strong>Configuration<\/strong> \/ <strong>Units of Measure<\/strong> from the menu.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">UoM conversion<\/h2>\n\n\n\n<p><strong>Within each category <\/strong>measurements can be converted from one UoM to another. Keep in mind that conversion is impossible if two UoM do not belong to the same category. If you have one UoM that measures length (e.g. meter) and another one that measures weight (e.g. kilogram) there is no way to convert from meter to kilogram.<\/p>\n\n\n\n<p>On the other hand, <strong>inside a category, conversion can be done<\/strong>: if you have two UoM that both belong to the category volume &#8211; say litres and gallons &#8211; you can convert liters to US gallons by multiplying with <em>3.78541178<\/em>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Understanding Factor and Rate fields<\/h3>\n\n\n\n<p>Let&#8217;s have a look at volume conversions in Tryton. Here&#8217;s a liter UoM:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-15.png\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"434\" src=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-15.png\" alt=\"\" class=\"wp-image-2015\" srcset=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-15.png 977w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-15-300x133.png 300w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-15-768x341.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/a><figcaption class=\"wp-element-caption\">Tryton has Liter as the base unit for its volume UoM category<\/figcaption><\/figure>\n\n\n\n<p>Note that the fields factor and rate are both populated with the value 1. This is similar to the forex setup, where the base currency is the currency that has a conversion rate of 1 and the exchange rate of any currency other then the base currency is the amount of currency that you have to give for one unit of base currency.<\/p>\n\n\n\n<p>Likewise, for UoM, there is a base unit for each category and<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the Factor value tells you how many base units of the UoM category are contained in the non-base UoM you are setting up<\/li>\n\n\n\n<li>the Rate tells you how many of the new UoM are needed to complete one base unit in the category.<\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s check that with cubic meters. We know that cubic meters also belong to the Volume category, so the Factor should tell us how many liters are in 1 cubic meter, which is 1&#8217;000. Looking the other way round, we know 1 liter is 1\/1000 = 0.001 cubic meters, which should be the Rate in Tryton&#8217;s terminology. Does it work out? &#8211; Seems it does:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-16.png\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"434\" src=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-16.png\" alt=\"\" class=\"wp-image-2016\" srcset=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-16.png 977w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-16-300x133.png 300w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-16-768x341.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/a><figcaption class=\"wp-element-caption\">Factor and Rate fields for a non-base unit of measurement<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Example<\/h2>\n\n\n\n<p>Imagine we have the following situation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Our <strong>Product<\/strong> are barrels of 250l of ethanol. That puts us into some kind of dilemma first when we have to decide into which <strong>Category<\/strong> these barrels fit: is it <strong>Volume<\/strong> or <strong>Unit<\/strong>? As we want to sell by whole barrels and not by liter we will choose units. The appropriate category hinges on the <strong>business context<\/strong>: As long as we simply want to sell barrels without further processing them, we can treat a barrel as a unit. a producer who purchases the barrels for processing the ethanol to liquor which will later be sold in single bottles will certainly go for the volume unit. He could then set up a production process with a recipe that models how many bottles of liquor can be produced from one barrel.<\/li>\n\n\n\n<li>For our trading purposes, we buy the barrels container-wise. There are 134 barrels in a container. So we set up a new UoM in the Unit Category as follows:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-17.png\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"442\" src=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-17.png\" alt=\"\" class=\"wp-image-2018\" srcset=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-17.png 977w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-17-300x136.png 300w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-17-768x347.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/a><\/figure>\n\n\n\n<p>The <strong>Factor<\/strong> is the number of base units (single barrels) that make one of the UoM we are just creating (container of barrels). Once Tryton has got a value for the Factor field, it immediatly populates the <strong>Rate<\/strong> field with the reciprocal value.<\/p>\n\n\n\n<p>After having clicked the Save button, we can still update the translations as shown in an <a href=\"https:\/\/hobbykeller.spdns.de\/?p=1993\" data-type=\"post\" data-id=\"1993\">earlier post<\/a> on localization.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-18.png\"><img loading=\"lazy\" decoding=\"async\" width=\"926\" height=\"411\" src=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-18.png\" alt=\"\" class=\"wp-image-2019\" srcset=\"https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-18.png 926w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-18-300x133.png 300w, https:\/\/hobbykeller.spdns.de\/wp-content\/uploads\/2025\/02\/image-18-768x341.png 768w\" sizes=\"auto, (max-width: 926px) 100vw, 926px\" \/><\/a><\/figure>\n\n\n\n<p>Setting the translations for the UoM we just created<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Categories for Units of Measure Each Unit of Measure (UoM) in Tryton belongs to one and only one pre-defined Category which normally tells us what the UoM is supposed to<span class=\"more-button\"><a href=\"https:\/\/hobbykeller.spdns.de\/?p=2014\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Tryton Units of Measure<\/span><\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[374,64,254],"tags":[],"class_list":["post-2014","post","type-post","status-publish","format-standard","hentry","category-erp","category-linux","category-python"],"_links":{"self":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/2014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2014"}],"version-history":[{"count":2,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/2014\/revisions"}],"predecessor-version":[{"id":2020,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/2014\/revisions\/2020"}],"wp:attachment":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}