Odoo Help

Welcome!

This community 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.

2

How to change the Date/Calendar widget to support Solar Hijri calendar?

By
Pooria Madani
on 2/8/13, 5:22 PM 4,395 views

I want to use OpenERP as the main ERP system for my company. The only problem is that our corporation does not use Georgian Calendar because of the geolocation of the company. In contrast, we are using Solar Hijri calendar as the offical calendar for dating our transactions.

I'm looking for direction to start. I know I have to implement it myself and there is no problem about that. But I don't know where to start.

Should keep inserting all the data into database based on Georgian Calendar but when I read them back into Web interface, I translate and convert them to Hijri Calendar ? If so what files or packages I should modify ?

Or it's better to change the server and make sure that the date is being inserted into database IS already converted to Hijri Calendar ? If so, where I'm suppose to start apply my change ?

Regards.

Probably you should indicate which operating system you will use. It may have bearing.

Martin
on 2/8/13, 6:24 PM

My server is Linux (Ubuntu or CentOS )

Pooria Madani
on 2/8/13, 6:37 PM

I don't want to change server date in to hijri I need some fields to enter Arabic date widget it is very important for person from midileast

prakash
on 4/29/13, 9:56 AM

Pooria I checked your application, but is there a way to change the whole calendar?

Omid Rezvani
on 8/21/13, 10:15 AM
4

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 2/9/13, 4:34 AM

Here is the way OpenERP handles data that are location specific:

  • 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

For information, the fields that are in the global context come from the context_get() method on the res.users object. You may have to overwrite this method if you want to add a new field in the global context which is sent to the client when the user logs in .

So, I think you should develop a module that:

  • _inherit the res.users object to add a preference field.selection whith the calendar he uses (gregorian / Solar Hijri)
  • overwrite the default calendar widget in the web client to use a .JS widget that support Solar Hijri calendar
  • do the translations between Solar Hijri and UTC when reading/writing dates in the widget (the current widget alreaady does this for all UTC timezones.)

Thanks for ur answer, I don't have any issue with time zone setting. All I'm trying to do is to make sure that all the recorded dates in the system is based on Solar Hijri Calendar, and but all I mean all the message that are sent, all the invoice transaction and etc.

Pooria Madani
on 2/9/13, 12:27 PM

So if I change the Calendar widget and you said, what will happen to the automatic "date" assignment that system does, like send/receiving messages, or date of the comments posted bellow invoices and etc ?

Pooria Madani
on 2/9/13, 12:28 PM

I need to add arabic date in some field like widget I dont wand keep to change all openerp in to Arabic date, any help ?

prakash
on 4/10/13, 4:06 AM

Thanks for the instructions. I will try to implement the proposed solution as I have the same requirements for my system.

Ali
on 7/22/13, 5:45 PM

There are many languages that use different calendars, is there a direct way to change the calendar? Is there a template for doing this?

Omid Rezvani
on 8/25/13, 5:23 AM
0
salman
On 2/24/15, 8:42 AM

Any advice regarding Hijri Calendar Widget..

see the below url

https://www.odoo.com/fr_FR/forum/help-1/question/urgent-islamic-date-widget-issue-73745

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 2/8/13, 5:22 PM
Seen: 4395 times
Last updated: 3/16/15, 8:10 AM