Skip to content

Commit ea65a49

Browse files
committedJun 22, 2012
[IMP] base_setup: move all res_config wizards to res_config files, and change xml id of sale.config.settings view
bzr revid: [email protected]
1 parent fdca6f9 commit ea65a49

File tree

9 files changed

+71
-71
lines changed

9 files changed

+71
-71
lines changed
 

‎addons/base_setup/base_setup.py

-23
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,4 @@ def _case_insensitive_replace(ref_string, src, value):
9797
self.make_translations(cr, uid, ids, act_ref, 'model', act_id.help, _case_insensitive_replace(act_id.help,'Customer',o.partner), res_id=act_id.id, context=context)
9898
return {}
9999

100-
# Preferences wizard for Sales & CRM.
101-
# It is defined here because it is inherited independently in modules sale, crm,
102-
# plugin_outlook and plugin_thunderbird.
103-
class sale_config_settings(osv.osv_memory):
104-
_name = 'sale.config.settings'
105-
_inherit = 'res.config.settings'
106-
_columns = {
107-
'module_crm': fields.boolean('CRM'),
108-
'module_plugin_thunderbird': fields.boolean('Thunderbird Plugin',
109-
help="""The plugin allows you archive email and its attachments to the selected
110-
OpenERP objects. You can select a partner, or a lead and
111-
attach the selected mail as a .eml file in
112-
the attachment of a selected record. You can create documents for CRM Lead,
113-
Partner from the selected emails.
114-
This installs the module plugin_thunderbird."""),
115-
'module_plugin_outlook': fields.boolean('Outlook Plugin',
116-
help="""The Outlook plugin allows you to select an object that you would like to add
117-
to your email and its attachments from MS Outlook. You can select a partner,
118-
or a lead object and archive a selected
119-
email into an OpenERP mail message with attachments.
120-
This installs the module plugin_outlook."""),
121-
}
122-
123100
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

‎addons/base_setup/base_setup_views.xml

-33
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,5 @@
4343
<field name="target">new</field>
4444
</record>
4545

46-
<!-- Sale config wizard -->
47-
<record id="base.view_sale_config_settings" model="ir.ui.view">
48-
<field name="name">sale settings</field>
49-
<field name="model">sale.config.settings</field>
50-
<field name="type">form</field>
51-
<field name="arch" type="xml">
52-
<form string="Configure Sales" version="7.0">
53-
<header>
54-
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
55-
<button string="Cancel" special="cancel"/>
56-
</header>
57-
<sheet>
58-
<field name="module_crm" invisible="1"/>
59-
<group name="config_sale"/>
60-
<group name="config_fetchmail" string="Emails" attrs="{'invisible': [('module_crm','=',False)]}">
61-
<field name="module_plugin_thunderbird"/>
62-
<field name="module_plugin_outlook"/>
63-
</group>
64-
<group name="config_crm"/>
65-
</sheet>
66-
</form>
67-
</field>
68-
</record>
69-
70-
<record id="base.action_sale_config" model="ir.actions.act_window">
71-
<field name="name">Configure Sales</field>
72-
<field name="type">ir.actions.act_window</field>
73-
<field name="res_model">sale.config.settings</field>
74-
<field name="view_id" ref="base.view_sale_config_settings"/>
75-
<field name="view_mode">form</field>
76-
<field name="target">inline</field>
77-
</record>
78-
7946
</data>
8047
</openerp>

‎addons/base_setup/res_config.py

