mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]Enabled advanced pricelist when pms is installed (#92)
This commit is contained in:
@@ -3,4 +3,4 @@
|
|||||||
from . import models
|
from . import models
|
||||||
from . import wizards
|
from . import wizards
|
||||||
from . import controllers
|
from . import controllers
|
||||||
from .init_hook import post_init_hook
|
from .init_hook import pre_init_hook
|
||||||
|
|||||||
@@ -84,5 +84,5 @@
|
|||||||
"static/src/xml/pms_base_templates.xml",
|
"static/src/xml/pms_base_templates.xml",
|
||||||
"static/src/xml/reservation_group_button_views.xml",
|
"static/src/xml/reservation_group_button_views.xml",
|
||||||
],
|
],
|
||||||
"post_init_hook": "post_init_hook",
|
"pre_init_hook": "pre_init_hook",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,15 @@ from odoo import SUPERUSER_ID
|
|||||||
from odoo.api import Environment
|
from odoo.api import Environment
|
||||||
|
|
||||||
|
|
||||||
def post_init_hook(cr, _):
|
def pre_init_hook(cr):
|
||||||
with Environment.manage():
|
with Environment.manage():
|
||||||
env = Environment(cr, SUPERUSER_ID, {})
|
env = Environment(cr, SUPERUSER_ID, {})
|
||||||
|
ResConfig = env["res.config.settings"]
|
||||||
|
default_values = ResConfig.default_get(list(ResConfig.fields_get()))
|
||||||
|
default_values.update(
|
||||||
|
{"group_product_pricelist": True, "group_sale_pricelist": True}
|
||||||
|
)
|
||||||
|
ResConfig.sudo().create(default_values).execute()
|
||||||
env["ir.config_parameter"].sudo().set_param(
|
env["ir.config_parameter"].sudo().set_param(
|
||||||
"product.product_pricelist_setting", "advanced"
|
"product.product_pricelist_setting", "advanced"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user