Merge lp:~openerp-dev/openobject-addons/saas-4-certifications-rim into lp:~openerp/openobject-addons/saas-4

Proposed by Richard Mathot (Odoo, formerly OpenERP)
Status: Merged
Merged at revision: 9359
Proposed branch: lp:~openerp-dev/openobject-addons/saas-4-certifications-rim
Merge into: lp:~openerp/openobject-addons/saas-4
Diff against target: 325 lines (+282/-0)
8 files modified
website_certification/__init__.py (+23/-0)
website_certification/__openerp__.py (+38/-0)
website_certification/certification.py (+43/-0)
website_certification/controllers/__init__.py (+22/-0)
website_certification/controllers/main.py (+49/-0)
website_certification/security/ir.model.access.csv (+7/-0)
website_certification/views/website_certification_templates.xml (+42/-0)
website_certification/views/website_certification_views.xml (+58/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/saas-4-certifications-rim
Reviewer Review Type Date Requested Status
Richard Mathot (Odoo, formerly OpenERP) (community) Approve
Review via email: mp+216441@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Richard Mathot (Odoo, formerly OpenERP) (rim-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'website_certification'
2=== added file 'website_certification/__init__.py'
3--- website_certification/__init__.py 1970-01-01 00:00:00 +0000
4+++ website_certification/__init__.py 2014-04-18 13:00:40 +0000
5@@ -0,0 +1,23 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+
27+import certification
28+import controllers
29
30=== added file 'website_certification/__openerp__.py'
31--- website_certification/__openerp__.py 1970-01-01 00:00:00 +0000
32+++ website_certification/__openerp__.py 2014-04-18 13:00:40 +0000
33@@ -0,0 +1,38 @@
34+# -*- encoding: utf-8 -*-
35+##############################################################################
36+#
37+# OpenERP, Open Source Management Solution
38+# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
39+#
40+# This program is free software: you can redistribute it and/or modify
41+# it under the terms of the GNU Affero General Public License as
42+# published by the Free Software Foundation, either version 3 of the
43+# License, or (at your option) any later version.
44+#
45+# This program is distributed in the hope that it will be useful,
46+# but WITHOUT ANY WARRANTY; without even the implied warranty of
47+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48+# GNU Affero General Public License for more details.
49+#
50+# You should have received a copy of the GNU Affero General Public License
51+# along with this program. If not, see <http://www.gnu.org/licenses/>.
52+#
53+##############################################################################
54+
55+{
56+ 'name': 'Certified People',
57+ 'category': 'Website',
58+ 'summary': 'Display your network of certified people on your website',
59+ 'version': '1.0',
60+ 'author': 'OpenERP S.A.',
61+ 'depends': ['marketing', 'website'],
62+ 'description': """
63+ Display your network of certified people on your website
64+ """,
65+ 'data': [
66+ 'security/ir.model.access.csv',
67+ 'views/website_certification_views.xml',
68+ 'views/website_certification_templates.xml',
69+ ],
70+ 'installable': True,
71+}
72
73=== added file 'website_certification/certification.py'
74--- website_certification/certification.py 1970-01-01 00:00:00 +0000
75+++ website_certification/certification.py 2014-04-18 13:00:40 +0000
76@@ -0,0 +1,43 @@
77+# -*- encoding: utf-8 -*-
78+##############################################################################
79+#
80+# OpenERP, Open Source Management Solution
81+# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
82+#
83+# This program is free software: you can redistribute it and/or modify
84+# it under the terms of the GNU Affero General Public License as
85+# published by the Free Software Foundation, either version 3 of the
86+# License, or (at your option) any later version.
87+#
88+# This program is distributed in the hope that it will be useful,
89+# but WITHOUT ANY WARRANTY; without even the implied warranty of
90+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91+# GNU Affero General Public License for more details.
92+#
93+# You should have received a copy of the GNU Affero General Public License
94+# along with this program. If not, see <http://www.gnu.org/licenses/>.
95+#
96+##############################################################################
97+
98+
99+from openerp.osv import osv, fields
100+
101+
102+class certification_type(osv.Model):
103+ _name = 'certification.type'
104+ _order = 'name ASC'
105+ _columns = {
106+ 'name': fields.char("Certification Type", required=True)
107+ }
108+
109+
110+class certification_certification(osv.Model):
111+ _name = 'certification.certification'
112+ _order = 'certification_date DESC'
113+ _columns = {
114+ 'partner_id': fields.many2one('res.partner', string="Partner", required=True),
115+ 'type_id': fields.many2one('certification.type', string="Certification", required=True),
116+ 'certification_date': fields.date("Certification Date", required=True),
117+ 'certification_score': fields.char("Certification Score", required=True),
118+ 'certification_hidden_score': fields.boolean("Hide score on website?")
119+ }
120
121=== added directory 'website_certification/controllers'
122=== added file 'website_certification/controllers/__init__.py'
123--- website_certification/controllers/__init__.py 1970-01-01 00:00:00 +0000
124+++ website_certification/controllers/__init__.py 2014-04-18 13:00:40 +0000
125@@ -0,0 +1,22 @@
126+# -*- encoding: utf-8 -*-
127+##############################################################################
128+#
129+# OpenERP, Open Source Management Solution
130+# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
131+#
132+# This program is free software: you can redistribute it and/or modify
133+# it under the terms of the GNU Affero General Public License as
134+# published by the Free Software Foundation, either version 3 of the
135+# License, or (at your option) any later version.
136+#
137+# This program is distributed in the hope that it will be useful,
138+# but WITHOUT ANY WARRANTY; without even the implied warranty of
139+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
140+# GNU Affero General Public License for more details.
141+#
142+# You should have received a copy of the GNU Affero General Public License
143+# along with this program. If not, see <http://www.gnu.org/licenses/>.
144+#
145+##############################################################################
146+
147+import main
148
149=== added file 'website_certification/controllers/main.py'
150--- website_certification/controllers/main.py 1970-01-01 00:00:00 +0000
151+++ website_certification/controllers/main.py 2014-04-18 13:00:40 +0000
152@@ -0,0 +1,49 @@
153+# -*- encoding: utf-8 -*-
154+##############################################################################
155+#
156+# OpenERP, Open Source Management Solution
157+# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
158+#
159+# This program is free software: you can redistribute it and/or modify
160+# it under the terms of the GNU Affero General Public License as
161+# published by the Free Software Foundation, either version 3 of the
162+# License, or (at your option) any later version.
163+#
164+# This program is distributed in the hope that it will be useful,
165+# but WITHOUT ANY WARRANTY; without even the implied warranty of
166+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
167+# GNU Affero General Public License for more details.
168+#
169+# You should have received a copy of the GNU Affero General Public License
170+# along with this program. If not, see <http://www.gnu.org/licenses/>.
171+#
172+##############################################################################
173+
174+
175+from openerp.addons.web import http
176+from openerp.addons.web.http import request
177+
178+
179+class WebsiteCertifiedPartners(http.Controller):
180+
181+ @http.route(['/certifications',
182+ '/certifications/<model("certification.type"):cert_type>'], type='http', auth='public',
183+ website=True, multilang=True)
184+ def certified_partners(self, cert_type=None, **post):
185+ cr, uid, context = request.cr, request.uid, request.context
186+ certification_obj = request.registry['certification.certification']
187+ cert_type_obj = request.registry['certification.type']
188+
189+ domain = []
190+ if cert_type:
191+ domain.append(('type_id', '=', cert_type.id))
192+
193+ certifications_ids = certification_obj.search(cr, uid, domain, context=context)
194+ certifications = certification_obj.browse(cr, uid, certifications_ids, context=context)
195+ types = cert_type_obj.browse(cr, uid, cert_type_obj.search(cr, uid, [], context=context), context=context)
196+ data = {
197+ 'certifications': certifications,
198+ 'types': types
199+ }
200+
201+ return request.website.render("website_certification.certified_partners", data)
202
203=== added directory 'website_certification/security'
204=== added file 'website_certification/security/ir.model.access.csv'
205--- website_certification/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
206+++ website_certification/security/ir.model.access.csv 2014-04-18 13:00:40 +0000
207@@ -0,0 +1,7 @@
208+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
209+access_certifications_public,certification.certification public,model_certification_certification,base.group_public,1,0,0,0
210+access_certifications_types_public,certification.type public,model_certification_type,base.group_public,1,0,0,0
211+access_certifications_users,certification.certification users,model_certification_certification,base.group_user,1,0,0,0
212+access_certifications_types_users,certification.type users,model_certification_type,base.group_user,1,0,0,0
213+access_certifications_marketing,certification.certification marketing,model_certification_certification,marketing.group_marketing_user,1,1,1,1
214+access_certifications_types_marketing,certification.type marketing,model_certification_type,marketing.group_marketing_user,1,1,1,1
215
216=== added directory 'website_certification/views'
217=== added file 'website_certification/views/website_certification_templates.xml'
218--- website_certification/views/website_certification_templates.xml 1970-01-01 00:00:00 +0000
219+++ website_certification/views/website_certification_templates.xml 2014-04-18 13:00:40 +0000
220@@ -0,0 +1,42 @@
221+<?xml version='1.0' encoding='utf-8'?>
222+<openerp>
223+<data>
224+ <template id="certified_partners" name="Certified People">
225+ <t t-call="website.layout">
226+ <div id="wrap">
227+ <div class="oe_structure"/>
228+ <div class="container">
229+ <div class="row">
230+ <h1>Certified People</h1>
231+ <div class="well">Filter by certification type:
232+ <a href="/certifications"><span class="badge">all</span></a>
233+ <t t-foreach="types" t-as="t">
234+ <a t-att-href="'/certifications/%s' % slug(t)"><span class="badge" t-field="t.name" /></a>
235+ </t>
236+ </div>
237+ <div class="table-responsive">
238+ <table class="table table-striped">
239+ <thead><tr>
240+ <th>Name</th>
241+ <th>Date</th>
242+ <th>Type</th>
243+ <th>Score</th>
244+ </tr></thead>
245+ <tbody>
246+ <tr t-foreach="certifications" t-as="c">
247+ <td><span t-field="c.partner_id"/></td>
248+ <td><span t-field="c.certification_date"/></td>
249+ <td><span t-field="c.type_id.name"/></td>
250+ <td><t t-if="c.certification_hidden_score == False"><span t-field="c.certification_score"/></t></td>
251+ </tr>
252+ </tbody>
253+ </table>
254+ </div>
255+ </div>
256+ </div>
257+ <div class="oe_structure"/>
258+ </div>
259+ </t>
260+</template>
261+</data>
262+</openerp>
263
264=== added file 'website_certification/views/website_certification_views.xml'
265--- website_certification/views/website_certification_views.xml 1970-01-01 00:00:00 +0000
266+++ website_certification/views/website_certification_views.xml 2014-04-18 13:00:40 +0000
267@@ -0,0 +1,58 @@
268+<?xml version='1.0' encoding='utf-8'?>
269+<openerp>
270+<data>
271+ <record model="ir.ui.view" id="certification_certification_tree">
272+ <field name="name">view.certification.certification.tree</field>
273+ <field name="model">certification.certification</field>
274+ <field name="arch" type="xml">
275+ <tree string="Granted Certifications">
276+ <field name="partner_id" />
277+ <field name="type_id" />
278+ <field name="certification_date" />
279+ <field name="certification_score" />
280+ <field name="certification_hidden_score" />
281+ </tree>
282+ </field>
283+ </record>
284+ <record model="ir.ui.view" id="certification_certification_form">
285+ <field name="name">view.certification.certification.form</field>
286+ <field name="model">certification.certification</field>
287+ <field name="arch" type="xml">
288+ <form string="Granted Certification" version="7.0">
289+ <sheet>
290+ <group nolabel="1">
291+ <field name="partner_id" />
292+ <field name="type_id" />
293+ <field name="certification_date" />
294+ <field name="certification_score" />
295+ <field name="certification_hidden_score" />
296+ </group>
297+ </sheet>
298+ </form>
299+ </field>
300+ </record>
301+ <record model="ir.ui.view" id="certification_certification_search">
302+ <field name="name">view.certification.certification.search</field>
303+ <field name="model">certification.certification</field>
304+ <field name="arch" type="xml">
305+ <search string="Search Certification">
306+ <field name="partner_id" />
307+ <field name="type_id" />
308+ <group expand="0" string="Group By...">
309+ <filter string="Partner" name="group_by_partner" domain="[]" context="{'group_by': 'partner_id'}"/>
310+ <filter string="Type" name="group_by_type" domain="[]" context="{'group_by': 'type_id'}"/>
311+ </group>
312+ </search>
313+ </field>
314+ </record>
315+ <record model="ir.actions.act_window" id="action_certifications_list">
316+ <field name="name">Certifications</field>
317+ <field name="res_model">certification.certification</field>
318+ <field name="view_type">form</field>
319+ <field name="view_mode">tree,form</field>
320+ <field name="search_view_id" ref="certification_certification_search"/>
321+ </record>
322+ <menuitem name="Certifications" id="menu_certifications" parent="base.marketing_menu" sequence="35" />
323+ <menuitem name="Certifications" id="menu_certifications_list" action="action_certifications_list" parent="menu_certifications" sequence="1"/>
324+</data>
325+</openerp>

Subscribers

People subscribed via source and target branches