| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
|
| 3 |
from odoo.addons.sale.tests.common import SaleCommon |
| 4 |
|
| 5 |
|
| 6 |
class SaleManagementCommon(SaleCommon): |
| 7 |
|
| 8 |
@classmethod |
| 9 |
def setUpClass(cls): |
| 10 |
super().setUpClass() |
| 11 |
|
| 12 |
# Ensure user has access to sale order templates |
| 13 |
cls.env.user.group_ids += cls.env.ref('sale_management.group_sale_order_template') |
| 14 |
|
| 15 |
cls.empty_order_template = cls.env['sale.order.template'].create({ |
| 16 |
'name': "Test Quotation Template", |
| 17 |
}) |
| 18 |
|
| 19 |
@staticmethod |
| 20 |
def _get_optional_product_lines(order): |
| 21 |
"""Returns the order lines that are optional products. """ |
| 22 |
return order.order_line.filtered( |
| 23 |
lambda line: not line.display_type and line._is_line_optional(), |
| 24 |
) |