[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) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2022-04-04 11:27:58 +02:00
parent 4f79f80e51
commit 8e6cd12f9d
@@ -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))