mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
@@ -162,7 +162,31 @@ class BiSQLView(models.Model):
|
|||||||
model_id = fields.Many2one(
|
model_id = fields.Many2one(
|
||||||
string="Odoo Model", comodel_name="ir.model", readonly=True
|
string="Odoo Model", comodel_name="ir.model", readonly=True
|
||||||
)
|
)
|
||||||
|
# UI related fields
|
||||||
|
# 1. Editable fields, which can be set by the user (optional) before
|
||||||
|
# creating the UI elements
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _default_parent_menu_id(self):
|
||||||
|
return self.env.ref("bi_sql_editor.menu_bi_sql_editor")
|
||||||
|
|
||||||
|
parent_menu_id = fields.Many2one(
|
||||||
|
string="Parent Odoo Menu",
|
||||||
|
comodel_name="ir.ui.menu",
|
||||||
|
required=True,
|
||||||
|
readonly=True,
|
||||||
|
default=lambda self: self._default_parent_menu_id(),
|
||||||
|
states={
|
||||||
|
"draft": [("readonly", False)],
|
||||||
|
"sql_valid": [("readonly", False)],
|
||||||
|
"model_valid": [("readonly", False)],
|
||||||
|
},
|
||||||
|
help="By assigning a value to this field before manually creating the "
|
||||||
|
"UI, you're overwriting the parent menu on which the menu related to "
|
||||||
|
"the SQL report will be created.",
|
||||||
|
)
|
||||||
|
|
||||||
|
# 2. Readonly fields, non editable by the user
|
||||||
tree_view_id = fields.Many2one(
|
tree_view_id = fields.Many2one(
|
||||||
string="Odoo Tree View", comodel_name="ir.ui.view", readonly=True
|
string="Odoo Tree View", comodel_name="ir.ui.view", readonly=True
|
||||||
)
|
)
|
||||||
@@ -540,7 +564,7 @@ class BiSQLView(models.Model):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return {
|
return {
|
||||||
"name": self.name,
|
"name": self.name,
|
||||||
"parent_id": self.env.ref("bi_sql_editor.menu_bi_sql_editor").id,
|
"parent_id": self.parent_menu_id.id,
|
||||||
"action": "ir.actions.act_window,%s" % self.action_id.id,
|
"action": "ir.actions.act_window,%s" % self.action_id.id,
|
||||||
"sequence": self.sequence,
|
"sequence": self.sequence,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,5 +34,10 @@ To configure this module, you need to:
|
|||||||
.. figure:: ../static/description/04_materialized_view_setting.png
|
.. figure:: ../static/description/04_materialized_view_setting.png
|
||||||
:width: 800 px
|
:width: 800 px
|
||||||
|
|
||||||
|
* Before applying the final step, you will need to add a specific Parent Menu to
|
||||||
|
use when creating the UI Menu for the report. By default, it will be set with
|
||||||
|
the `SQL Views` menu, which can be changed before creating the UI elements in
|
||||||
|
order to have the report accessible from a different place within Odoo.
|
||||||
|
|
||||||
* Finally, click on 'Create UI', to create new menu, action, graph view and
|
* Finally, click on 'Create UI', to create new menu, action, graph view and
|
||||||
search view.
|
search view.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
* Sylvain LE GAL (https://twitter.com/legalsylvain)
|
* Sylvain LE GAL (https://twitter.com/legalsylvain)
|
||||||
* Richard deMeester, WilldooIT (http://www.willdooit.com/)
|
* Richard deMeester, WilldooIT (http://www.willdooit.com/)
|
||||||
* David James, WilldooIT (http://www.willdooit.com/)
|
* David James, WilldooIT (http://www.willdooit.com/)
|
||||||
|
* Guillem Casassas <guillem.casassas@forgeflow.com>
|
||||||
|
|
||||||
* This module is highly inspired by the work of
|
* This module is highly inspired by the work of
|
||||||
* Onestein: (http://www.onestein.nl/)
|
* Onestein: (http://www.onestein.nl/)
|
||||||
|
|||||||
@@ -225,12 +225,17 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group string="User Interface">
|
<group string="User Interface">
|
||||||
<field name="tree_view_id" />
|
<group string="UI Parameters">
|
||||||
<field name="graph_view_id" />
|
<field name="parent_menu_id" />
|
||||||
<field name="pivot_view_id" />
|
</group>
|
||||||
<field name="search_view_id" />
|
<group string="UI Instances">
|
||||||
<field name="action_id" />
|
<field name="tree_view_id" />
|
||||||
<field name="menu_id" />
|
<field name="graph_view_id" />
|
||||||
|
<field name="pivot_view_id" />
|
||||||
|
<field name="search_view_id" />
|
||||||
|
<field name="action_id" />
|
||||||
|
<field name="menu_id" />
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
Reference in New Issue
Block a user