+28-5
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class base_config_settings(osv.osv_memory):
3333
'module_share': fields.boolean('Allow Sharing Resources to External Users',
3434
help="""As an example, you will be able to share a project or some tasks to your customers, or quotes/sales to several persons at your customer company, or your agenda availabilities to your contacts."""),
3535
}
36-
36+
3737
def open_company(self, cr, uid, ids, context=None):
3838
if context is None:
3939
context = {}
40-
41-
company_obj = self.pool.get('res.company')
40+
41+
company_obj = self.pool.get('res.company')
4242
company_id = company_obj.browse(cr, uid, uid, context=context).id
43-
43+
4444
return {
4545
'name': 'Your Company',
4646
'view_type': 'form',
@@ -50,5 +50,28 @@ def open_company(self, cr, uid, ids, context=None):
5050
'view_id': False,
5151
'type': 'ir.actions.act_window',
5252
}
53-
53+
54+
# Preferences wizard for Sales & CRM.
55+
# It is defined here because it is inherited independently in modules sale, crm,
56+
# plugin_outlook and plugin_thunderbird.
57+
class sale_config_settings(osv.osv_memory):
58+
_name = 'sale.config.settings'
59+
_inherit = 'res.config.settings'
60+
_columns = {
61+
'module_crm': fields.boolean('CRM'),
62+
'module_plugin_thunderbird': fields.boolean('Thunderbird Plugin',
63+
help="""The plugin allows you archive email and its attachments to the selected
64+
OpenERP objects. You can select a partner, or a lead and
65+
attach the selected mail as a .eml file in
66+
the attachment of a selected record. You can create documents for CRM Lead,
67+
Partner from the selected emails.
68+
This installs the module plugin_thunderbird."""),
69+
'module_plugin_outlook': fields.boolean('Outlook Plugin',
70+
help="""The Outlook plugin allows you to select an object that you would like to add
71+
to your email and its attachments from MS Outlook. You can select a partner,
72+
or a lead object and archive a selected
73+
email into an OpenERP mail message with attachments.
74+
This installs the module plugin_outlook."""),
75+
}
76+
5477
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

‎addons/base_setup/res_config_view.xml

+33
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,38 @@
4343
<menuitem id="menu_general_configuration" parent="base.menu_config"
4444
sequence="100" action="action_general_configuration"/>
4545

46+
<!-- Sale config wizard -->
47+
<record id="view_sale_config_settings" model="ir.ui.view">
48+
<field name="name">sale settings</field>
49+
<field name="model">sale.config.settings</field>
50+
<field name="type">form</field>
51+
<field name="arch" type="xml">
52+
<form string="Configure Sales" version="7.0">
53+
<header>
54+
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
55+
<button string="Cancel" special="cancel"/>
56+
</header>
57+
<sheet>
58+
<field name="module_crm" invisible="1"/>
59+
<group name="config_sale"/>
60+
<group name="config_fetchmail" string="Emails" attrs="{'invisible': [('module_crm','=',False)]}">
61+
<field name="module_plugin_thunderbird"/>
62+
<field name="module_plugin_outlook"/>
63+
</group>
64+
<group name="config_crm"/>
65+
</sheet>
66+
</form>
67+
</field>
68+
</record>
69+
70+
<record id="action_sale_config" model="ir.actions.act_window">
71+
<field name="name">Configure Sales</field>
72+
<field name="type">ir.actions.act_window</field>
73+
<field name="res_model">sale.config.settings</field>
74+
<field name="view_id" ref="view_sale_config_settings"/>
75+
<field name="view_mode">form</field>
76+
<field name="target">inline</field>
77+
</record>
78+
4679
</data>
4780
</openerp>

‎addons/crm/res_config_view.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="name">crm settings</field>
77
<field name="model">sale.config.settings</field>
88
<field name="type">form</field>
9-
<field name="inherit_id" ref="base.view_sale_config_settings"/>
9+
<field name="inherit_id" ref="base_setup.view_sale_config_settings"/>
1010
<field name="arch" type="xml">
1111
<group name="config_fetchmail" position="after">
1212
<field name="fetchmail_lead"/>
@@ -31,7 +31,7 @@
3131
</record>
3232

3333
<menuitem id="base.menu_sale_config" name="Sales" parent="base.menu_config"
34-
sequence="1" action="base.action_sale_config"/>
34+
sequence="1" action="base_setup.action_sale_config"/>
3535

3636
</data>
3737
</openerp>

