Odoo Help

0

How do i provide one database to one client if i have multiple databases in one server?

By
samba
on 7/24/14, 3:22 AM 1,010 views

I have 4 database db1,db2,db3,db4 in my server. I have 4 clients c1,c2,c3,c4. Now if i give my url "http://ip:port" the client1 need to select his datanase from 4 databases. But i want like

When client1 enter our url like "http://IP:port" he should loginto db1 automatically without selecting db1.

 

5
Remya
On 7/24/14, 3:43 AM

First you have to hide the database list from the openerp interface.

For that you have to edit the below files.

base.xml (path : addons/web/static/src/xml/base.xml)

<t t-name="Login.dblist">

<select name="db">

<t t-foreach="db_list" t-as="db">

<t t-if="selected_db === db">

<option t-att-value="db" selected="true">

<t t-esc="db"/>

</option>

</t>

<t t-if="selected_db !== db">

<option t-att-value="db">

<t t-esc="db"/>

</option>

</t>

</t>

</select>

</t>

Now replace that selection "db" with a text box with the same name of the selection field as

<t t-name="Login.dblist">

<input name="db" type="text" value="" autofocus="autofocus"/>

</t>

EDIT :

Then in chrome.js (addons/web/static/src/js/chrome.js) comment the on_db_loaded method (line 676-690) , which is

on_db_loaded: function (result) {

     var self = this;

     this.db_list = result;

     if (!this.selected_db) {

        this.selected_db = result[0];

     }

     this.$("[name=db]").replaceWith(QWeb.render('Login.dblist', { db_list: this.db_list, selected_db: this.selected_db}));

     if(this.db_list.length === 0)

     { this.do_action("database_manager");

     }

     else if(this.db_list.length === 1)

     { this.$('div.oe_login_dbpane').hide();

    }

    else { this.$('div.oe_login_dbpane').show(); } },

comment the above full code.

For this refer the link 

 

Then provide link to each client. When they click their link, it automatically opens their database without selecting the db's. 

2

Hello Samba,

The best way ( as per my point of view) to do is : 

  1. Create each database with different database users, ( like openerp1, openerp2, openerp3, openerp4)
  2. Create 4 openerp-server (executable file) (Like openerp-server1, ....2,....3,....4)
  3. Create init and conf file separately ( but keep the addons as same)
  4. Start each OpenERP instance with separate port ( 8069, 8070, 8071,8072 etc ...)

​Now each of the OpenERP instance will be started from separate port. You can give this link ( with PORT) to your clients. They can never be able to access other database. Because other database should have been started to other port which they don't know.

Let me know if this helps,

Best Regards,

This is also a nice solution. For avoiding more executable file, i suggested the above solution

Remya
on 7/24/14, 8:04 AM

Yes Above is nice solution too. But remember, if your customer knows the other database then they can easily access that database. So it depends on which type of solution you want to implement. All the best (y)

Hiren Vora - CEO at Emipro Technologies Pvt. Ltd. India
on 7/24/14, 8:53 AM

I have created 3 openerp-server files,. You said init and conf file separately, Can you please give me exact name with path of these two files?. I am new to openerp, unable to find those files. I can run the instance with different ports.

samba
on 10/22/14, 12:33 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 7/24/14, 3:22 AM
Seen: 1010 times
Last updated: 3/16/15, 8:10 AM