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
=== added directory 'mail_organizer'
=== added file 'mail_organizer/__init__.py'
--- mail_organizer/__init__.py 1970-01-01 00:00:00 +0000
+++ mail_organizer/__init__.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import model
23import message
24import wizard
025
=== added file 'mail_organizer/__openerp__.py'
--- mail_organizer/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mail_organizer/__openerp__.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,50 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{'name': 'Mail Organizer',
23 'version': '0.1',
24 'category': 'Social Network',
25 'depends': ['web_polymorphic', 'mail'],
26 'author': 'Elico Corp',
27 'license': 'AGPL-3',
28 'website': 'https://www.elico-corp.com',
29 'description': """
30This module allows you to assign a message to an existing or
31a new resource dynamically.
32
33You can configure the available model through
34"Settings" -> "Technical" -> "Email Organizer"
35""",
36 'images': [],
37 'demo': [],
38 'data': ['wizard/wizard_mail_organizer_view.xml',
39 'model_view.xml'],
40 'qweb': [
41 'static/src/xml/mail.xml'
42 ],
43 'js': [
44 'static/src/js/mail.js'
45 ],
46 'css': [
47 'static/src/css/mail.css'
48 ],
49 'installable': True,
50 'application': False}
051
=== added file 'mail_organizer/message.py'
--- mail_organizer/message.py 1970-01-01 00:00:00 +0000
+++ mail_organizer/message.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22from openerp.osv import fields, orm
23
24
25class mail_message(orm.Model):
26 _inherit = 'mail.message'
27 _columns = {
28 'name': fields.char('Name')
29 }
030
=== added file 'mail_organizer/model.py'
--- mail_organizer/model.py 1970-01-01 00:00:00 +0000
+++ mail_organizer/model.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22from openerp.osv import fields, orm
23
24
25class ir_model(orm.Model):
26 _inherit = 'ir.model'
27 _columns = {
28 'mail_organizer': fields.boolean('Use in Mail Organizer')
29 }
030
=== added file 'mail_organizer/model_view.xml'
--- mail_organizer/model_view.xml 1970-01-01 00:00:00 +0000
+++ mail_organizer/model_view.xml 2014-02-23 07:15:07 +0000
@@ -0,0 +1,41 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <record id="view_model_form" model="ir.ui.view">
5 <field name="name">ir.model.form</field>
6 <field name="model">ir.model</field>
7 <field name="inherit_id" ref="base.view_model_form" />
8 <field name="arch" type="xml" >
9 <field name="modules" position="after">
10 <field name="mail_organizer" />
11 </field>
12 </field>
13 </record>
14
15 <record id="view_model_tree_editable" model="ir.ui.view">
16 <field name="name">Ir Model editable tree</field>
17 <field name="model">ir.model</field>
18 <field name="arch" type="xml" >
19 <tree string="Mail Organizer" editable="bottom">
20 <field name="name" readonly="1" />
21 <field name="model" readonly="1" />
22 <field name="mail_organizer" />
23 </tree>
24 </field>
25 </record>
26
27
28 <record model="ir.actions.act_window" id="action_mail_organizer">
29 <field name="name">Email organizer</field>
30 <field name="view_id" ref="view_model_tree_editable"/>
31 <field name="res_model">ir.model</field>
32 <field name="view_type">form</field>
33 <field name="usage">menu</field>
34 </record>
35
36 <menuitem id="menu_email_organizer"
37 name="Email Organizer"
38 action="action_mail_organizer"
39 parent="base.menu_email" />
40 </data>
41</openerp>
0\ No newline at end of file42\ No newline at end of file
143
=== added directory 'mail_organizer/static'
=== added directory 'mail_organizer/static/src'
=== added directory 'mail_organizer/static/src/css'
=== added file 'mail_organizer/static/src/css/mail.css'
--- mail_organizer/static/src/css/mail.css 1970-01-01 00:00:00 +0000
+++ mail_organizer/static/src/css/mail.css 2014-02-23 07:15:07 +0000
@@ -0,0 +1,24 @@
1/******************************************************************************
2*
3* OpenERP, Open Source Management Solution
4* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
5* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
6*
7* This program is free software: you can redistribute it and/or modify
8* it under the terms of the GNU Affero General Public License as
9* published by the Free Software Foundation, either version 3 of the
10* License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU Affero General Public License for more details.
16*
17* You should have received a copy of the GNU Affero General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*
20******************************************************************************/
21.openerp .oe_mail .oe_msg .oe_msg_icons .oe_assign:hover a{
22 color: #1fc0ff;
23 text-shadow: 0px 1px #184fc5,0px -1px #184fc5, -1px 0px #184fc5, 1px 0px #184fc5, 0px 3px 3px rgba(0,0,0,0.1);
24}
025
=== added directory 'mail_organizer/static/src/img'
=== added file 'mail_organizer/static/src/img/icon.png'
1Binary 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 differ26Binary 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
=== added directory 'mail_organizer/static/src/js'
=== added file 'mail_organizer/static/src/js/mail.js'
--- mail_organizer/static/src/js/mail.js 1970-01-01 00:00:00 +0000
+++ mail_organizer/static/src/js/mail.js 2014-02-23 07:15:07 +0000
@@ -0,0 +1,53 @@
1/******************************************************************************
2*
3* OpenERP, Open Source Management Solution
4* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
5* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
6*
7* This program is free software: you can redistribute it and/or modify
8* it under the terms of the GNU Affero General Public License as
9* published by the Free Software Foundation, either version 3 of the
10* License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU Affero General Public License for more details.
16*
17* You should have received a copy of the GNU Affero General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*
20******************************************************************************/
21openerp.mail_organizer = function (instance) {
22 var mail = instance.mail;
23 var QWeb = instance.web.qweb;
24 window.yep = instance;
25 mail.ThreadMessage = mail.ThreadMessage.extend({
26 template: 'mail.thread.message',
27 events: {
28 'click .oe_assign': 'open_wizard',
29 },
30
31 start: function () {
32 this._super.apply(this, arguments);
33 },
34
35 open_wizard: function() {
36 var self = this;
37 var context = {
38 'active_id': this.id,
39 };
40 var action = {
41 type: 'ir.actions.act_window',
42 res_model: 'wizard.mail.organizer',
43 view_mode: 'form',
44 view_type: 'form',
45 views: [[false, 'form']],
46 target: 'new',
47 context: context,
48 };
49 self.do_action(action);
50 }
51
52 });
53};
0\ No newline at end of file54\ No newline at end of file
155
=== added directory 'mail_organizer/static/src/xml'
=== added file 'mail_organizer/static/src/xml/mail.xml'
--- mail_organizer/static/src/xml/mail.xml 1970-01-01 00:00:00 +0000
+++ mail_organizer/static/src/xml/mail.xml 2014-02-23 07:15:07 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<template>
3 <t t-extend="mail.thread.message">
4 <t t-jquery=".oe_msg_icons span:first-child()" t-operation="after">
5 <span class="oe_assign"><a title="Assign to" class="oe_e">C</a></span>
6 </t>
7 </t>
8</template>
0\ No newline at end of file9\ No newline at end of file
110
=== added directory 'mail_organizer/wizard'
=== added file 'mail_organizer/wizard/__init__.py'
--- mail_organizer/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ mail_organizer/wizard/__init__.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22import wizard_mail_organizer
023
=== added file 'mail_organizer/wizard/wizard_mail_organizer.py'
--- mail_organizer/wizard/wizard_mail_organizer.py 1970-01-01 00:00:00 +0000
+++ mail_organizer/wizard/wizard_mail_organizer.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,108 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22from openerp.osv import fields, osv
23
24
25class wizard_mail_organizer(osv.osv_memory):
26 _name = 'wizard.mail.organizer'
27
28 def _select_models(self, cr, uid, context=None):
29 module_pool = self.pool.get('ir.model')
30 module_ids = module_pool.search(
31 cr, uid, [('mail_organizer', '=', True)],
32 order="name", context=context)
33 modules = module_pool.browse(cr, uid, module_ids, context=context)
34 return [(m.model, m.name) for m in modules]
35
36 def _get_default_message_id(self, cr, uid, context=None):
37 return context.get('active_id', None)
38
39 _columns = {
40 'message_id': fields.many2one(
41 'mail.message', string="Message", required=True),
42 'res': fields.char('Ressource', readonly=True),
43 'model': fields.selection(
44 _select_models, string="Model", readonly=True),
45 'new_res_id': fields.integer("New resource"),
46 'new_model': fields.selection(_select_models, string="New model"),
47 'subject': fields.char('Subject', readonly=True),
48 'author_id': fields.many2one(
49 'res.partner', string='Author', readonly=True),
50 'has_domain': fields.boolean('Filter by partner'),
51 'is_domain_visible': fields.boolean('Is domain visible')
52 }
53
54 _defaults = {
55 'message_id': lambda self, cr, uid, c: (
56 self._get_default_message_id(cr, uid, context=c)),
57 'has_domain': True,
58 'is_domain_visible': False
59 }
60
61 def onchange_new_model(self, cr, uid, ids, new_model, has_domain,
62 author_id, context=None):
63 res = {}
64 vals = {'new_res_id': None}
65 domain = {'new_res_id': []}
66 if new_model and has_domain:
67 obj_pool = self.pool.get(new_model)
68 vals.update({'is_domain_visible': False})
69 if 'partner_id' in obj_pool._columns:
70 domain = {'new_res_id': [('partner_id', '=', author_id)]}
71 vals.update({'is_domain_visible': True})
72 res.update({'value': vals, 'domain': domain})
73 return res
74
75 def onchange_message_id(self, cr, uid, ids, message_id, context=None):
76 res = {}
77 if not message_id:
78 return res
79 vals = {}
80 message_pool = self.pool.get('mail.message')
81 message = message_pool.browse(
82 cr, uid, message_id, context=context)
83 resource = ''
84 if message.model and message.res_id:
85 obj_pool = self.pool.get(message.model)
86 obj = obj_pool.browse(
87 cr, uid, message.res_id, context=context)
88 resource = getattr(obj, obj._rec_name)
89 vals.update({
90 'model': message.model,
91 'res': resource,
92 'author_id': (message.author_id and message.author_id.id
93 or None),
94 'subject': message.subject
95 })
96 res.update({'value': vals})
97 return res
98
99 def confirm(self, cr, uid, ids, context=None):
100 message_pool = self.pool.get('mail.message')
101 for wz in self.browse(cr, uid, ids, context=context):
102 data = {'model': wz.new_model, 'res_id': wz.new_res_id}
103 message_pool.write(
104 cr, uid, wz.message_id.id, data, context=context)
105 return {
106 'type': 'ir.actions.client',
107 'tag': 'reload'
108 }
0109
=== added file 'mail_organizer/wizard/wizard_mail_organizer_view.xml'
--- mail_organizer/wizard/wizard_mail_organizer_view.xml 1970-01-01 00:00:00 +0000
+++ mail_organizer/wizard/wizard_mail_organizer_view.xml 2014-02-23 07:15:07 +0000
@@ -0,0 +1,34 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="wizard_mail_organizer_form">
5 <field name="name">wizard_mail_organizer.form</field>
6 <field name="model">wizard.mail.organizer</field>
7 <field name="type">form</field>
8 <field name="arch" type="xml">
9 <form string="Wizard Mail Organizer" version="7.0">
10 <header>
11 <h2 class="oe_title">Assign email to another resource</h2>
12 </header>
13 <field name="message_id" invisible="True" on_change="onchange_message_id(message_id)" />
14 <field name="is_domain_visible" invisible="True" />
15 <group col="4" colspan="2">
16 <field name="author_id" />
17 <field name="subject" />
18 <field name="model" />
19 <field name="res" />
20 <field name="new_model" colspan="2" on_change="onchange_new_model(new_model, has_domain, author_id)" />
21 <field name="new_res_id" colspan="2" widget="polymorphic" polymorphic="new_model"/>
22 <field name="has_domain"
23 on_change="onchange_new_model(new_model, has_domain, author_id)"
24 attrs="{'invisible':[('is_domain_visible', '=', False)]}" />
25 </group>
26 <footer>
27 <button name="confirm" string="Assign" type="object" class="oe_highlight" />
28 <button string="Cancel" class="oe_link" special="cancel"/>
29 </footer>
30 </form>
31 </field>
32 </record>
33 </data>
34</openerp>
0\ No newline at end of file35\ No newline at end of file
136
=== modified file 'web_adblock/__init__.py'
--- web_adblock/__init__.py 2013-12-28 06:25:35 +0000
+++ web_adblock/__init__.py 2014-02-23 07:15:07 +0000
@@ -2,8 +2,8 @@
2##############################################################################2##############################################################################
3#3#
4# OpenERP, Open Source Management Solution4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaaas@elico-corp.com>6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#7#
8# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
1010
=== modified file 'web_adblock/__openerp__.py'
--- web_adblock/__openerp__.py 2013-12-28 06:25:35 +0000
+++ web_adblock/__openerp__.py 2014-02-23 07:15:07 +0000
@@ -2,8 +2,8 @@
2##############################################################################2##############################################################################
3#3#
4# OpenERP, Open Source Management Solution4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaaas@elico-corp.com>6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#7#
8# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
@@ -22,7 +22,7 @@
22{22{
23 'name': 'OpenERP Adblock',23 'name': 'OpenERP Adblock',
24 'version': '0.1',24 'version': '0.1',
25 'category': '',25 'category': 'Web',
26 'depends': ['mail'],26 'depends': ['mail'],
27 'author': 'Elico Corp',27 'author': 'Elico Corp',
28 'license': 'AGPL-3',28 'license': 'AGPL-3',
2929
=== added file 'web_adblock/static/.DS_Store'
30Binary 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 differ30Binary 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
=== added directory 'web_adblock/static/src/img'
=== added file 'web_adblock/static/src/img/icon.png'
31Binary 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 differ31Binary 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
=== modified file 'web_adblock/static/src/js/announcement.js'
--- web_adblock/static/src/js/announcement.js 2013-12-28 06:25:35 +0000
+++ web_adblock/static/src/js/announcement.js 2014-02-23 07:15:07 +0000
@@ -1,3 +1,23 @@
1/******************************************************************************
2*
3* OpenERP, Open Source Management Solution
4* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
5* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
6*
7* This program is free software: you can redistribute it and/or modify
8* it under the terms of the GNU Affero General Public License as
9* published by the Free Software Foundation, either version 3 of the
10* License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU Affero General Public License for more details.
16*
17* You should have received a copy of the GNU Affero General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*
20******************************************************************************/
1openerp_announcement = function(instance) {21openerp_announcement = function(instance) {
222
3};23};
4\ No newline at end of file24\ No newline at end of file
525
=== added directory 'web_polymorphic'
=== added file 'web_polymorphic/__init__.py'
--- web_polymorphic/__init__.py 1970-01-01 00:00:00 +0000
+++ web_polymorphic/__init__.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,21 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
022
=== added file 'web_polymorphic/__openerp__.py'
--- web_polymorphic/__openerp__.py 1970-01-01 00:00:00 +0000
+++ web_polymorphic/__openerp__.py 2014-02-23 07:15:07 +0000
@@ -0,0 +1,43 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
6# Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22{'name': 'Web Polymorphic',
23 'version': '0.1',
24 'category': 'Web',
25 'depends': ['web'],
26 'author': 'Elico Corp',
27 'license': 'AGPL-3',
28 'website': 'https://www.elico-corp.com',
29 'description': """
30Add a new widget named "polymorphic"
31The polymorphic field allow to dynamically store an id linked to any model in
32OpenERP instead of the usual fixed one in the view definition
33
34E.g:
35
36<field name="model" invisible="1" />
37<field name="object_id" widget="polymorphic" polymorphic="model" />
38""",
39 'js': [
40 'static/src/js/view_form.js'
41 ],
42 'installable': True,
43 'application': False}
044
=== added directory 'web_polymorphic/static'
=== added file 'web_polymorphic/static/.DS_Store'
1Binary 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 differ45Binary 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
=== added directory 'web_polymorphic/static/src'
=== added directory 'web_polymorphic/static/src/js'
=== added file 'web_polymorphic/static/src/js/view_form.js'
--- web_polymorphic/static/src/js/view_form.js 1970-01-01 00:00:00 +0000
+++ web_polymorphic/static/src/js/view_form.js 2014-02-23 07:15:07 +0000
@@ -0,0 +1,47 @@
1/******************************************************************************
2*
3* OpenERP, Open Source Management Solution
4* Copyright (c) 2010-2014 Elico Corp. All Rights Reserved.
5* Augustin Cisterne-Kaas <augustin.cisterne-kaas@elico-corp.com>
6*
7* This program is free software: you can redistribute it and/or modify
8* it under the terms of the GNU Affero General Public License as
9* published by the Free Software Foundation, either version 3 of the
10* License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU Affero General Public License for more details.
16*
17* You should have received a copy of the GNU Affero General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*
20******************************************************************************/
21openerp.web_polymorphic = function (instance) {
22 instance.web.form.FieldPolymorphic = instance.web.form.FieldMany2One.extend( {
23 template: "FieldMany2One",
24 events: {
25 'focus input': function(e) {
26 this.field.relation = this.field_manager.get_field_value(this.polymorphic);
27 },
28 'click input': function(e) {
29 this.field.relation = this.field_manager.get_field_value(this.polymorphic);
30 }
31 },
32 init: function(field_manager, node) {
33 this._super(field_manager, node);
34 this.polymorphic = this.node.attrs.polymorphic;
35 },
36 render_editable: function() {
37 var self = this;
38 this.$drop_down = this.$el.find(".oe_m2o_drop_down_button");
39 this.$drop_down.click(function() {
40 self.polymorphic = self.node.attrs.polymorphic;
41 self.field.relation = self.field_manager.get_field_value(self.polymorphic);
42 });
43 this._super();
44 }
45 });
46 instance.web.form.widgets.add('polymorphic', 'instance.web.form.FieldPolymorphic')
47};