can not set / change web.base.url

Asked by Ferdinand

apparently this is set as default, but IMHO will rarely be the one useful in production envirenment

"web.base.url": lambda: "http://localhost:%s" % config.get('xmlrpc_port'),

IMHO it must be possilbe to change this value somewhere

this seems not to do it.
./openobject-server/openerp/addons/base/res/res_users.py

        if uid == openerp.SUPERUSER_ID:
            # Successfully logged in as admin!
            # Attempt to guess the web base url...
            if user_agent_env and user_agent_env.get('base_location'):
                cr = pooler.get_db(db).cursor()
                try:
                    self.pool.get('ir.config_parameter').set_param(cr, uid, 'web.base.url',
                                                                   user_agent_env['base_location'])
                    cr.commit()
                except Exception:
                    logging.getLogger('res.users').exception("Failed to update web.base.url configuration parameter")
                finally:
                    cr.close()

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) said :
#1

(converting to a question, this is not a valid bug)

Revision history for this message
Ferdinand (office-chricar) said :
#2

Hmm obviously nobody knows how to change the wrong web.base.url using OpenERP (obviously using SQL is a work around)

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) said :
#3

The part of the code you are quoting first initializes the web.base.url with a default value only for the duration of the database creation. As soon as the admin logs into the system with the web client, the second part of the code you are quoting will set the web.base.url value to the base url the admin is using to connect to the web client.
Changing the value manually would not be a good idea, as it will be reset anyway as soon as the admin connects again.

However you are right, at the moment the second part of the system does not work in all cases, so something needs to be corrected there (I will reopen the bug for this part)

Can you help with this problem?

Provide an answer of your own, or ask Ferdinand for more information if necessary.

To post a message you must log in.