Skip to Content
Menu
This question has been flagged
3 Replies
7364 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.

 

Avatar
Discard
Best Answer

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. 

Avatar
Discard
Best Answer

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,

Avatar
Discard

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

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)

Author

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.

Best Answer

here is the video reference


Avatar
Discard
Related Posts Replies Views Activity
0
Feb 25
598
2
Nov 24
4582
2
Oct 24
1851
2
Aug 24
1080
0
Apr 24
1044