mirror of
https://github.com/bringout/oca-ocb-report.git
synced 2026-04-21 17:02:06 +02:00
19.0 vanilla
This commit is contained in:
parent
62d197ac8b
commit
184bb0e321
667 changed files with 691406 additions and 239886 deletions
|
|
@ -0,0 +1,34 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import Command
|
||||
from odoo.tests.common import TransactionCase, new_test_user
|
||||
|
||||
class DashboardTestCommon(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.group = cls.env["res.groups"].create({"name": "test group"})
|
||||
cls.user = new_test_user(cls.env, login="Raoul")
|
||||
cls.user.group_ids |= cls.group + cls.env.ref('base.group_allow_export', raise_if_not_found=False)
|
||||
|
||||
def create_dashboard(self, group=None):
|
||||
dashboard_group = group or self.env["spreadsheet.dashboard.group"].create({
|
||||
"name": "Dashboard group"
|
||||
})
|
||||
dashboard = self.env["spreadsheet.dashboard"].create(
|
||||
{
|
||||
"name": "a dashboard",
|
||||
"group_ids": [Command.set(self.group.ids)],
|
||||
"dashboard_group_id": dashboard_group.id,
|
||||
}
|
||||
)
|
||||
return dashboard
|
||||
|
||||
def share_dashboard(self, dashboard):
|
||||
share = self.env["spreadsheet.dashboard.share"].create(
|
||||
{
|
||||
"dashboard_id": dashboard.id,
|
||||
"spreadsheet_data": dashboard.spreadsheet_data,
|
||||
}
|
||||
)
|
||||
return share
|
||||
Loading…
Add table
Add a link
Reference in a new issue