[MERGE] Implemented res widget.

bzr revid: vda@tinyerp.com-20101007092925-8vgld0kvm8pzy6c8
This commit is contained in:
vda (Open ERP) 2010-10-07 14:59:25 +05:30
commit bf36237765
6 changed files with 131 additions and 2 deletions

View File

@ -73,13 +73,14 @@
'security/base_security.xml',
'maintenance/maintenance_view.xml',
'security/ir.model.access.csv'
'security/ir.model.access.csv',
'res/res_widget_view.xml',
],
'demo_xml': [
'base_demo.xml',
'res/partner/partner_demo.xml',
'res/partner/crm_demo.xml',
'res/res_widget_data.xml',
],
'test': [
'test/base_test.xml',

View File

@ -33,4 +33,5 @@ import res_request
import res_lang
import res_log
import ir_property
import res_widget

View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields,osv
class res_widget(osv.osv):
_name = "res.widget"
_rec_name = "title"
_columns = {
'title' : fields.char('Title', size=64),
'content': fields.text('Content')
}
res_widget()

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="openerp_twitter_favorites" model="res.widget">
<field name="title">OpenERP Favorites</field>
<field name="content"><![CDATA[
<script type="text/javascript" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script type="text/javascript">
new TWTR.Widget({
version: 2,
type: 'faves',
rpp: 10,
interval: 6000,
title: '',
subject: '',
width: 'auto',
height: 300,
theme: {
shell: {
background: '#F0EEEE',
color: '#444444'
},
tweets: {
background: '#F0EEEE',
color: '#444444',
links: '#9A0404'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
hashtags: true,
timestamp: true,
avatars: true,
behavior: 'all'
}
}).render().setUser('openerp').start();
</script>]]> </field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_res_widget_search" model="ir.ui.view">
<field name="name">res.widget.search</field>
<field name="model">res.widget</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Widget">
<field name="title" />
</search>
</field>
</record>
<record id="res_widget_form" model="ir.ui.view">
<field name="name">res.widget.form</field>
<field name="model">res.widget</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Widgets">
<field name="title"/>
<field name="content"/>
</form>
</field>
</record>
<record id="res_widget_tree" model="ir.ui.view">
<field name="name">res.widget.tree</field>
<field name="model">res.widget</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Widgets">
<field name="title"/>
</tree>
</field>
</record>
<record id="res_widget_act_window" model="ir.actions.act_window">
<field name="name">Widgets</field>
<field name="res_model">res.widget</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_res_widget_search"/>
</record>
<menuitem
action="res_widget_act_window"
id="menu_res_widget_act_window"
parent="base.next_id_2"
/>
</data>
</openerp>

View File

@ -120,3 +120,6 @@
"access_ir_filter employee","ir_filters employee","model_ir_filters","group_user",1,1,1,1
"access_ir_filters","ir_filters_all","model_ir_filters",,1,1,1,1
"access_res_partner_address","res.partner.address","model_res_partner_address","group_system",1,1,1,1
"access_res_widget","res.widget","model_res_widget","group_erp_manager",1,1,1,1
"access_res_widget_user","res.widget.user","model_res_widget",,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
120 access_ir_filter employee ir_filters employee model_ir_filters group_user 1 1 1 1
121 access_ir_filters ir_filters_all model_ir_filters 1 1 1 1
122 access_res_partner_address res.partner.address model_res_partner_address group_system 1 1 1 1
123 access_res_widget res.widget model_res_widget group_erp_manager 1 1 1 1
124 access_res_widget_user res.widget.user model_res_widget 1 0 0 0
125