Merge lp:~ajite/openobject-addons/elico-7.0-add-0002 into lp:~openerp-community/openobject-addons/elico-7.0

Status: Merged
Approved by: Eric Caudal - www.elico-corp.com
Approved revision: no longer in the source branch.
Merged at revision: 32
Proposed branch: lp:~ajite/openobject-addons/elico-7.0-add-0002
Merge into: lp:~openerp-community/openobject-addons/elico-7.0
Diff against target: 695 lines (+558/-5)
17 files modified
mail_organizer/__init__.py (+24/-0)
mail_organizer/__openerp__.py (+50/-0)
mail_organizer/message.py (+29/-0)
mail_organizer/model.py (+29/-0)
mail_organizer/model_view.xml (+41/-0)
mail_organizer/static/src/css/mail.css (+24/-0)
mail_organizer/static/src/js/mail.js (+53/-0)
mail_organizer/static/src/xml/mail.xml (+8/-0)
mail_organizer/wizard/__init__.py (+22/-0)
mail_organizer/wizard/wizard_mail_organizer.py (+108/-0)
mail_organizer/wizard/wizard_mail_organizer_view.xml (+34/-0)
web_adblock/__init__.py (+2/-2)
web_adblock/__openerp__.py (+3/-3)
web_adblock/static/src/js/announcement.js (+20/-0)
web_polymorphic/__init__.py (+21/-0)
web_polymorphic/__openerp__.py (+43/-0)
web_polymorphic/static/src/js/view_form.js (+47/-0)
To merge this branch: bzr merge lp:~ajite/openobject-addons/elico-7.0-add-0002
Reviewer Review Type Date Requested Status
LIN Yu Approve
Review via email: mp+207818@code.launchpad.net

Description of the change

Added web polymorphic module:
This module adds a new field named polymorphic.

Added Mail Organizer
This module allows a user to organize his email easily.

Added a log for the web adblock extension.

