gpt4 book ai didi

odoo - 在离线模式下使用 openerp

转载 作者:行者123 更新时间:2023-12-02 15:21:59 25 4
gpt4 key购买 nike

我是 openerp 的新手,很抱歉问这个基本问题。

我们可以在openERP未连接到服务器的情况下保存和检索自定义模块的数据[离线模式]。如果"is",创建定制模块以便离线工作时应遵循哪些步骤。数据如何同步?如何在离线模式下连接openerp

【不关心离线数据存储限制】

最佳答案

你的问题不是那么基本。 OpenERP 本身没有离线模式。但是 OpenERP 是开源且完全可扩展的,因此您可以自己完成。

您可以使用 HTML5 Web Storage 实现此类功能。它允许您将数据本地存储在网络浏览器中。您的实现将负责启动时的数据检索和数据同步。当然,您将面临一些限制,例如存储限制(取决于浏览器 - 例如 5MB 或 10MB)和性能问题。

Point Of Sale OpenERP的模块实现了这样的本地存储。我不确定它是否已被使用,但您可以使用它作为示例。您可能想在此处查看实现此模块的本地存储功能的 Javascript - db.js .

该模块可以作为离线实现的一个很好的例子。不过,该模块不再使用离线模式。 db.js 文件开头的注释给出了很好的推理:

 /* The db module was intended to be used to store all the data needed to run the Point
* of Sale in offline mode. (Products, Categories, Orders, ...) It would also use WebSQL
* or IndexedDB to make the searching and sorting products faster. It turned out not to be
* a so good idea after all.
*
* First it is difficult to make the Point of Sale truly independant of the server. A lot
* of functionality cannot realistically run offline, like generating invoices.
*
* IndexedDB turned out to be complicated and slow as hell, and loading all the data at the
* start made the point of sale take forever to load over small connections.
*
* LocalStorage has a hard 5.0MB on chrome. For those kind of sizes, it is just better
* to put the data in memory and it's not too big to download each time you launch the PoS.
*
* So at this point we are dropping the support for offline mode, and this module doesn't really
* make sense anymore. But if at some point you want to store millions of products and if at
* that point indexedDB has improved to the point it is usable, you can just implement this API.
*
* You would also need to change the way the models are loaded at the start to not reload all your
* product data.
*/

关于odoo - 在离线模式下使用 openerp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21583977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com