[IMP] sale.config.settings: show the 'Emails' section only when crm is installed

bzr revid: rco@openerp.com-20120330135546-jnmi8nbdmdg42rt7
This commit is contained in:
Raphael Collet 2012-03-30 15:55:46 +02:00
parent b0847416f7
commit d56385b55f
10 changed files with 38 additions and 78 deletions

View File

@ -204,10 +204,27 @@ class specify_partner_terminology(osv.osv_memory):
# Preferences wizard for Sales & CRM.
# It is defined here because it must be inherited independently in modules sale and crm.
# It is defined here because it is inherited independently in modules sale, crm,
# plugin_outlook and plugin_thunderbird.
#
class sale_config_settings(osv.osv_memory):
_name = 'sale.config.settings'
_inherit = 'res.config.settings'
_columns = {
'module_crm': fields.boolean('CRM'),
'module_plugin_thunderbird': fields.boolean('Thunderbird plugin',
help="""The plugin allows you archive email and its attachments to the selected
OpenERP objects. You can select a partner, a task, a project, an analytical
account, or any other object and attach the selected mail as a .eml file in
the attachment of a selected record. You can create documents for CRM Lead,
HR Applicant and Project Issue from the selected emails.
This installs the module plugin_thunderbird."""),
'module_plugin_outlook': fields.boolean('Outlook plugin',
help="""The Outlook plugin allows you to select an object that you would like to add
to your email and its attachments from MS Outlook. You can select a partner, a task,
a project, an analytical account, or any other object and archive a selected
email into an OpenERP mail message with attachments.
This installs the module plugin_outlook."""),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -149,7 +149,16 @@
<field name="arch" type="xml">
<form string="Configure Sales">
<group name="config_sale" colspan="4"/>
<group name="config_emails" colspan="4"/>
<!-- this part is necessary to allow the plugins to extend the view -->
<field name="module_crm" invisible="1"/>
<group name="config_fetchmail" colspan="4" attrs="{'invisible': [('module_crm','=',False)]}">
<separator string="Emails"/>
</group>
<field name="module_plugin_thunderbird" attrs="{'invisible': [('module_crm','=',False)]}"/>
<newline/>
<field name="module_plugin_outlook" attrs="{'invisible': [('module_crm','=',False)]}"/>
<group name="config_crm" colspan="4"/>
</form>
</field>

View File

@ -2,13 +2,13 @@
<openerp>
<data>
<record id="view_sales_config_crm" model="ir.ui.view">
<record id="view_sale_config_settings" model="ir.ui.view">
<field name="name">crm settings</field>
<field name="model">sale.config.settings</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_sale_config_settings"/>
<field name="arch" type="xml">
<group name="config_emails" position="after">
<group name="config_fetchmail" position="after">
<field name="fetchmail_lead"/>
<group colspan="2" attrs="{'invisible': [('fetchmail_lead','=',False)]}">
<field name="lead_server" attrs="{'required': [('fetchmail_lead','=',True)]}"/>
@ -18,7 +18,9 @@
<field name="lead_user" attrs="{'required': [('fetchmail_lead','=',True)]}"/>
<field name="lead_password" password="True" attrs="{'required': [('fetchmail_lead','=',True)]}"/>
</group>
<newline/>
</group>
<group name="config_crm" position="after">
<separator string="Import and Synchronize data from an other application" colspan="4"/>
<field name="module_import_sugarcrm"/>

View File

@ -9,7 +9,7 @@
<field name="inherit_id" ref="base.view_sale_config_settings"/>
<field name="priority" eval="12"/> <!-- to put fetchmail_lead before fetchmail_claim -->
<field name="arch" type="xml">
<group name="config_emails" position="after">
<group name="config_fetchmail" position="after">
<field name="fetchmail_claim"/>
<group colspan="2" attrs="{'invisible': [('fetchmail_claim','=',False)]}">
<field name="claim_server" attrs="{'required': [('fetchmail_claim','=',True)]}"/>
@ -19,6 +19,7 @@
<field name="claim_user" attrs="{'required': [('fetchmail_claim','=',True)]}"/>
<field name="claim_password" password="True" attrs="{'required': [('fetchmail_claim','=',True)]}"/>
</group>
<newline/>
</group>
</field>
</record>

View File

@ -23,7 +23,6 @@ import mail_message
import mail_thread
import res_partner
import wizard
import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -62,7 +62,6 @@ The main features are:
"res_partner_view.xml",
'security/ir.model.access.csv',
'mail_data.xml',
'res_config_view.xml',
],
'installable': True,
'auto_install': False,

View File

@ -1,43 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 plugin_configuration(osv.osv_memory):
_inherit = 'sale.config.settings'
_columns = {
'module_plugin_thunderbird': fields.boolean('Thunderbird plugin',
help="""The plugin allows you archive email and its attachments to the selected
OpenERP objects. You can select a partner, a task, a project, an analytical
account, or any other object and attach the selected mail as a .eml file in
the attachment of a selected record. You can create documents for CRM Lead,
HR Applicant and Project Issue from the selected emails.
This installs the module plugin_thunderbird."""),
'module_plugin_outlook': fields.boolean('Outlook plugin',
help="""The Outlook plugin allows you to select an object that you would like to add
to your email and its attachments from MS Outlook. You can select a partner, a task,
a project, an analytical account, or any other object and archive a selected
email into an OpenERP mail message with attachments.
This installs the module plugin_outlook."""),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,24 +0,0 @@
<openerp>
<data>
<record id="view_sales_config_plugin" model="ir.ui.view">
<field name="name">mail plugins settings</field>
<field name="model">sale.config.settings</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_sale_config_settings"/>
<field name="priority" eval="8"/> <!-- plugin fields will appear last -->
<field name="arch" type="xml">
<group name="config_emails" position="inside">
<separator string="Emails"/>
</group>
<group name="config_emails" position="after">
<field name="module_plugin_thunderbird"/>
<newline/>
<field name="module_plugin_outlook"/>
<newline/>
</group>
</field>
</record>
</data>
</openerp>

View File

@ -53,10 +53,10 @@
<field name="name">Sales Application</field>
<field name="model">sale.config.settings</field>
<field name="type">form</field>
<field name="inherit_id" ref="mail.view_sales_config_plugin"/>
<field name="inherit_id" ref="base.view_sale_config_settings"/>
<field name="arch" type="xml">
<field name="module_plugin_outlook" position="after">
<group colspan="2">
<group colspan="2" attrs="{'invisible': [('module_crm','=',False)]}">
<button name="%(action_outlook_installer)d" type="action"
string="Configure Outlook plugin" icon="gtk-execute"/>
</group>

View File

@ -60,10 +60,10 @@
<field name="name">Sales Application</field>
<field name="model">sale.config.settings</field>
<field name="type">form</field>
<field name="inherit_id" ref="mail.view_sales_config_plugin"/>
<field name="inherit_id" ref="base.view_sale_config_settings"/>
<field name="arch" type="xml">
<field name="module_plugin_thunderbird" position="after">
<group colspan="2">
<group colspan="2" attrs="{'invisible': [('module_crm','=',False)]}">
<button name="%(action_thunderbird_installer)d" type="action"
string="Configure Thunderbird plugin" icon="gtk-execute"/>
</group>