ERPNext in off-line mode

Agree … it was always just the POS with offline capabilities (That would be items, customers, price list, warehouse, etc.)

1 Like

We are currently working to improve ERPNext POS functionalities and one of which is the capability to work offline and sync the data to the cloud when the system goes back online. We are considering of using the HTML5 localStorage (client-side storage) as a solution. Does anybody here has any experience with this as a user or as a developer? Any thoughts and inputs about HTML5 client-side storage would be greatly appreciated.

Some helpful links about HTML5

And also, we are working on a solution to create a mobile POS for mobile workers as well as to retail setup. Particularly those who are in a field service/sales industry with low to minimal internet access. Some of the functionalities that we are looking for are the following:

  • Scan bar code (mobile device or a handheld barcode scanner)
  • Portable bluetooth receipt printer
  • Geo location tracking
  • Time stamp tracking
  • Offline sales transaction
  • Calendar sync
  • Task/Project progress sync

Feel free to add comments and suggestions.

Thanks!
James / Semilimes

2 Likes

from my point of view as a chain retailer its not good solution to use HTML5 storage option (as much as i know its only in the browser) but it would be much better for long term use to have a small database in local machine to save the data and you might also use the time stamp that i mentioned earlier in my post above…

@ramielian, @jamesmedrano

We can achive this requirement using HTML5 but with a Small Database in the client side with Electron http://electron.atom.io/. and sqlite http://sqlite.org The issue in only how to maintaing the compatiblity of Business Logic that today is hardcoded in Python.

I have made some studies about this question of maintain data offline, and HTML5 is not the unique way, but is the way of less effort.

@max_morais_dmm you mean the actual data is not kept in the DB? but kept in python or am i understanding wrong?

@ramielian, no you got it wrong! I’m talking about the business logic, that manage the data, run the validations, and ensure the quality of the data, that current is managed in Python, and HTML5 only support JavaScript.

@max_morais_dmm so i think a simple cron job on server side after injecting the data from the offline client would do the trick of having the logic of python run the check and process the data, am i right?!

What benefits do you get from saving the data in a dedicated local database instead of html5 storage?

1 Like

@ramielian, not, the syncronization should be made using the API, so the validation will be made on the hands!

Let me try explain to you about what I’m talking.

When do you enter a new Sales Order, the system run some logics in the backend, for:

  • Pricing Rules
  • Exange Rates
  • Taxes and Changes Calculation
  • Taxes rules

These are the standard functions that today we already have in ERPNext that should will be moved to the Offline too, and requires or a re-code, of this in the client-side, or a smart way to get it working in offline, but reusing the active code that already have in the Python.

@javieralmancevo Backup, of course that you can provide a alternative way to backup.

Can you run me through the use case where having to have a database installed and maintained is worth being able to back up a few transactions that might not be able to synchronize with the server for a few hours? I feel like we might be looking at different use cases.

@javieralmancevo, I live in São Paulo city, and I have some leads interested in ERPNext, but they have stores in Mall’s, currently the major number of malls in São Paulo, have a shared internet connection of 2mb, without redundance, what forces the manager to get the data of the store at the end of the day, put it in a pendrive and upload in your home.

That is fucked up. You could have that functionality with html5 storage. You just need to create an export function. The advantage obviously is that you do not need to install or maintain anything. Just fire the client and everything works.

1 Like

@javieralmancevo, HTML5 WebSQL is SQLite too! But if you have SQLite (that is embedable) you can give the full database to the user! The unique difference will be in the data accessor that dont will store in HTML5 WebSQL or IndexedDB, another detail, you can generate the database in the server side, instead of send various JSONs to the client. Will be a single file.

as much as i understand from html5 it save the data to the browser memory, which will be deleted when the browser is closed or the system goes to restart or shutdown, but if replace it with local DB it will stay until the internet comes back with no time limit on that…

1 Like

This is a very interesting use case which we are also looking into. On our part we are trying to create a solution for mobile workers. Where field service and sales people who travels with their mobile device to places with minimal and intermittent internet signal can still process important sales transactions. Then later on will auto sync the data to the cloud.

1 Like

i think you are referring to the sessionStorage. HTML5 localStorage does not delete the data when the browser is closed. You might want to read this.

1 Like

@jamesmedrano, I have a small idea about offline, but the major issue is: It will require skeletons to various platforms and the Python code, should be transcoded.

Do you will need a Skeleton to Android, iOS, Windows + Linux + Mac OS.

The basic idea is that each skeleton use a WebView (in mobile, and Electron in all desktops), and the skeletons provide some integrations, like Printer, WebCam or Camera, Local Network, Hardwares e etc.

Here in Brazil any invoice should be registered in a hardware that is in the Local Network or is plugged as a device, so Offline capabilities is required for me.

@ramielian
No, html5 storage is persistent. You can close the browser or shut down the computer, and when you turn it back on the data is still there.

@max_morais_dmm I did not know about HTML5 WebSQL, Ill have to look into it. As long as it does not require installing and maintaining an external database it is a good solution. Do not care if it is html5 webSQL or json in html5 storage.

1 Like

It would be really cool to build a native POS in electron

2 Likes