"""Drop the Eskaera-specific pricelist setting. Eskaera used to resolve its own pricelist from `website_sale_aplicoop.pricelist_id`, which let it quote prices the rest of the shop did not use. Pricing is now the standard website_sale one, so the setting is gone and its parameter would otherwise linger in the database, looking like live configuration. """ import logging from odoo import SUPERUSER_ID from odoo import api _logger = logging.getLogger(__name__) OBSOLETE_PARAM = "website_sale_aplicoop.pricelist_id" def migrate(cr, version): if not version: return env = api.Environment(cr, SUPERUSER_ID, {}) param = ( env["ir.config_parameter"] .sudo() .search([("key", "=", OBSOLETE_PARAM)], limit=1) ) if not param: return _logger.info( "Removing obsolete config parameter %s (was pointing at pricelist %s). " "Eskaera now prices with the website pricelist.", OBSOLETE_PARAM, param.value, ) param.unlink()