odoo123开源之家 发布的文章

原文链接:https://www.odoo.com/zh_CN/page/flectra-vs-odoo-flectrahq-enterprise

以下摘录原文如下:

Odoo vs Flectra
History and facts behind the copyright infringement suit

Flectra is a fork of Odoo Community, and one of its initial goals was apparently to copy many features from Odoo Enterprise. In the early months of its existence, significant cases of copyright infringements of Odoo Enterprise were detected in the copied features inside Flectra. Its authors have a history of repeatedly copying and obfuscating proprietary code.

- 阅读剩余部分 -

【原创】源码安装多版本odoo(含odoo12.0、13.0、14.0、15.0、16.0、17.0、18.0)
思路:
前提基于ubuntu22,并且预先配好中国大陆ubuntu安装源:
参考:https://linuxmirrors.cn/use/

一、在ubunt安装好odoo的运行环境依赖:

sudo apt-get update
sudo apt-get install -y python3-pip
sudo apt install git python3-pip build-essential wget python3-dev python3-venv \
    python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev \
    python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev \
    libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev \
    liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev

二、Python 依赖安装好之后,还需要安装一些前端所需的npm依赖包:

sudo apt-get install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node

这里如果npm依赖包的安装很慢,请更换淘宝最新的npm源:设置命令如下:

- 阅读剩余部分 -

odoo17企业版破解笔记(20241012)

共修改5处:
1、将\odoo17-e-企业版\odoo_updated_modules17\mail\models\update.py第108行到114行注释失效,添加一行pass,其余不变:完整如下:

            # set_param = self.env['ir.config_parameter'].sudo().set_param
            # set_param('database.expiration_date', result['enterprise_info'].get('expiration_date'))
            # set_param('database.expiration_reason', result['enterprise_info'].get('expiration_reason', 'trial'))
            # set_param('database.enterprise_code', result['enterprise_info'].get('enterprise_code'))
            # set_param('database.already_linked_subscription_url', result['enterprise_info'].get('database_already_linked_subscription_url'))
            # set_param('database.already_linked_email', result['enterprise_info'].get('database_already_linked_email'))
            # set_param('database.already_linked_send_mail_url', result['enterprise_info'].get('database_already_linked_send_mail_url'))
            pass

此处完毕。
2、将\odoo17-e-企业版\odoo_updated_modules17\web\static\src\webclient\settings_form_view\widgets\res_config_edition.js第22行到27行的逻辑修改,完整如下:
将:

setup() {
    this.serverVersion = session.server_version;
    this.expirationDate = session.expiration_date
        ? DateTime.fromSQL(session.expiration_date).toLocaleString(DateTime.DATE_FULL)
        : DateTime.now().plus({ days: 30 }).toLocaleString(DateTime.DATE_FULL);
}

改为:

setup() {
    this.serverVersion = session.server_version;
    this.expirationDate = "This is an open version and has no expiration date."
}

此处完毕。
3、将\odoo17-e-企业版\odoo_updated_modules17\web_enterprise\models\ir_http.py第23行到40行全部注释失效,完整如下:

# def session_info(self):
#     ICP = self.env['ir.config_parameter'].sudo()
#     User = self.env['res.users']

#     if User.has_group('base.group_system'):
#         warn_enterprise = 'admin'
#     elif User.has_group('base.group_user'):
#         warn_enterprise = 'user'
#     else:
#         warn_enterprise = False

#     result = super(Http, self).session_info()
#     result['support_url'] = "https://www.odoo.com/help"
#     if warn_enterprise:
#         result['warning'] = warn_enterprise
#         result['expiration_date'] = ICP.get_param('database.expiration_date')
#         result['expiration_reason'] = ICP.get_param('database.expiration_reason')
#     return result

