oca-ocb-sale/odoo-bringout-oca-ocb-sale_management/sale_management/tests/common.py
Ernad Husremovic 73afc09215 19.0 vanilla
2026-03-09 09:32:12 +01:00

24 lines
785 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale.tests.common import SaleCommon
class SaleManagementCommon(SaleCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Ensure user has access to sale order templates
cls.env.user.group_ids += cls.env.ref('sale_management.group_sale_order_template')
cls.empty_order_template = cls.env['sale.order.template'].create({
'name': "Test Quotation Template",
})
@staticmethod
def _get_optional_product_lines(order):
"""Returns the order lines that are optional products. """
return order.order_line.filtered(
lambda line: not line.display_type and line._is_line_optional(),
)