| 1 |
|
| 2 |
|
| 3 |
from odoo.fields import Command |
| 4 |
from odoo.tests.common import HttpCase, tagged |
| 5 |
|
| 6 |
from odoo.addons.account.tests.common import AccountTestInvoicingCommon |
| 7 |
|
| 8 |
|
| 9 |
@tagged('post_install', '-at_install') |
| 10 |
class TestUi(AccountTestInvoicingCommon, HttpCase): |
| 11 |
|
| 12 |
@classmethod |
| 13 |
def setUpClass(cls): |
| 14 |
super().setUpClass() |
| 15 |
|
| 16 |
cls.agrolait = cls.env['res.partner'].create({'name': 'Agrolait', 'email': '[email protected]'}) |
| 17 |
|
| 18 |
def test_01_sale_tour(self): |
| 19 |
self.env.ref('base.user_admin').write({ |
| 20 |
'email': '[email protected]', |
| 21 |
}) |
| 22 |
self.start_tour("/odoo", 'sale_tour', login="admin") |
| 23 |
|
| 24 |
def test_04_portal_sale_signature_without_name_tour(self): |
| 25 |
"""The goal of this test is to make sure the portal user can sign SO even witout a name.""" |
| 26 |
self.agrolait.name = "" |
| 27 |
|
| 28 |
sales_order = self.env['sale.order'].sudo().create({ |
| 29 |
'name': 'test SO', |
| 30 |
'partner_id': self.agrolait.id, |
| 31 |
'state': 'sent', |
| 32 |
'require_payment': False, |
| 33 |
'order_line': [ |
| 34 |
Command.create({ |
| 35 |
'product_id': self.product.id, |
| 36 |
}) |
| 37 |
] |
| 38 |
}) |
| 39 |
action = sales_order.action_preview_sale_order() |
| 40 |
|
| 41 |
self.start_tour(action['url'], 'sale_signature_without_name', login="admin") |