此处完毕。
4、将\odoo17-e-企业版\odoo_updated_modules17\web_enterprise\static\src\webclient\home_menu\enterprise_subscription_service.js第26行到31行注释失效并修改odoo有效期为6000年【this.expirationDate = DateTime.utc().plus({ years: 6000 });】,完整如下:

    // if (session.expiration_date) {
    //     this.expirationDate = deserializeDateTime(session.expiration_date);
    // } else {
    //     // If no date found, assume 1 month and hope for the best
    //     this.expirationDate = DateTime.utc().plus({ days: 30 });
    // }
    this.expirationDate = DateTime.utc().plus({ years: 6000 });

此处完毕。
第118行到123行完整修改如下:

// async checkStatus() {
//     await this.orm.call("publisher_warranty.contract", "update_notification", [[]]);

//     const expirationDateStr = await this.orm.call("ir.config_parameter", "get_param", [
//         "database.expiration_date",
//     ]);
//     this.lastRequestStatus = "update";
//     this.expirationDate = deserializeDateTime(expirationDateStr);
// }

async checkStatus() {
    await this.orm.call("publisher_warranty.contract", "update_notification", [[]]);
    const expirationDateStr = DateTime.now().plus({ years: 30 }).toLocaleString(DateTime.DATE_FULL);

此处完毕。
5、将\odoo17-e-企业版\odoo_updated_modules17\web_enterprise\static\src\webclient\settings_form_view\res_config_edition.xml全部改为:

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

    <t t-inherit="web.res_config_edition" t-inherit-mode="extension">

        <!-- <xpath expr="//h3" position="replace">
            <h3 class="px-0">
                Odoo <t t-esc="serverVersion"/> (Enterprise Edition)
            </h3>
        </xpath> -->

        <xpath expr="//h3" position="replace">
            <h3 class="px-0">
                Odoo <t t-esc="serverVersion"/> (Ali Faleh Edition)
            </h3>
        </xpath>

        <xpath expr="//*[@id='license']" position="replace">
            <a id="license" target="_blank" href="https://www.odoo.com/documentation/17.0/legal/licenses.html" style="text-decoration: underline;">Odoo Enterprise Edition License V1.0</a>
        </xpath>

        <!-- <xpath expr="//h3" position="after">
            <t t-if="expirationDate">
                <h5>Database expiration: <t t-esc="expirationDate"/></h5>
            </t>
        </xpath> -->

        <xpath expr="//h3" position="after">
            <t t-if="expirationDate">
                <h5>This is an open version and has no expiration date.</h5>
            </t>
        </xpath>

    </t>

</templates>

此处完毕。

用到了一个odoo容器管理模块:
基于源码安装的odoo,
在odoo里管理容器,
容器里跑的各种版本的odoo,
从odoo8\odoo9\odoo10\odoo11\odoo12\odoo13\odoo14\odoo15\odoo16\odoo17\odoo18。
模块名字叫:micro-saas,中文名叫迷你SAAS模块。
最终跑起来的效果如下图:
2024-08-30T16:10:43.png
2024-08-31T12:52:51.png
源码安装odoo,参考大佬写的这篇教程:
Ubuntu通过源码安装Odoo16

https://www.cnblogs.com/zhengdaojie/p/15832534.html

源码安装好odoo以后,
替换ubuntu的安装源,
再基于国内源再安装docker和docker-compose以及git,
最后把docker的源替换国内源,
注意这里国内源大部分已死掉,
目前1pannel源可用(截止时间20240831凌晨0:14),
从这里

https://cloud.tencent.com/developer/article/2445800
(截止20241202下午14:05已经打不开链接了)
源地址直接放出:

https://docker.1panelproxy.com

换源后,重新加载配置以及重启docker生效:

systemctl daemon-reload
systemctl restart docker

拷出来的docker最新国内源请随时留意更新,
源的问题会造成起容器失败!
因为默认会出国拉取postgresql镜像和odoo镜像,
出国要娣子翻强。

最后忘了贴模块地址了,
odoo官方app市场:

https://apps.odoo.com/apps/modules/17.0/micro_saas

里边有个requirements.txt写着

phonenumbers

用这篇里写的安装方法,增加安装进去。

收功!