‎addons/crm_claim/res_config_view.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="name">crm_claim settings</field>
77
<field name="model">sale.config.settings</field>
88
<field name="type">form</field>
9-
<field name="inherit_id" ref="base.view_sale_config_settings"/>
9+
<field name="inherit_id" ref="base_setup.view_sale_config_settings"/>
1010
<field name="priority" eval="12"/> <!-- to put fetchmail_lead before fetchmail_claim -->
1111
<field name="arch" type="xml">
1212
<group name="config_fetchmail" position="after">

‎addons/plugin_outlook/plugin_outlook.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<field name="name">Sales Application</field>
5151
<field name="model">sale.config.settings</field>
5252
<field name="type">form</field>
53-
<field name="inherit_id" ref="base.view_sale_config_settings"/>
53+
<field name="inherit_id" ref="base_setup.view_sale_config_settings"/>
5454
<field name="arch" type="xml">
5555
<field name="module_plugin_outlook" position="after">
5656
<group colspan="2" attrs="{'invisible': ['|',('module_crm','=',False),('module_plugin_outlook','=',False)]}">

‎addons/plugin_thunderbird/plugin_thunderbird.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
<field name="view_mode">form</field>
4949
<field name="target">new</field>
5050
</record>
51-
51+
5252
<!-- Sales Configuration -->
5353
<record id="view_config_thunderbird_installer" model="ir.ui.view">
5454
<field name="name">Sales Application</field>
5555
<field name="model">sale.config.settings</field>
5656
<field name="type">form</field>
57-
<field name="inherit_id" ref="base.view_sale_config_settings"/>
57+
<field name="inherit_id" ref="base_setup.view_sale_config_settings"/>
5858
<field name="arch" type="xml">
5959
<field name="module_plugin_thunderbird" position="after">
6060
<group colspan="2" attrs="{'invisible': ['|',('module_crm','=',False),('module_plugin_thunderbird','=',False)]}">

‎addons/sale/res_config_view.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<field name="name">sale settings</field>
77
<field name="model">sale.config.settings</field>
88
<field name="type">form</field>
9-
<field name="inherit_id" ref="base.view_sale_config_settings"/>
9+
<field name="inherit_id" ref="base_setup.view_sale_config_settings"/>
1010
<field name="arch" type="xml">
1111
<group name="config_sale" position="after">
1212
<separator string="Invoicing Policy" colspan="4"/>
@@ -21,7 +21,7 @@
2121
<field name="timesheet" on_change="onchange_timesheet(timesheet)"/>
2222
<field name="time_unit" domain="[('category_id.name','=','Working Time')]"
2323
attrs="{'invisible': [('task_work','=',False), ('module_account_analytic_analysis','=',False)],'required': ['|', ('task_work','=',True), ('module_account_analytic_analysis','=',True)]}"/>
24-
24+
2525
<separator string="Sale Order" colspan="4"/>
2626
<field name="group_uom"/>
2727
<field name="default_picking_policy" attrs="{'invisible':[('group_invoice_deli_orders','=',False)]}"/>
@@ -34,7 +34,7 @@
3434
<field name="decimal_precision"/>
3535
<field name="module_sale_journal"/>
3636
<field name="module_warning"/>
37-
37+
3838
<separator string="Contracts" colspan="4"/>
3939
<field name="module_account_analytic_analysis" on_change="onchange_timesheet(module_account_analytic_analysis)"/>
4040
<field name="module_analytic_user_function" attrs="{'invisible':[('module_account_analytic_analysis','=',False)]}"/>
@@ -44,7 +44,7 @@
4444
</record>
4545

4646
<menuitem id="base.menu_sale_config" name="Sales" parent="base.menu_config"
47-
sequence="1" action="base.action_sale_config"/>
47+
sequence="1" action="base_setup.action_sale_config"/>
4848

4949
<record id="view_account_config" model="ir.ui.view">
5050
<field name="name">account settings</field>

0 commit comments

Comments
 (0)
Please sign in to comment.