分类 odoo123开源之家 下的文章

今天写一写用JAVA仿写Odoo,为什么值得写呢?
老莫碰到了,我之前也碰到了odoo的时区问题,大家都碰到了。
老莫依照我https://github.com/leangjia/odoo-all-in-one-docker-compose的yml增加了东八区参数,起的容器里的定时发送邮件的任务变失灵了,原来好好的定时发工资条邮件,加了参数后,时间延后了8小时。

因此我说推荐用JAVA仿写odoo是值得的,上边的问题,它可能出现在base基础模块的代码里,也可能mail模块的代码也涉及时区,更可能在job任务模块的代码涉及时区。

假如,中国人用JAVA写出来的Odoo,应该不存在时区问题了吧?

附上链接:
https://gitee.com/ShinraL/avalon

原文来自odoo哥公众号

odoo日期类型字段的快捷录入
原创 odoo哥 Odoo哥
2025年01月17日 09:24 湖南
在odoo应用中,日期类型的字段比较常见。一般操作人员在UI录入日期时,都是通过鼠标点击,弹出日历下拉,然后选择不同的年、月、日。如果需要选择的年或月不是当前年月,还要去切换,这样可能会影响录入的效率。其实在Odoo框架源码中,有针对日期类型字段的快捷录入方式。我们来看源码:

addons\web\static\src\core\l10n\dates.js

关键的方法是:

/**
 * Smart date inputs are shortcuts to write dates quicker.
 * These shortcuts should respect the format ^[+-]\d+[dmwy]?$
 *
 * e.g.
 *   "+1d" or "+1" will return now + 1 day
 *   "-2w" will return now - 2 weeks
 *   "+3m" will return now + 3 months
 *   "-4y" will return now + 4 years
 *
 * @param {string} value
 * @returns {NullableDateTime} Luxon datetime object (in the user's local timezone)
 */
function parseSmartDateInput(value) {
    const match = value.match(smartDateRegex);
    if (match) {
        let date = DateTime.local();
        const offset = parseInt(match[2], 10);
        const unit = smartDateUnits[(match[3] || "d").toLowerCase()];
        if (match[1] === "+") {
            date = date.plus({ [unit]: offset });
        } else {
            date = date.minus({ [unit]: offset });
        }
        return date;
    }
    return false;
}

从这里可以看出,在日期型字段,我们可以录入一个类似‘+10'、'+3w'、'-1m'、'+1y'这样的字符串,odoo将根据录入内容自动计算出日期值。第一个符号为'+','-'号,表示在当前日期之后还是之前,后面跟着一个数字,最后面是一个字母:d-天,m-月,w-周,y-年,如果不带字母的表示默认为天。
比如今天是2025年1月17号,我在报价单的日期字段录入下图所示的内容:
图片
640.png
然后按回车键,系统将自动变换为15天后的日期:
图片
640 (1).png
好啦,这么好用的功能赶快写到用户操作手册中去吧,告诉客户他可以不用鼠标快速地录入想要的日期啦。

原文链接: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源:设置命令如下:

- 阅读剩余部分 -