From 903733a32036ace10a00f12ceef9857d209f3802 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Tue, 17 May 2016 12:32:28 +0200 Subject: [PATCH] [IMP] web/database manager: admin login & country Add inputs e-mail address and country when creating a newdatabase This will provide the installation of the correct chart of accounts at the installation of Accounting Use the provided login as the admin login, and set the email on the partner if the login set is an email Set the country on the company (and its partner) The countries are parsed from XML country list We take the opportunity to repair the `label for` which bind the label with the input only if the `id` attribute of the input is set with what is set in the `for` attribute of the label --- addons/web/controllers/main.py | 5 +- addons/web/views/database_manager.html | 66 +++++++++++++++++--------- openerp/service/db.py | 28 +++++++++-- 3 files changed, 71 insertions(+), 28 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index ce5bd3d81b0..4b7634da132 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -636,6 +636,7 @@ class Database(http.Controller): d['insecure'] = openerp.tools.config['admin_passwd'] == 'admin' d['list_db'] = openerp.tools.config['list_db'] d['langs'] = openerp.service.db.exp_list_lang() + d['countries'] = openerp.service.db.exp_list_countries() # databases list d['databases'] = [] try: @@ -657,7 +658,9 @@ class Database(http.Controller): @http.route('/web/database/create', type='http', auth="none", methods=['POST'], csrf=False) def create(self, master_pwd, name, lang, password, **post): try: - request.session.proxy("db").create_database(master_pwd, name, bool(post.get('demo')), lang, password) + # country code could be = "False" which is actually True in python + country_code = post.get('country_code') or False + request.session.proxy("db").create_database(master_pwd, name, bool(post.get('demo')), lang, password, post.get('login'), country_code) request.session.authenticate(name, 'admin', password) return http.local_redirect('/web/') except Exception, e: diff --git a/addons/web/views/database_manager.html b/addons/web/views/database_manager.html index 6602ed5635c..1dc5030c6c9 100644 --- a/addons/web/views/database_manager.html +++ b/addons/web/views/database_manager.html @@ -37,38 +37,58 @@ {% else %} - + {% endif %} {%- endmacro %} {% macro create_form() -%} -

Fill in this form to create an Odoo database. You may create - databases for different companies or for different goals (testing, - production). Once the database is created, you will be able to - install your first application.

+

Odoo is up and running!
+ Create a new database by filling out the form, + you'll be able to install your first app in a minute.

{{ master_input() }}
-
+
- +
-
- - +
+
+
+
+ + + +
+
+
+
+ +
+
+ + +
-
- - - -