summaryrefslogtreecommitdiff
path: root/addons/base_setup
diff options
context:
space:
mode:
authorAkash Bhavsar <abh@odoo.com>2016-12-01 17:13:47 +0530
committerYannick Tivisse <yti@odoo.com>2017-01-03 17:07:02 +0100
commit79fd51b2a59224e8fa189f01c53d778e06774c59 (patch)
treefc9b220edc5368cfb70ff7fd457e51fb6b7fa158 /addons/base_setup
parent80c46ee4fc273f59823821dcdc98bcc6b7fdeeaf (diff)
[IMP] base_setup: Improve the `General Settings` form view
Diffstat (limited to 'addons/base_setup')
-rw-r--r--addons/base_setup/models/res_config.py41
-rw-r--r--addons/base_setup/views/res_config_views.xml296
2 files changed, 180 insertions, 157 deletions
diff --git a/addons/base_setup/models/res_config.py b/addons/base_setup/models/res_config.py
index 2606c780b56..971694940dd 100644
--- a/addons/base_setup/models/res_config.py
+++ b/addons/base_setup/models/res_config.py
@@ -8,42 +8,31 @@ class BaseConfigSettings(models.TransientModel):
_name = 'base.config.settings'
_inherit = 'res.config.settings'
- group_multi_company = fields.Boolean(string='Manage multiple companies',
- help='Work in multi-company environments, with appropriate security access between companies.',
- implied_group='base.group_multi_company')
+ group_multi_company = fields.Boolean("Manage multiple companies", implied_group='base.group_multi_company')
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.user.company_id)
- module_share = fields.Boolean(string='Allow documents sharing',
- help="""Share or embed any screen of Odoo.""")
- module_portal = fields.Boolean(string='Activate the customer portal',
- help="""Give your customers access to their documents.""")
- module_auth_oauth = fields.Boolean(string='Use external authentication providers (OAuth)')
- module_base_import = fields.Boolean(string="Allow users to import data from CSV/XLS/XLSX/ODS files")
- module_google_drive = fields.Boolean(string='Attach Google documents to any record',
- help="""This installs the module google_docs.""")
+ default_user_rights = fields.Boolean("Default Access Rights", default_model='base.config.settings')
+ default_external_email_server = fields.Boolean("External Email Servers", default_model='base.config.settings')
+ module_base_import = fields.Boolean("Allow users to import data from CSV/XLS/XLSX/ODS files")
+ module_pad = fields.Boolean("External Pads")
module_google_calendar = fields.Boolean(
- string='Allow the users to synchronize their calendar with Google Calendar',
- help="""This installs the module google_calendar.""")
- module_inter_company_rules = fields.Boolean(string='Manage Inter Company',
- help="""This installs the module inter_company_rules.\n Configure company rules to automatically create SO/PO when one of your company sells/buys to another of your company.""")
+ string='Allow the users to synchronize their calendar with Google Calendar')
+ module_google_drive = fields.Boolean("Attach Google documents to any record")
+ module_google_spreadsheet = fields.Boolean("Google Spreadsheet")
+ module_auth_oauth = fields.Boolean("Use external authentication providers (OAuth)")
+ module_auth_ldap = fields.Boolean("LDAP Authentification")
+ module_base_gengo = fields.Boolean("Translate Your Website with Gengo")
+ module_inter_company_rules = fields.Boolean("Manage Inter Company")
company_share_partner = fields.Boolean(string='Share partners to all companies',
help="Share your partners to all companies defined in your instance.\n"
" * Checked : Partners are visible for every companies, even if a company is defined on the partner.\n"
" * Unchecked : Each company can see only its partner (partners where company is defined). Partners not related to a company are visible for all companies.")
+ default_custom_report_footer = fields.Boolean("Custom Report Footer", default_model='base.config.settings')
+ rml_footer = fields.Text(related="company_id.rml_footer", string='Custom Report Footer', help="Footer text displayed at the bottom of all reports.")
group_multi_currency = fields.Boolean(string='Allow multi currencies',
implied_group='base.group_multi_currency',
help="Allows to work in a multi currency environment")
- # Report config from base/res/res_company.py
- custom_footer = fields.Selection(related="company_id.custom_footer")
- rml_footer = fields.Text(related="company_id.rml_footer", string='Custom Report Footer', help="Footer text displayed at the bottom of all reports.")
- rml_paper_format = fields.Selection(related="company_id.rml_paper_format", string="Paper Format *", required=True)
- font = fields.Many2one(related='company_id.font', string="Font *", help="Set the font into the report header, it will be used as default font in the RML reports of the user company")
- rml_header = fields.Text(related="company_id.rml_header", string="RML Header *")
- rml_header2 = fields.Text(related="company_id.rml_header2", string='RML Internal Header *')
- rml_header3 = fields.Text(related="company_id.rml_header3", string='RML Internal Header for Landscape Reports *')
-
-
@api.multi
def open_company(self):
return {
@@ -55,11 +44,9 @@ class BaseConfigSettings(models.TransientModel):
'res_id': self.env.user.company_id.id,
'target': 'current',
}
-
@api.multi
def open_default_user(self):
action = self.env.ref('base.action_res_users').read()[0]
- action['context'] = self.env.context
action['res_id'] = self.env.ref('base.default_user').id
action['views'] = [[self.env.ref('base.view_users_form').id, 'form']]
return action
diff --git a/addons/base_setup/views/res_config_views.xml b/addons/base_setup/views/res_config_views.xml
index 87d28b5d4f8..66eb6ae365e 100644
--- a/addons/base_setup/views/res_config_views.xml
+++ b/addons/base_setup/views/res_config_views.xml
@@ -1,152 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
- <record id="view_general_configuration" model="ir.ui.view">
- <field name="name">General Settings</field>
+ <record id="base_config_settings_view_form" model="ir.ui.view">
+ <field name="name">base.config.settings.form</field>
<field name="model">base.config.settings</field>
<field name="arch" type="xml">
<form string="General Settings" class="oe_form_configuration">
<header>
- <button string="Apply" type="object" name="execute" class="oe_highlight"/>
+ <button string="Save" type="object" name="execute" class="oe_highlight"/>
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
</header>
- <separator string="General Settings"/>
- <div>
- <label string="You will find more options in your company details: address for the header and footer, overdue payments texts, etc."/>
- <button type="object" name="open_company" string="Configure your company data" icon="fa-cogs" class="oe_inline oe_link"/>
+ <sheet>
<field name="company_id" invisible="1"/>
- </div>
- <group>
- <label for="id" string="Email" name="email_label"/>
- <div name="email">
- <div name="email.outgoing_server">
- <button type="action"
- name="%(base.action_ir_mail_server_list)d"
- string="Configure outgoing email servers" class="oe_link"/>
+ <h2>Company</h2>
+ <div class="row mt16 o_settings_container">
+ <div class="col-xs-12 col-md-6 o_setting_box">
+ <div class="o_setting_left_pane">
+ <field name="group_multi_company"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="Multi-Companies" for="group_multi_company"/>
+ <div class="text-muted">
+ Manage multiple legal entities with separate accounting
+ </div>
+ <div class="content-group" attrs="{'invisible': [('group_multi_company','=',False)]}">
+ <div class="mt16">
+ <button name="%(base.action_res_company_form)d" icon="fa-arrow-right" type="action" string="Companies" class="btn-link"/>
+ </div>
+ <div id="company_share_partner">
+ <field name="company_share_partner"/>
+ <label string="Common Contact Book" class="o_light_label" for="company_share_partner"/>
+ </div>
+ </div>
+ </div>
</div>
- </div>
- </group>
- <group>
- <label for="id" string="Portal access"/>
- <div>
- <div>
- <field name="module_portal" class="oe_inline"/>
- <label for="module_portal"/>
- <p>
- When you send a document to a customer
- (quotation, invoice), your customer will be
- able to signup to get all his documents,
- read your company news, check his projects,
- etc.
- </p>
+ <div class="col-xs-12 col-md-6 o_setting_box" title="Configure company rules to automatically create SO/PO when one of your company sells/buys to another of your company." attrs="{'invisible': [('group_multi_company', '=', False)]}" id="inter_company">
+ <div class="o_setting_left_pane">
+ <field name="module_inter_company_rules" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="Inter-Companies Transactions" for="module_inter_company_rules"/>
+ <div class="text-muted">
+ Automate inter-companies transactions
+ </div>
+ <div class="content-group" attrs="{'invisible': [('module_inter_company_rules','=',False)]}" id="inter_companies_rules">
+ <div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
</div>
</div>
- </group>
- <group name="authentication">
- <label for="id" string="Authentication"/>
- <div>
- <div>
- <field name="module_auth_oauth"/>
- <label for="module_auth_oauth"/>
+ <div id="business_documents"/>
+ <h2>Users</h2>
+ <div class="row mt16 o_settings_container" id="default_user_rights">
+ <div class="col-xs-12 col-md-6 o_setting_box" title="By default, new users get highest access rights for all installed apps." id="access_rights">
+ <div class="o_setting_left_pane">
+ <field name="default_user_rights"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="Access Rights" for="default_user_rights"/>
+ <div class="text-muted">
+ Set custom access rights for new users
+ </div>
+ <div class="content-group" attrs="{'invisible': [('default_user_rights','=',False)]}">
+ <div class="mt16">
+ <field name="company_id" invisible="1"/>
+ <button type="object" name="open_default_user" string="Default Access Rights" icon="fa-arrow-right" class="btn-link"/>
+ </div>
+ </div>
+ </div>
</div>
- </div>
- </group>
- <group>
- <label for="id" string="Import / Export"/>
- <div>
- <field name="module_base_import" class="oe_inline"/>
- <label for="module_base_import"/>
- </div>
- </group>
- <group>
- <label for="id" string="Multi Company"/>
- <div name="group_multi_company">
- <field name="group_multi_company" class="oe_inline"/>
- <label for="group_multi_company"/>
- </div>
- </group>
- <group>
- <label for="id" string="Multi Currencies"/>
- <div name="group_multi_currency">
- <field name="group_multi_currency" class="oe_inline"/>
- <label for="group_multi_currency"/>
- </div>
- </group>
- <group attrs="{'invisible': [('group_multi_company','=',False)]}">
- <label for="module_inter_company_rules" string="Inter company"/>
- <div name="inter_company">
- <div name="module_inter_company_rules">
- <field name="module_inter_company_rules" class="oe_inline" widget="upgrade_boolean"/>
- <label for="module_inter_company_rules"/>
+ <div class="col-xs-12 col-md-6 o_setting_box">
+ <div class="o_setting_left_pane">
+ <field name="module_base_import" />
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="Import &amp; Export" for="module_base_import"/>
+ <div class="text-muted">
+ Allow users to import data from CSV/XLS/XLSX/ODS files
+ </div>
+ </div>
</div>
</div>
- </group>
- <group string="Shared resources" name="company_share_resources" attrs="{'invisible': [('group_multi_company','=',False)]}">
- <field name="company_share_partner" class="oe_inline" />
- </group>
- <div>
- <label string="New users access rights"/>
- <button type="object" name="open_default_user" string="Edit default access rights for new users" class="oe_inline oe_link" icon="fa-cogs"/>
- </div>
- <group string="Google Integration" name="google">
- <label for="id" string="Google Drive"/>
- <div name="google_drive">
- <div name="module_google_drive">
- <field name="module_google_drive" class="oe_inline"/>
- <label for="module_google_drive"/>
+ <div id="emails"/>
+ <h2>Integrations</h2>
+ <div class="row mt16 o_settings_container">
+ <div class="col-xs-12 col-md-6 o_setting_box">
+ <div class="o_setting_left_pane">
+ <field name="module_pad"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_pad"/>
+ <div class="text-muted">
+ Use external pads in Odoo Notes
+ </div>
+ <div class="content-group" attrs="{'invisible': [('module_pad','=',False)]}" id="msg_module_pad">
+ <div class="text-warning mt16"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
</div>
- </div>
- </group>
- <group name="google_analytics">
- <label for="id" string="Google Calendar"/>
- <div name="google_calendar">
- <div name="module_google_calendar">
- <field name="module_google_calendar" class="oe_inline"/>
- <label for="module_google_calendar"/>
- <div name="google_calendar_config_description" attrs="{'invisible': [('module_google_calendar','=',False)]}">
- <p>
- Once installed, you can configure your API credentials for "Google calendar"
- </p>
+ <div class="col-xs-12 col-md-6 o_setting_box">
+ <div class="o_setting_left_pane">
+ <field name="module_google_calendar" />
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="Google Calendar" for="module_google_calendar"/>
+ <div class="text-muted">
+ Synchronize your calendar with Google Calendar
+ </div>
+ <div class="content-group" attrs="{'invisible': [('module_google_calendar','=',False)]}" id="msg_module_google_calendar">
+ <div class="text-warning mt16"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 col-md-6 o_setting_box">
+ <div class="o_setting_left_pane">
+ <field name="module_google_drive" />
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="Google Drive" for="module_google_drive"/>
+ <div class="text-muted">
+ Create and attach Google Drive documents to any record
+ </div>
+ <div class="content-group mt16" attrs="{'invisible': [('module_google_drive','=',False)]}" id="msg_module_google_drive">
+ <div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 col-md-6 o_setting_box">
+ <div class="o_setting_left_pane">
+ <field name="module_google_spreadsheet" />
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_google_spreadsheet"/>
+ <div class="text-muted">
+ Extract and analyze Odoo data from Google Spreadsheet
+ </div>
+ <div class="content-group" attrs="{'invisible': [('module_google_spreadsheet','=',False)]}" id="msg_module_google_spreadsheet">
+ <div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 col-md-6 o_setting_box" id="module_auth_oauth">
+ <div class="o_setting_left_pane">
+ <field name="module_auth_oauth" />
+ </div>
+ <div class="o_setting_right_pane">
+ <label string="OAuth Authentification" for="module_auth_oauth"/>
+ <div class="text-muted">
+ Use external accounts to log in (Google, Facebook, etc.)
+ </div>
+ <div class="content-group mt16" attrs="{'invisible': [('module_auth_oauth','=',False)]}" id="msg_module_auth_oauth">
+ <div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 col-md-6 o_setting_box" id="oauth">
+ <div class="o_setting_left_pane">
+ <field name="module_auth_ldap"/>
+ </div>
+ <div class="o_setting_right_pane" name="auth_ldap_right_pane">
+ <label string="LDAP Authentification" for="ldaps"/>
+ <div class="text-muted">
+ Use LDAP credentials to log in
+ </div>
+ <div class="content-group" attrs="{'invisible': [('module_auth_ldap','=',False)]}" id="auth_ldap_warning">
+ <div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 col-md-6 o_setting_box" id="oauth">
+ <div class="o_setting_left_pane">
+ <field name="module_base_gengo"/>
+ </div>
+ <div class="o_setting_right_pane" name="base_gengo_right_pane">
+ <label string="Gengo Translations" for="module_base_gengo"/>
+ <div class="text-muted">
+ Translate your website with Gengo
+ </div>
+ <div class="content-group" attrs="{'invisible': [('module_base_gengo','=',False)]}" name="base_gengo_warning">
+ <div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+ </div>
</div>
</div>
</div>
- </group>
- <group string="Report Configuration" name="report">
- <label for="custom_footer"/>
- <div>
- <field name="custom_footer" class="oe_inline" widget="radio"/>
- </div>
- <label for="rml_footer" attrs="{'invisible':[('custom_footer','=', False)]}"/>
- <div>
- <field name="rml_footer" class="oe_inline" attrs="{'invisible':[('custom_footer','=', False)]}"/>
- </div>
- </group>
- <group string="RML Report Configuration" groups="base.group_no_one">
- <button name="%(base.preview_rml_report)d" string="Preview RML Report" type="action" colspan="2"/>
- <label for="rml_paper_format"/>
- <div>
- <field name="rml_paper_format" class="oe_inline"/>
- </div>
- <label for="font"/>
- <div>
- <field name="font" class="oe_inline"/>
- <button string="(reload fonts)" name="act_discover_fonts" type="object" class="oe_link"/>
- </div>
- <label for="rml_header"/>
- <div>
- <field name="rml_header"/>
- </div>
- <label for="rml_header2"/>
- <div>
- <field name="rml_header2"/>
- </div>
- <label for="rml_header3"/>
- <div>
- <field name="rml_header3"/>
- </div>
- </group>
- <div name="company_dependent_settings_message">
- <span>(*) This configuration is related to the company you're logged into.</span>
- </div>
+ </sheet>
</form>
</field>
</record>