To post a comment you must log in.
Revision history for this message
LIN Yu (lin-yu) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'mail_organizer'
2=== added file 'mail_organizer/__init__.py'
3--- mail_organizer/__init__.py 1970-01-01 00:00:00 +0000
4+++ mail_organizer/__init__.py 2014-02-23 07:15:07 +0000
5@@ -0,0 +1,24 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
11+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+import model
28+import message
29+import wizard
30
31=== added file 'mail_organizer/__openerp__.py'
32--- mail_organizer/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ mail_organizer/__openerp__.py 2014-02-23 07:15:07 +0000
34@@ -0,0 +1,50 @@
35+# -*- coding: utf-8 -*-
36+##############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
40+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
41+#
42+# This program is free software: you can redistribute it and/or modify
43+# it under the terms of the GNU Affero General Public License as
44+# published by the Free Software Foundation, either version 3 of the
45+# License, or (at your option) any later version.
46+#
47+# This program is distributed in the hope that it will be useful,
48+# but WITHOUT ANY WARRANTY; without even the implied warranty of
49+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+# GNU Affero General Public License for more details.
51+#
52+# You should have received a copy of the GNU Affero General Public License
53+# along with this program. If not, see <http://www.gnu.org/licenses/>.
54+#
55+##############################################################################
56+{'name': 'Mail Organizer',
57+ 'version': '0.1',
58+ 'category': 'Social Network',
59+ 'depends': ['web_polymorphic', 'mail'],
60+ 'author': 'Elico Corp',
61+ 'license': 'AGPL-3',
62+ 'website': 'https://www.elico-corp.com',
63+ 'description': """
64+This module allows you to assign a message to an existing or
65+a new resource dynamically.
66+
67+You can configure the available model through
68+"Settings" -> "Technical" -> "Email Organizer"
69+""",
70+ 'images': [],
71+ 'demo': [],
72+ 'data': ['wizard/wizard_mail_organizer_view.xml',
73+ 'model_view.xml'],
74+ 'qweb': [
75+ 'static/src/xml/mail.xml'
76+ ],
77+ 'js': [
78+ 'static/src/js/mail.js'
79+ ],
80+ 'css': [
81+ 'static/src/css/mail.css'
82+ ],
83+ 'installable': True,
84+ 'application': False}
85
86=== added file 'mail_organizer/message.py'
87--- mail_organizer/message.py 1970-01-01 00:00:00 +0000
88+++ mail_organizer/message.py 2014-02-23 07:15:07 +0000
89@@ -0,0 +1,29 @@
90+# -*- coding: utf-8 -*-
91+##############################################################################
92+#
93+# OpenERP, Open Source Management Solution
94+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
95+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
96+#
97+# This program is free software: you can redistribute it and/or modify
98+# it under the terms of the GNU Affero General Public License as
99+# published by the Free Software Foundation, either version 3 of the
100+# License, or (at your option) any later version.
101+#
102+# This program is distributed in the hope that it will be useful,
103+# but WITHOUT ANY WARRANTY; without even the implied warranty of
104+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105+# GNU Affero General Public License for more details.
106+#
107+# You should have received a copy of the GNU Affero General Public License
108+# along with this program. If not, see <http://www.gnu.org/licenses/>.
109+#
110+##############################################################################
111+from openerp.osv import fields, orm
112+
113+
114+class mail_message(orm.Model):
115+ _inherit = 'mail.message'
116+ _columns = {
117+ 'name': fields.char('Name')
118+ }
119
120=== added file 'mail_organizer/model.py'
121--- mail_organizer/model.py 1970-01-01 00:00:00 +0000
122+++ mail_organizer/model.py 2014-02-23 07:15:07 +0000
123@@ -0,0 +1,29 @@
124+# -*- coding: utf-8 -*-
125+##############################################################################
126+#
127+# OpenERP, Open Source Management Solution
128+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
129+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
130+#
131+# This program is free software: you can redistribute it and/or modify
132+# it under the terms of the GNU Affero General Public License as
133+# published by the Free Software Foundation, either version 3 of the
134+# License, or (at your option) any later version.
135+#
136+# This program is distributed in the hope that it will be useful,
137+# but WITHOUT ANY WARRANTY; without even the implied warranty of
138+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
139+# GNU Affero General Public License for more details.
140+#
141+# You should have received a copy of the GNU Affero General Public License
142+# along with this program. If not, see <http://www.gnu.org/licenses/>.
143+#
144+##############################################################################
145+from openerp.osv import fields, orm
146+
147+
148+class ir_model(orm.Model):
149+ _inherit = 'ir.model'
150+ _columns = {
151+ 'mail_organizer': fields.boolean('Use in Mail Organizer')
152+ }
153
154=== added file 'mail_organizer/model_view.xml'
155--- mail_organizer/model_view.xml 1970-01-01 00:00:00 +0000
156+++ mail_organizer/model_view.xml 2014-02-23 07:15:07 +0000
157@@ -0,0 +1,41 @@
158+<?xml version="1.0" encoding="UTF-8"?>
159+<openerp>
160+ <data>
161+ <record id="view_model_form" model="ir.ui.view">
162+ <field name="name">ir.model.form</field>
163+ <field name="model">ir.model</field>
164+ <field name="inherit_id" ref="base.view_model_form" />
165+ <field name="arch" type="xml" >
166+ <field name="modules" position="after">
167+ <field name="mail_organizer" />
168+ </field>
169+ </field>
170+ </record>
171+
172+ <record id="view_model_tree_editable" model="ir.ui.view">
173+ <field name="name">Ir Model editable tree</field>
174+ <field name="model">ir.model</field>
175+ <field name="arch" type="xml" >
176+ <tree string="Mail Organizer" editable="bottom">
177+ <field name="name" readonly="1" />
178+ <field name="model" readonly="1" />
179+ <field name="mail_organizer" />
180+ </tree>
181+ </field>
182+ </record>
183+
184+
185+ <record model="ir.actions.act_window" id="action_mail_organizer">
186+ <field name="name">Email organizer</field>
187+ <field name="view_id" ref="view_model_tree_editable"/>
188+ <field name="res_model">ir.model</field>
189+ <field name="view_type">form</field>
190+ <field name="usage">menu</field>
191+ </record>
192+
193+ <menuitem id="menu_email_organizer"
194+ name="Email Organizer"
195+ action="action_mail_organizer"
196+ parent="base.menu_email" />
197+ </data>
198+</openerp>
199\ No newline at end of file
200
201=== added directory 'mail_organizer/static'
202=== added directory 'mail_organizer/static/src'
203=== added directory 'mail_organizer/static/src/css'
204=== added file 'mail_organizer/static/src/css/mail.css'
205--- mail_organizer/static/src/css/mail.css 1970-01-01 00:00:00 +0000
206+++ mail_organizer/static/src/css/mail.css 2014-02-23 07:15:07 +0000
207@@ -0,0 +1,24 @@
208+/******************************************************************************
209+*
210+* OpenERP, Open Source Management Solution
211+* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
212+* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
213+*
214+* This program is free software: you can redistribute it and/or modify
215+* it under the terms of the GNU Affero General Public License as
216+* published by the Free Software Foundation, either version 3 of the
217+* License, or (at your option) any later version.
218+*
219+* This program is distributed in the hope that it will be useful,
220+* but WITHOUT ANY WARRANTY; without even the implied warranty of
221+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
222+* GNU Affero General Public License for more details.
223+*
224+* You should have received a copy of the GNU Affero General Public License
225+* along with this program. If not, see <http://www.gnu.org/licenses/>.
226+*
227+******************************************************************************/
228+.openerp .oe_mail .oe_msg .oe_msg_icons .oe_assign:hover a{
229+ color: #1fc0ff;
230+ text-shadow: 0px 1px #184fc5,0px -1px #184fc5, -1px 0px #184fc5, 1px 0px #184fc5, 0px 3px 3px rgba(0,0,0,0.1);
231+}
232
233=== added directory 'mail_organizer/static/src/img'
234=== added file 'mail_organizer/static/src/img/icon.png'
235Binary files mail_organizer/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and mail_organizer/static/src/img/icon.png 2014-02-23 07:15:07 +0000 differ
236=== added directory 'mail_organizer/static/src/js'
237=== added file 'mail_organizer/static/src/js/mail.js'
238--- mail_organizer/static/src/js/mail.js 1970-01-01 00:00:00 +0000
239+++ mail_organizer/static/src/js/mail.js 2014-02-23 07:15:07 +0000
240@@ -0,0 +1,53 @@
241+/******************************************************************************
242+*
243+* OpenERP, Open Source Management Solution
244+* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
245+* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
246+*
247+* This program is free software: you can redistribute it and/or modify
248+* it under the terms of the GNU Affero General Public License as
249+* published by the Free Software Foundation, either version 3 of the
250+* License, or (at your option) any later version.
251+*
252+* This program is distributed in the hope that it will be useful,
253+* but WITHOUT ANY WARRANTY; without even the implied warranty of
254+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
255+* GNU Affero General Public License for more details.
256+*
257+* You should have received a copy of the GNU Affero General Public License
258+* along with this program. If not, see <http://www.gnu.org/licenses/>.
259+*
260+******************************************************************************/
261+openerp.mail_organizer = function (instance) {
262+ var mail = instance.mail;
263+ var QWeb = instance.web.qweb;
264+ window.yep = instance;
265+ mail.ThreadMessage = mail.ThreadMessage.extend({
266+ template: 'mail.thread.message',
267+ events: {
268+ 'click .oe_assign': 'open_wizard',
269+ },
270+
271+ start: function () {
272+ this._super.apply(this, arguments);
273+ },
274+
275+ open_wizard: function() {
276+ var self = this;
277+ var context = {
278+ 'active_id': this.id,
279+ };
280+ var action = {
281+ type: 'ir.actions.act_window',
282+ res_model: 'wizard.mail.organizer',
283+ view_mode: 'form',
284+ view_type: 'form',
285+ views: [[false, 'form']],
286+ target: 'new',
287+ context: context,
288+ };
289+ self.do_action(action);
290+ }
291+
292+ });
293+};
294\ No newline at end of file
295
296=== added directory 'mail_organizer/static/src/xml'
297=== added file 'mail_organizer/static/src/xml/mail.xml'
298--- mail_organizer/static/src/xml/mail.xml 1970-01-01 00:00:00 +0000
299+++ mail_organizer/static/src/xml/mail.xml 2014-02-23 07:15:07 +0000
300@@ -0,0 +1,8 @@
301+<?xml version="1.0" encoding="UTF-8"?>
302+<template>
303+ <t t-extend="mail.thread.message">
304+ <t t-jquery=".oe_msg_icons span:first-child()" t-operation="after">
305+ <span class="oe_assign"><a title="Assign to" class="oe_e">C</a></span>
306+ </t>
307+ </t>
308+</template>
309\ No newline at end of file
310
311=== added directory 'mail_organizer/wizard'
312=== added file 'mail_organizer/wizard/__init__.py'
313--- mail_organizer/wizard/__init__.py 1970-01-01 00:00:00 +0000
314+++ mail_organizer/wizard/__init__.py 2014-02-23 07:15:07 +0000
315@@ -0,0 +1,22 @@
316+# -*- coding: utf-8 -*-
317+##############################################################################
318+#
319+# OpenERP, Open Source Management Solution
320+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
321+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
322+#
323+# This program is free software: you can redistribute it and/or modify
324+# it under the terms of the GNU Affero General Public License as
325+# published by the Free Software Foundation, either version 3 of the
326+# License, or (at your option) any later version.
327+#
328+# This program is distributed in the hope that it will be useful,
329+# but WITHOUT ANY WARRANTY; without even the implied warranty of
330+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
331+# GNU Affero General Public License for more details.
332+#
333+# You should have received a copy of the GNU Affero General Public License
334+# along with this program. If not, see <http://www.gnu.org/licenses/>.
335+#
336+##############################################################################
337+import wizard_mail_organizer
338
339=== added file 'mail_organizer/wizard/wizard_mail_organizer.py'
340--- mail_organizer/wizard/wizard_mail_organizer.py 1970-01-01 00:00:00 +0000
341+++ mail_organizer/wizard/wizard_mail_organizer.py 2014-02-23 07:15:07 +0000
342@@ -0,0 +1,108 @@
343+# -*- coding: utf-8 -*-
344+##############################################################################
345+#
346+# OpenERP, Open Source Management Solution
347+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
348+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
349+#
350+# This program is free software: you can redistribute it and/or modify
351+# it under the terms of the GNU Affero General Public License as
352+# published by the Free Software Foundation, either version 3 of the
353+# License, or (at your option) any later version.
354+#
355+# This program is distributed in the hope that it will be useful,
356+# but WITHOUT ANY WARRANTY; without even the implied warranty of
357+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
358+# GNU Affero General Public License for more details.
359+#
360+# You should have received a copy of the GNU Affero General Public License
361+# along with this program. If not, see <http://www.gnu.org/licenses/>.
362+#
363+##############################################################################
364+from openerp.osv import fields, osv
365+
366+
367+class wizard_mail_organizer(osv.osv_memory):
368+ _name = 'wizard.mail.organizer'
369+
370+ def _select_models(self, cr, uid, context=None):
371+ module_pool = self.pool.get('ir.model')
372+ module_ids = module_pool.search(
373+ cr, uid, [('mail_organizer', '=', True)],
374+ order="name", context=context)
375+ modules = module_pool.browse(cr, uid, module_ids, context=context)
376+ return [(m.model, m.name) for m in modules]
377+
378+ def _get_default_message_id(self, cr, uid, context=None):
379+ return context.get('active_id', None)
380+
381+ _columns = {
382+ 'message_id': fields.many2one(
383+ 'mail.message', string="Message", required=True),
384+ 'res': fields.char('Ressource', readonly=True),
385+ 'model': fields.selection(
386+ _select_models, string="Model", readonly=True),
387+ 'new_res_id': fields.integer("New resource"),
388+ 'new_model': fields.selection(_select_models, string="New model"),
389+ 'subject': fields.char('Subject', readonly=True),
390+ 'author_id': fields.many2one(
391+ 'res.partner', string='Author', readonly=True),
392+ 'has_domain': fields.boolean('Filter by partner'),
393+ 'is_domain_visible': fields.boolean('Is domain visible')
394+ }
395+
396+ _defaults = {
397+ 'message_id': lambda self, cr, uid, c: (
398+ self._get_default_message_id(cr, uid, context=c)),
399+ 'has_domain': True,
400+ 'is_domain_visible': False
401+ }
402+
403+ def onchange_new_model(self, cr, uid, ids, new_model, has_domain,
404+ author_id, context=None):
405+ res = {}
406+ vals = {'new_res_id': None}
407+ domain = {'new_res_id': []}
408+ if new_model and has_domain:
409+ obj_pool = self.pool.get(new_model)
410+ vals.update({'is_domain_visible': False})
411+ if 'partner_id' in obj_pool._columns:
412+ domain = {'new_res_id': [('partner_id', '=', author_id)]}
413+ vals.update({'is_domain_visible': True})
414+ res.update({'value': vals, 'domain': domain})
415+ return res
416+
417+ def onchange_message_id(self, cr, uid, ids, message_id, context=None):
418+ res = {}
419+ if not message_id:
420+ return res
421+ vals = {}
422+ message_pool = self.pool.get('mail.message')
423+ message = message_pool.browse(
424+ cr, uid, message_id, context=context)
425+ resource = ''
426+ if message.model and message.res_id:
427+ obj_pool = self.pool.get(message.model)
428+ obj = obj_pool.browse(
429+ cr, uid, message.res_id, context=context)
430+ resource = getattr(obj, obj._rec_name)
431+ vals.update({
432+ 'model': message.model,
433+ 'res': resource,
434+ 'author_id': (message.author_id and message.author_id.id
435+ or None),
436+ 'subject': message.subject
437+ })
438+ res.update({'value': vals})
439+ return res
440+
441+ def confirm(self, cr, uid, ids, context=None):
442+ message_pool = self.pool.get('mail.message')
443+ for wz in self.browse(cr, uid, ids, context=context):
444+ data = {'model': wz.new_model, 'res_id': wz.new_res_id}
445+ message_pool.write(
446+ cr, uid, wz.message_id.id, data, context=context)
447+ return {
448+ 'type': 'ir.actions.client',
449+ 'tag': 'reload'
450+ }
451
452=== added file 'mail_organizer/wizard/wizard_mail_organizer_view.xml'
453--- mail_organizer/wizard/wizard_mail_organizer_view.xml 1970-01-01 00:00:00 +0000
454+++ mail_organizer/wizard/wizard_mail_organizer_view.xml 2014-02-23 07:15:07 +0000
455@@ -0,0 +1,34 @@
456+<?xml version="1.0" encoding="UTF-8"?>
457+<openerp>
458+ <data>
459+ <record model="ir.ui.view" id="wizard_mail_organizer_form">
460+ <field name="name">wizard_mail_organizer.form</field>
461+ <field name="model">wizard.mail.organizer</field>
462+ <field name="type">form</field>
463+ <field name="arch" type="xml">
464+ <form string="Wizard Mail Organizer" version="7.0">
465+ <header>
466+ <h2 class="oe_title">Assign email to another resource</h2>
467+ </header>
468+ <field name="message_id" invisible="True" on_change="onchange_message_id(message_id)" />
469+ <field name="is_domain_visible" invisible="True" />
470+ <group col="4" colspan="2">
471+ <field name="author_id" />
472+ <field name="subject" />
473+ <field name="model" />
474+ <field name="res" />
475+ <field name="new_model" colspan="2" on_change="onchange_new_model(new_model, has_domain, author_id)" />
476+ <field name="new_res_id" colspan="2" widget="polymorphic" polymorphic="new_model"/>
477+ <field name="has_domain"
478+ on_change="onchange_new_model(new_model, has_domain, author_id)"
479+ attrs="{'invisible':[('is_domain_visible', '=', False)]}" />
480+ </group>
481+ <footer>
482+ <button name="confirm" string="Assign" type="object" class="oe_highlight" />
483+ <button string="Cancel" class="oe_link" special="cancel"/>
484+ </footer>
485+ </form>
486+ </field>
487+ </record>
488+ </data>
489+</openerp>
490\ No newline at end of file
491
492=== modified file 'web_adblock/__init__.py'
493--- web_adblock/__init__.py 2013-12-28 06:25:35 +0000
494+++ web_adblock/__init__.py 2014-02-23 07:15:07 +0000
495@@ -2,8 +2,8 @@
496 ##############################################################################
497 #
498 # OpenERP, Open Source Management Solution
499-# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
500-# Augustin Cisterne-Kaas <augustin.cisterne-kaaas@elico-corp.com>
501+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
502+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
503 #
504 # This program is free software: you can redistribute it and/or modify
505 # it under the terms of the GNU Affero General Public License as
506
507=== modified file 'web_adblock/__openerp__.py'
508--- web_adblock/__openerp__.py 2013-12-28 06:25:35 +0000
509+++ web_adblock/__openerp__.py 2014-02-23 07:15:07 +0000
510@@ -2,8 +2,8 @@
511 ##############################################################################
512 #
513 # OpenERP, Open Source Management Solution
514-# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
515-# Augustin Cisterne-Kaas <augustin.cisterne-kaaas@elico-corp.com>
516+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
517+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
518 #
519 # This program is free software: you can redistribute it and/or modify
520 # it under the terms of the GNU Affero General Public License as
521@@ -22,7 +22,7 @@
522 {
523 'name': 'OpenERP Adblock',
524 'version': '0.1',
525- 'category': '',
526+ 'category': 'Web',
527 'depends': ['mail'],
528 'author': 'Elico Corp',
529 'license': 'AGPL-3',
530
531=== added file 'web_adblock/static/.DS_Store'
532Binary files web_adblock/static/.DS_Store 1970-01-01 00:00:00 +0000 and web_adblock/static/.DS_Store 2014-02-23 07:15:07 +0000 differ
533=== added directory 'web_adblock/static/src/img'
534=== added file 'web_adblock/static/src/img/icon.png'
535Binary files web_adblock/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and web_adblock/static/src/img/icon.png 2014-02-23 07:15:07 +0000 differ
536=== modified file 'web_adblock/static/src/js/announcement.js'
537--- web_adblock/static/src/js/announcement.js 2013-12-28 06:25:35 +0000
538+++ web_adblock/static/src/js/announcement.js 2014-02-23 07:15:07 +0000
539@@ -1,3 +1,23 @@
540+/******************************************************************************
541+*
542+* OpenERP, Open Source Management Solution
543+* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
544+* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
545+*
546+* This program is free software: you can redistribute it and/or modify
547+* it under the terms of the GNU Affero General Public License as
548+* published by the Free Software Foundation, either version 3 of the
549+* License, or (at your option) any later version.
550+*
551+* This program is distributed in the hope that it will be useful,
552+* but WITHOUT ANY WARRANTY; without even the implied warranty of
553+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
554+* GNU Affero General Public License for more details.
555+*
556+* You should have received a copy of the GNU Affero General Public License
557+* along with this program. If not, see <http://www.gnu.org/licenses/>.
558+*
559+******************************************************************************/
560 openerp_announcement = function(instance) {
561
562 };
563\ No newline at end of file
564
565=== added directory 'web_polymorphic'
566=== added file 'web_polymorphic/__init__.py'
567--- web_polymorphic/__init__.py 1970-01-01 00:00:00 +0000
568+++ web_polymorphic/__init__.py 2014-02-23 07:15:07 +0000
569@@ -0,0 +1,21 @@
570+# -*- coding: utf-8 -*-
571+##############################################################################
572+#
573+# OpenERP, Open Source Management Solution
574+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
575+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
576+#
577+# This program is free software: you can redistribute it and/or modify
578+# it under the terms of the GNU Affero General Public License as
579+# published by the Free Software Foundation, either version 3 of the
580+# License, or (at your option) any later version.
581+#
582+# This program is distributed in the hope that it will be useful,
583+# but WITHOUT ANY WARRANTY; without even the implied warranty of
584+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
585+# GNU Affero General Public License for more details.
586+#
587+# You should have received a copy of the GNU Affero General Public License
588+# along with this program. If not, see <http://www.gnu.org/licenses/>.
589+#
590+##############################################################################
591
592=== added file 'web_polymorphic/__openerp__.py'
593--- web_polymorphic/__openerp__.py 1970-01-01 00:00:00 +0000
594+++ web_polymorphic/__openerp__.py 2014-02-23 07:15:07 +0000
595@@ -0,0 +1,43 @@
596+# -*- coding: utf-8 -*-
597+##############################################################################
598+#
599+# OpenERP, Open Source Management Solution
600+# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
601+# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
602+#
603+# This program is free software: you can redistribute it and/or modify
604+# it under the terms of the GNU Affero General Public License as
605+# published by the Free Software Foundation, either version 3 of the
606+# License, or (at your option) any later version.
607+#
608+# This program is distributed in the hope that it will be useful,
609+# but WITHOUT ANY WARRANTY; without even the implied warranty of
610+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
611+# GNU Affero General Public License for more details.
612+#
613+# You should have received a copy of the GNU Affero General Public License
614+# along with this program. If not, see <http://www.gnu.org/licenses/>.
615+#
616+##############################################################################
617+{'name': 'Web Polymorphic',
618+ 'version': '0.1',
619+ 'category': 'Web',
620+ 'depends': ['web'],
621+ 'author': 'Elico Corp',
622+ 'license': 'AGPL-3',
623+ 'website': 'https://www.elico-corp.com',
624+ 'description': """
625+Add a new widget named "polymorphic"
626+The polymorphic field allow to dynamically store an id linked to any model in
627+OpenERP instead of the usual fixed one in the view definition
628+
629+E.g:
630+
631+<field name="model" invisible="1" />
632+<field name="object_id" widget="polymorphic" polymorphic="model" />
633+""",
634+ 'js': [
635+ 'static/src/js/view_form.js'
636+ ],
637+ 'installable': True,
638+ 'application': False}
639
640=== added directory 'web_polymorphic/static'
641=== added file 'web_polymorphic/static/.DS_Store'
642Binary files web_polymorphic/static/.DS_Store 1970-01-01 00:00:00 +0000 and web_polymorphic/static/.DS_Store 2014-02-23 07:15:07 +0000 differ
643=== added directory 'web_polymorphic/static/src'
644=== added directory 'web_polymorphic/static/src/js'
645=== added file 'web_polymorphic/static/src/js/view_form.js'
646--- web_polymorphic/static/src/js/view_form.js 1970-01-01 00:00:00 +0000
647+++ web_polymorphic/static/src/js/view_form.js 2014-02-23 07:15:07 +0000
648@@ -0,0 +1,47 @@
649+/******************************************************************************
650+*
651+* OpenERP, Open Source Management Solution
652+* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
653+* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
654+*
655+* This program is free software: you can redistribute it and/or modify
656+* it under the terms of the GNU Affero General Public License as
657+* published by the Free Software Foundation, either version 3 of the
658+* License, or (at your option) any later version.
659+*
660+* This program is distributed in the hope that it will be useful,
661+* but WITHOUT ANY WARRANTY; without even the implied warranty of
662+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
663+* GNU Affero General Public License for more details.
664+*
665+* You should have received a copy of the GNU Affero General Public License
666+* along with this program. If not, see <http://www.gnu.org/licenses/>.
667+*
668+******************************************************************************/
669+openerp.web_polymorphic = function (instance) {
670+ instance.web.form.FieldPolymorphic = instance.web.form.FieldMany2One.extend( {
671+ template: "FieldMany2One",
672+ events: {
673+ 'focus input': function(e) {
674+ this.field.relation = this.field_manager.get_field_value(this.polymorphic);
675+ },
676+ 'click input': function(e) {
677+ this.field.relation = this.field_manager.get_field_value(this.polymorphic);
678+ }
679+ },
680+ init: function(field_manager, node) {
681+ this._super(field_manager, node);
682+ this.polymorphic = this.node.attrs.polymorphic;
683+ },
684+ render_editable: function() {
685+ var self = this;
686+ this.$drop_down = this.$el.find(".oe_m2o_drop_down_button");
687+ this.$drop_down.click(function() {
688+ self.polymorphic = self.node.attrs.polymorphic;
689+ self.field.relation = self.field_manager.get_field_value(self.polymorphic);
690+ });
691+ this._super();
692+ }
693+ });
694+ instance.web.form.widgets.add('polymorphic', 'instance.web.form.FieldPolymorphic')
695+};