Files
odoo_source/addons/project/tests/test_project_sharing_ui.py
Xavier BOL (xbo) 8904dbd522 [REF] project: convert project sharing form view in OWL
Before this commit, the form view in project sharing was always in
legacy. Moreover, in that view, the chatter used is the portal one
and so it is also a legacy widget.

This commit converts the form view and then convert the chatter in
OWL to be able to correctly compile and add the chatter in the form
view.
Also, some styling has been done to remove the overflow. Only the
overflow on the y axis in the chatter can be scrolled on the page.

task-2947516

X-original-commit: 175430f3593337ce582cbec644b9d630894c074b
2022-10-10 17:03:06 +02:00

69 lines
2.6 KiB
Python

# -*- coding: utf-8 -*-
from odoo import Command
from odoo.tests import HttpCase, tagged
@tagged('post_install', '-at_install')
class TestProjectSharingUi(HttpCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
user = cls.env['res.users'].with_context({'no_reset_password': True, 'mail_create_nolog': True}).create({
'name': 'Georges',
'login': 'georges1',
'password': 'georges1',
'email': 'georges@project.portal',
'signature': 'SignGeorges',
'notification_type': 'email',
'groups_id': [Command.set([cls.env.ref('base.group_portal').id])],
})
cls.partner_portal = cls.env['res.partner'].with_context({'mail_create_nolog': True}).create({
'name': 'Georges',
'email': 'georges@project.portal',
'company_id': False,
'user_ids': [user.id],
})
cls.project_portal = cls.env['project.project'].with_context({'mail_create_nolog': True}).create({
'name': 'Project Sharing',
'privacy_visibility': 'portal',
'alias_name': 'project+sharing',
'partner_id': cls.partner_portal.id,
'type_ids': [
Command.create({'name': 'To Do', 'sequence': 1}),
Command.create({'name': 'Done', 'sequence': 10})
],
})
def test_01_project_sharing(self):
""" Test Project Sharing UI with an internal user """
self.start_tour("/web", 'project_sharing_tour', login="admin")
def test_02_project_sharing(self):
""" Test project sharing ui with a portal user.
The additional data created here are the data created in the first test with the tour js.
Since a problem to logout Mitchell Admin to log in as Georges user, this test is created
to launch a tour with portal user.
"""
project_share_wizard = self.env['project.share.wizard'].create({
'access_mode': 'edit',
'res_model': 'project.project',
'res_id': self.project_portal.id,
'partner_ids': [
Command.link(self.partner_portal.id),
],
})
project_share_wizard.action_send_mail()
self.project_portal.write({
'task_ids': [Command.create({
'name': "Test Project Sharing",
'stage_id': self.project_portal.type_ids.filtered(lambda stage: stage.sequence == 10)[:1].id,
})],
})
self.start_tour("/my/projects", 'portal_project_sharing_tour', login='georges1')