mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] pms: Added init_hook.py to activate advanced pricelist when pms is installed
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
from .init_hook import post_init_hook
|
||||||
|
|
||||||
# from . import wizard
|
# from . import wizard
|
||||||
|
|||||||
@@ -72,4 +72,5 @@
|
|||||||
"qweb": [
|
"qweb": [
|
||||||
"static/src/xml/pms_base_templates.xml",
|
"static/src/xml/pms_base_templates.xml",
|
||||||
],
|
],
|
||||||
|
"post_init_hook": "post_init_hook",
|
||||||
}
|
}
|
||||||
|
|||||||
10
pms/init_hook.py
Normal file
10
pms/init_hook.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from odoo import SUPERUSER_ID
|
||||||
|
from odoo.api import Environment
|
||||||
|
|
||||||
|
|
||||||
|
def post_init_hook(cr, _):
|
||||||
|
with Environment.manage():
|
||||||
|
env = Environment(cr, SUPERUSER_ID, {})
|
||||||
|
env["ir.config_parameter"].sudo().set_param(
|
||||||
|
"product.product_pricelist_setting", "Advance"
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user