标签 odoo 下的文章

原文链接: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>

此处完毕。

浅浅试用了DataEase开源版,并且跟odoo结合起来了。下边是笔记:
1、安装DataEase的docker版:直接起容器:
用官方的或者用github上大佬出品的都可行:
我用的这里:https://github.com/wojiushixiaobai/dataease
2024-08-27T04:55:34.png
2、容器相互之间是隔离的,所以要想办法互通,目的是让DataEase能访问odoo的PG数据库:
先看看odoo的所在网络叫什么,用docker network ls查到叫odoo-13-docker-compose_default,
再看看DataEase的容器名叫什么,用docker ps看到名字叫de_core,
最后用下边命令,让容器de_core可访问odoo-13-docker-compose_default网段:
docker network connect odoo-13-docker-compose_default de_core
3、安装成功,登入DataEase管理后台,建数据源:目的是让DataEase能访问odoo的PG数据库:
http://odoo123.com:8100/
建数据源:
2024-08-27T05:04:40.png
可以在数据源表里看到Odoo的数据表啦:额外说一嘴,可以用来观察学习odoo的数据字典:
2024-08-27T05:05:29.png
4、最后这里安装了odoo的微信小程序商城模块,所以用oe举例建个数据集和仪表盘:
2024-08-27T05:07:01.png
5、数据集和结构:
2024-08-27T05:07:20.png
6、odoo的dataease仪表盘:
2024-08-27T05:08:16.png

有了这个神器,使用发散思维,可联想的空间挺大的。