[REM] board: Remove the board.create model
It is no longer used in master.
This commit is contained in:
committed by
Yannick Tivisse
parent
7a44effd09
commit
dbb2642f44
@@ -15,7 +15,6 @@ Allows users to create custom dashboard.
|
||||
'depends': ['base', 'web'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'board_view.xml',
|
||||
'board_mydashboard_view.xml',
|
||||
'views/board.xml',
|
||||
],
|
||||
|
||||
@@ -77,81 +77,3 @@ class board_board(osv.osv):
|
||||
|
||||
archnode = etree.fromstring(encode(arch))
|
||||
return etree.tostring(remove_unauthorized_children(archnode), pretty_print=True)
|
||||
|
||||
|
||||
class board_create(osv.osv_memory):
|
||||
|
||||
def board_create(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1
|
||||
this = self.browse(cr, uid, ids[0], context=context)
|
||||
|
||||
view_arch = dedent("""<?xml version="1.0"?>
|
||||
<form string="%s" version="7.0">
|
||||
<board style="2-1">
|
||||
<column/>
|
||||
<column/>
|
||||
</board>
|
||||
</form>
|
||||
""".strip() % (this.name,))
|
||||
|
||||
view_id = self.pool.get('ir.ui.view').create(cr, uid, {
|
||||
'name': this.name,
|
||||
'model': 'board.board',
|
||||
'priority': 16,
|
||||
'type': 'form',
|
||||
'arch': view_arch,
|
||||
}, context=context)
|
||||
|
||||
action_id = self.pool.get('ir.actions.act_window').create(cr, uid, {
|
||||
'name': this.name,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'board.board',
|
||||
'usage': 'menu',
|
||||
'view_id': view_id,
|
||||
'help': dedent('''<div class="oe_empty_custom_dashboard">
|
||||
<p>
|
||||
<b>This dashboard is empty.</b>
|
||||
</p><p>
|
||||
To add the first report into this dashboard, go to any
|
||||
menu, switch to list or graph view, and click <i>'Add to
|
||||
Dashboard'</i> in the extended search options.
|
||||
</p><p>
|
||||
You can filter and group data before inserting into the
|
||||
dashboard using the search options.
|
||||
</p>
|
||||
</div>
|
||||
''')
|
||||
}, context=context)
|
||||
|
||||
menu_id = self.pool.get('ir.ui.menu').create(cr, SUPERUSER_ID, {
|
||||
'name': this.name,
|
||||
'parent_id': this.menu_parent_id.id,
|
||||
'action': 'ir.actions.act_window,%s' % (action_id,)
|
||||
}, context=context)
|
||||
|
||||
self.pool.get('board.board')._clear_list_cache()
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'reload',
|
||||
'params': {
|
||||
'menu_id': menu_id
|
||||
},
|
||||
}
|
||||
|
||||
def _default_menu_parent_id(self, cr, uid, context=None):
|
||||
_, menu_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'menu_reporting_dashboard')
|
||||
return menu_id
|
||||
|
||||
_name = "board.create"
|
||||
_description = "Board Creation"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Board Name', required=True),
|
||||
'menu_parent_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'menu_parent_id': _default_menu_parent_id,
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<!--My Dashboard Menu-->
|
||||
<menuitem
|
||||
id="menu_board_my_dash"
|
||||
parent="base.menu_reporting_dashboard"
|
||||
parent="base.menu_board_root"
|
||||
action="open_board_my_dash_action"
|
||||
sequence="5"/>
|
||||
</data>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_board_create" model="ir.ui.view">
|
||||
<field name="name">board.create.form</field>
|
||||
<field name="model">board.create</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create New Dashboard">
|
||||
<group colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="menu_parent_id"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Create" name="board_create" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-default" special="cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_board_create" model="ir.actions.act_window">
|
||||
<field name="name">Create Board</field>
|
||||
<field name="res_model">board.create</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_board_create"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_board_create"
|
||||
id="menu_board_create" parent="base.menu_reporting_config"
|
||||
groups="base.group_no_one"
|
||||
sequence="2"/>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -60,6 +60,6 @@
|
||||
<field name="act_window_id" ref="action_ir_attachment_google_spreadsheet_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_reporting_dashboard_google_spreadsheets" parent="base.menu_reporting_dashboard" action="action_ir_attachment_google_spreadsheet_tree"/>
|
||||
<menuitem id="menu_reporting_dashboard_google_spreadsheets" parent="base.menu_board_root" action="action_ir_attachment_google_spreadsheet_tree"/>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user