Skip to content
Snippets Groups Projects
Commit 1d3cd7ee authored by dbkosky's avatar dbkosky Committed by dbkosky
Browse files

[FIX] account_edi_proxy_client: don't update the demo state


The issue is that the config param is data, which means that when the
module is updated, the config parameter will be updated (i.e. reset to
the 'demo' state), which will cause havoc on client databases. Even if
we set the record to 'noupdate=1', the existing clients will have the
record updated.

The solution is to remove the config param from the data entirely, thus
preventing it from being updated when updating the module, and instead
have a 'post_init_hook' that sets the parameter to 'demo' (this will
only happen when the module is installed, and never again).

closes odoo/odoo#86535

Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent c888fe08
No related branches found
No related tags found
No related merge requests found
from . import models
from odoo import api, SUPERUSER_ID
def _create_demo_config_param(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
env['ir.config_parameter'].set_param('account_edi_proxy_client.demo', 'demo')
......@@ -17,9 +17,9 @@ Odoo database.
},
'data': [
'security/ir.model.access.csv',
'data/config_demo.xml',
],
'installable': True,
'application': False,
'license': 'LGPL-3',
'post_init_hook': '_create_demo_config_param',
}
<?xml version="1.0" ?>
<odoo>
<record id="account_edi_proxy_client_demo" model="ir.config_parameter">
<field name="key">account_edi_proxy_client.demo</field>
<field name="value">demo</field>
</record>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment