Пример #1
0
def migrate(env, version):
    if openupgrade.table_exists(env.cr,
                                "product_template_res_company_assignment_rel"):
        openupgrade.rename_tables(
            env.cr,
            [
                (
                    "product_template_res_company_assignment_rel",
                    "product_template_res_company_rel",
                ),
            ],
        )
        openupgrade.rename_columns(
            env.cr,
            {
                "product_template_res_company_rel": [
                    ("res_company_assignment_id", "res_company_id"),
                ],
            },
        )
    hooks.set_security_rule(env, "product.product_comp_rule")
    env.ref("stock.product_pulled_flow_comp_rule").write({
        "domain_force": ("['|', ('company_id', '=', False), ('company_id', "
                         "'in', company_ids)]"),
    })
    env.ref("stock.stock_location_route_comp_rule").write({
        "domain_force": ("['|', ('company_id', '=', False), ('company_id', "
                         "'in', company_ids)]"),
    })
Пример #2
0
def migrate(env, version):
    openupgrade.rename_tables(
        env.cr,
        [
            ('product_template_res_company_rel',
             'product_template_res_company_assignment_rel'),
        ],
    )
    openupgrade.rename_columns(
        env.cr, {
            'product_template_res_company_assignment_rel': [
                ('res_company_id', 'res_company_assignment_id'),
            ],
        })
    hooks.set_security_rule(env, 'product.product_comp_rule')
Пример #3
0
def migrate(env, version):
    openupgrade.rename_tables(
        env.cr,
        [
            ('res_company_res_partner_rel',
             'res_company_assignment_res_partner_rel'),
        ],
    )
    openupgrade.rename_columns(
        env.cr, {
            'res_company_assignment_res_partner_rel': [
                ('res_company_id', 'res_company_assignment_id'),
            ],
        })
    hooks.set_security_rule(env, 'base.res_partner_rule')
Пример #4
0
def migrate(env, version):
    if openupgrade.table_exists(env.cr,
                                "res_company_assignment_res_partner_rel"):
        openupgrade.rename_tables(
            env.cr,
            [
                (
                    "res_company_assignment_res_partner_rel",
                    "res_company_res_partner_rel",
                ),
            ],
        )
        openupgrade.rename_columns(
            env.cr,
            {
                "res_company_res_partner_rel": [
                    ("res_company_assignment_id", "res_company_id"),
                ],
            },
        )
        hooks.set_security_rule(env, "base.res_partner_rule")