Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
This Question begins Here:
What's not, the goal of this question ?
To be, a Â« Yet Another Question About Internationalization and Localization Â». (This is absolutely not the case).
What is the goal , of this Question ?
Replacing the OpenERP's standard Gregorian Calendar by a Hijri (Islamic) calendar, or giving the possibilitie to the user to choose the calendar he want to use.
Why not, there are probably thousands of OpenERP users around the world, and in many countries, where Gregorian calendar is not used, or at least an other calendar is in use (e,g Ethiopian, Thai, Chinese, Hindu, Hijri, Oromo, Somali, Iranian, Hebrew, BahÃ¡'Ã â¦ Calendars),
This lead us to a new question : How to change from the OpenERP's standard calendar, to any other calendar ?
Is there any possibilities to do that, in OpenERP, and How to achieve this task (using the OpenObject framework)?
Should us build a new module : Coded in Python or a Web module with JS ...?
Or, should us just modify an existing module ?
Can we do that, without the need of patching the original code , and without breaking it?
How to do this, without having to reinvent the wheel ?
Before going further, we must clarify something, which is for me a crucial point :
The Calendar is just the apparent part of the iceberg, and the hidden parts are, date and Time.
So, How Time, Date, and Calendar are handled in OpenERP ?
From this LINK (response from Fabien Pinckaers)
Data are stored in the database in UTC (not depending on the timezone of your users)
When the client receives the data, it translates it according to the timezone of the user which is on the global context that comes from the user preferences (so, the date/time you see on the screen is not the same than the one in the database)
The client sends back the new dates to the server under the UTC format
Known also that OpenERP relies on the following python libraries to handle all the Time, Date and calendar Data.
Python datetime - https://docs.python.org/2/library/datetime.html#module-datetime
Unfortunately, all this work was done based on the Gregorian calendar.
And this is also the case for Postgresql: the 'datetime values' are constrained by the natural rules for dates and times according to the Gregorian calendar ( taken from http://www.postgresql.org/docs/current/static/datetime-units-history.html)
- At the web side OpenERP use the following libraries: Javascrip dates used for parsing, formatting and processing - * jquery-ui-timepicker-addon* used to add a datetimepicker, datepicker or timepicker dropdown â¦
Where to begin ?
But, Time, Date and Calendar works fine in OpenERP (for the Gregorian sytem) !
The first idea that comes to me is, to just use Two functions in one single JS file, for converting from and to Gregorian calendar :
-The first, for converting from Gregorian to Hijri (or to any other calendar system) after reading data from DB and just before returning the result, to the calling function.
The second, for converting from Hijri to Gregorian, Just before returning the data for writing into the DB.
And let OpenERP Web doing his Job as before.
This way, we don't have to overwrite any files, but just inserting 2 calls to the related functions ( for example in dates.js). (No need to reinvent the wheel).
Is this enough ?
The next step, is to deal with the datetimepicker , and the hidden things â¦
Personnaly i've tried with 3 JS files:
and i can't get a suitable result, except the correct conversion of the current date field.
Tired of reading all the Firebug error messages, and the JS code, tired of reading between the lines of python code to see how things are done, to try to understand what's going on, and what's wrong.
So tired, that i've decided to stop working, and take a rest for some moments, take a cofee and browse the web ...
Browsing the web, with the help of my favorite search engine, and as if by chance i came across this link:
A wonderful thing.
This is an Open Question: Everyone interested by this subject should contribute not only by giving an answer, but above all by contributing to the question itself.
A way to show that the subject of the question is of great importance for many of OpenERP users.
And why not, making the solution to this question a part of the OpenERP Web.
The next steps ...
Giving the Responses ...
Building the Solution ... With the help of jQuery Calendars
To be continued ...
I have finished the convertion to hijri calendar in a separate module but the issue that i have is that calendar overrides the georgian calendar date so now the calendar of the system is hijri only, I'm working on to make it according to the user language ISA.
Also i have developed a simple workaround to solve this issue until i finish my previous hijri module where the user can see multi calendars like hijri, georgian and persian and he can set and change all the calendars once he change any of these date fields.
After one week there are no answers,no contributions.
Trying to attach a video file without success, so i've uploaded it here.
This is from my last work with the islamicdatejs
We can get a better date format ...
We can get a similar result with Hijri.js.
This is far from being a finished work ...
Pending the solution with "jquery calendars", Hard to do !
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/28/14, 1:13 AM|
|Seen: 6192 times|
|Last updated: 5/4/15, 10:16 AM|