From 8e6cd12f9df3e6155d15446cf0d373a06110c32f Mon Sep 17 00:00:00 2001 From: Victor Feyens Date: Tue, 29 Mar 2022 16:02:10 +0000 Subject: [PATCH] [FIX] sale_management: correctly autocomplete uom on option lines Fixes a mistake from 0c468f6c2f160dec672bd25c673401b154b2709b where the uom autocompletion was lost and adds a test to make sure it won't happen again. closes odoo/odoo#87667 X-original-commit: 10bc8dc114511740d549dfc5261bc244e0a98ad9 Signed-off-by: Victor Feyens (vfe) --- addons/sale_management/tests/test_sale_order.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/sale_management/tests/test_sale_order.py b/addons/sale_management/tests/test_sale_order.py index 7fa30cd2906..c391d02608d 100644 --- a/addons/sale_management/tests/test_sale_order.py +++ b/addons/sale_management/tests/test_sale_order.py @@ -2,7 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.sale.tests.common import TestSaleCommon -from odoo.tests import tagged +from odoo.tests import Form, tagged @tagged('-at_install', 'post_install') @@ -338,3 +338,10 @@ class TestSaleOrder(TestSaleCommon): self.pl_option_discount, "If a pricelist is set without discount included," " the discount should be correctly computed.") + + def test_option_creation(self): + """Make sure the product uom is automatically added to the option when the product is specified""" + order_form = Form(self.sale_order) + with order_form.sale_order_option_ids.new() as option: + option.product_id = self.product_1 + self.assertTrue(bool(option.uom_id))