Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TA#59101 [IMP] sale_privilege_level_pricelist : pricelist post install active #372

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sale_privilege_level_pricelist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
from odoo import api, SUPERUSER_ID


def _post_init_hook(cr, registry):
"""
Activate the pricelist feature in the settings.
"""
env = api.Environment(cr, SUPERUSER_ID, {})
config = env["res.config.settings"].create({})
config.group_product_pricelist = True
config._onchange_group_sale_pricelist()
config.execute()
3 changes: 2 additions & 1 deletion sale_privilege_level_pricelist/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Sale Privilege Level Pricelist",
"version": "14.0.1.0.0",
"version": "14.0.1.0.1",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
Expand All @@ -13,4 +13,5 @@
"depends": ["sale_privilege_level", "product"],
"data": ["views/sale_privilege_level.xml", "security/ir.model.access.csv"],
"installable": True,
"post_init_hook": "_post_init_hook",
}
Loading