Merge lp:~ajite/openobject-addons/elico-7.0-fix-0001 into lp:~openerp-community/openobject-addons/elico-7.0

Status: Merged
Merged at revision: 34
Proposed branch: lp:~ajite/openobject-addons/elico-7.0-fix-0001
Merge into: lp:~openerp-community/openobject-addons/elico-7.0
Diff against target: 127 lines (+38/-6)
5 files modified
mail_organizer/__openerp__.py (+4/-0)
mail_organizer/model_view.xml (+2/-2)
mail_organizer/static/description/index.html (+20/-0)
mail_organizer/wizard/wizard_mail_organizer.py (+6/-3)
mail_organizer/wizard/wizard_mail_organizer_view.xml (+6/-1)
To merge this branch: bzr merge lp:~ajite/openobject-addons/elico-7.0-fix-0001
Reviewer Review Type Date Requested Status
LIN Yu Pending
Review via email: mp+209649@code.launchpad.net

Description of the change

Fixed domain problem in the mail organizer wizard.
Added the html page for OpenERP APPS

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mail_organizer/__openerp__.py'
--- mail_organizer/__openerp__.py 2014-02-23 07:09:25 +0000
+++ mail_organizer/__openerp__.py 2014-03-06 11:20:42 +0000
@@ -32,6 +32,10 @@
3232
33You can configure the available model through33You can configure the available model through
34"Settings" -> "Technical" -> "Email Organizer"34"Settings" -> "Technical" -> "Email Organizer"
35
36Screencasts available at:
37 https://www.youtube.com/watch?v=XYgswq6_J1I
38 http://v.youku.com/v_show/id_XNjc3Njc0Nzky.html
35""",39""",
36 'images': [],40 'images': [],
37 'demo': [],41 'demo': [],
3842
=== modified file 'mail_organizer/model_view.xml'
--- mail_organizer/model_view.xml 2014-02-23 07:09:25 +0000
+++ mail_organizer/model_view.xml 2014-03-06 11:20:42 +0000
@@ -26,7 +26,7 @@
2626
2727
28 <record model="ir.actions.act_window" id="action_mail_organizer">28 <record model="ir.actions.act_window" id="action_mail_organizer">
29 <field name="name">Email organizer</field>29 <field name="name">Mail organizer</field>
30 <field name="view_id" ref="view_model_tree_editable"/>30 <field name="view_id" ref="view_model_tree_editable"/>
31 <field name="res_model">ir.model</field>31 <field name="res_model">ir.model</field>
32 <field name="view_type">form</field>32 <field name="view_type">form</field>
@@ -34,7 +34,7 @@
34 </record>34 </record>
3535
36 <menuitem id="menu_email_organizer"36 <menuitem id="menu_email_organizer"
37 name="Email Organizer"37 name="Mail Organizer"
38 action="action_mail_organizer"38 action="action_mail_organizer"
39 parent="base.menu_email" />39 parent="base.menu_email" />
40 </data>40 </data>
4141
=== added directory 'mail_organizer/static/description'
=== added file 'mail_organizer/static/description/example.png'
42Binary files mail_organizer/static/description/example.png 1970-01-01 00:00:00 +0000 and mail_organizer/static/description/example.png 2014-03-06 11:20:42 +0000 differ42Binary files mail_organizer/static/description/example.png 1970-01-01 00:00:00 +0000 and mail_organizer/static/description/example.png 2014-03-06 11:20:42 +0000 differ
=== added file 'mail_organizer/static/description/index.html'
--- mail_organizer/static/description/index.html 1970-01-01 00:00:00 +0000
+++ mail_organizer/static/description/index.html 2014-03-06 11:20:42 +0000
@@ -0,0 +1,20 @@
1<section class="oe_container">
2 <div class="oe_row">
3 <h2 class="oe_slogan">Mail Organizer</h2>
4 <h4 class="oe_slogan"><a href="http://www.elico-corp.com">By Elico Corp</a></h4>
5 <p>
6 This module allows you to assign a message to an existing or a new resource dynamically.
7 </p>
8 <p>
9 You can configure the available model through "Settings" -> "Technical" -> "Email Organizer"
10 </p>
11 <p>Screencast available at:</p>
12 <ul>
13 <li><a href="https://www.youtube.com/watch?v=XYgswq6_J1I">YouTube</a></li>
14 <li><a href="http://v.youku.com/v_show/id_XNjc3Njc0Nzky.html">Youku</a></li>
15 </ul>
16 <div class="oe_row_img oe_centered oe_mt32">
17 <img class="oe_picture oe_screenshot" src="example.png" />
18 </div>
19 </div>
20</section>
0\ No newline at end of file21\ No newline at end of file
122
=== modified file 'mail_organizer/wizard/wizard_mail_organizer.py'
--- mail_organizer/wizard/wizard_mail_organizer.py 2014-02-23 07:09:25 +0000
+++ mail_organizer/wizard/wizard_mail_organizer.py 2014-03-06 11:20:42 +0000
@@ -43,8 +43,9 @@
43 'model': fields.selection(43 'model': fields.selection(
44 _select_models, string="Model", readonly=True),44 _select_models, string="Model", readonly=True),
45 'new_res_id': fields.integer("New resource"),45 'new_res_id': fields.integer("New resource"),
46 'new_model': fields.selection(_select_models, string="New model"),46 'new_model': fields.selection(_select_models, string='New model'),
47 'subject': fields.char('Subject', readonly=True),47 'subject': fields.char('Subject', readonly=True),
48 'email_from': fields.char('Email'),
48 'author_id': fields.many2one(49 'author_id': fields.many2one(
49 'res.partner', string='Author', readonly=True),50 'res.partner', string='Author', readonly=True),
50 'has_domain': fields.boolean('Filter by partner'),51 'has_domain': fields.boolean('Filter by partner'),
@@ -63,11 +64,12 @@
63 res = {}64 res = {}
64 vals = {'new_res_id': None}65 vals = {'new_res_id': None}
65 domain = {'new_res_id': []}66 domain = {'new_res_id': []}
66 if new_model and has_domain:67 if new_model:
67 obj_pool = self.pool.get(new_model)68 obj_pool = self.pool.get(new_model)
68 vals.update({'is_domain_visible': False})69 vals.update({'is_domain_visible': False})
69 if 'partner_id' in obj_pool._columns:70 if 'partner_id' in obj_pool._columns:
70 domain = {'new_res_id': [('partner_id', '=', author_id)]}71 if has_domain:
72 domain = {'new_res_id': [('partner_id', '=', author_id)]}
71 vals.update({'is_domain_visible': True})73 vals.update({'is_domain_visible': True})
72 res.update({'value': vals, 'domain': domain})74 res.update({'value': vals, 'domain': domain})
73 return res75 return res
@@ -89,6 +91,7 @@
89 vals.update({91 vals.update({
90 'model': message.model,92 'model': message.model,
91 'res': resource,93 'res': resource,
94 'email_from': message.email_from,
92 'author_id': (message.author_id and message.author_id.id95 'author_id': (message.author_id and message.author_id.id
93 or None),96 or None),
94 'subject': message.subject97 'subject': message.subject
9598
=== modified file 'mail_organizer/wizard/wizard_mail_organizer_view.xml'
--- mail_organizer/wizard/wizard_mail_organizer_view.xml 2014-02-23 07:09:25 +0000
+++ mail_organizer/wizard/wizard_mail_organizer_view.xml 2014-03-06 11:20:42 +0000
@@ -12,13 +12,18 @@
12 </header>12 </header>
13 <field name="message_id" invisible="True" on_change="onchange_message_id(message_id)" />13 <field name="message_id" invisible="True" on_change="onchange_message_id(message_id)" />
14 <field name="is_domain_visible" invisible="True" />14 <field name="is_domain_visible" invisible="True" />
15 <field name="email_from" invisible="True" />
15 <group col="4" colspan="2">16 <group col="4" colspan="2">
16 <field name="author_id" />17 <field name="author_id" />
17 <field name="subject" />18 <field name="subject" />
18 <field name="model" />19 <field name="model" />
19 <field name="res" />20 <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_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="new_res_id"
23 colspan="2"
24 widget="polymorphic"
25 polymorphic="new_model"
26 />
22 <field name="has_domain"27 <field name="has_domain"
23 on_change="onchange_new_model(new_model, has_domain, author_id)"28 on_change="onchange_new_model(new_model, has_domain, author_id)"
24 attrs="{'invisible':[('is_domain_visible', '=', False)]}" />29 attrs="{'invisible':[('is_domain_visible', '=', False)]}" />