Odoo Help


Pycalverter - Python Calendar Converter. Any one know how to implement this tool?

on 4/23/14, 6:27 AM 4,327 views

pyCalverter (Python Calendar Converter) is a tool for python developers that need to use Persian(Jalali) or Hijri(Islamic) Calendar in their programs .

On the other side this tool can convert these calendars (hijri, jalahi, gregorian) together .

Bayazee pycalverter

Launchpad pycalverter

Please check the above two links.

Yug Faa
On 4/23/14, 7:22 AM


Copy the file calverter.py into your module

In the file __init__.py import the file :

import calverter

In your code re-import calverter using the path of your module and type :

cal = calverter.calverter()
jd = cal.gregorian_to_jd(2014, 04 , 23)
print jd
print cal.jd_to_islamic(jd)

The outopu will be :

(1435, 6, 22)

I implemeted it for my module and it works well.

Thanks for your reply Yug Faa. Shall i ask you a doubt? i created two char fields for both islamic date and gregorian date. When i enter islamic date on islamic date field, it should convert into geogorian & display in gregorian date field. How should i wrote python code for that? Please help me.

on 4/23/14, 7:58 AM

Firstly fi this help you, please make it resolved, for the next problem the georgian date have to be a date field and for the islamic is char, you can use on_change feature or make the georgian field as function

Yug Faa
on 4/23/14, 8:02 AM

hi Yug Faa .. please check this py file. import calverter

class convertor_convertor(osv.osv): _description = "converting dates" _name = "convertor" { cal = calverter.calverter() jd = cal.gregorian_to_jd(2014, 04 , 23) print jd print cal.jd_to_islamic(jd) }


on 4/23/14, 9:26 AM

please tell me is this is the correct form of our code.

on 4/23/14, 9:27 AM

hi i implement this code syntax error at cal = calverter.calverter() , How to solve this.

on 4/23/14, 10:16 AM

can you paste you code in pastebin.com and post the link here ? but before can you make this question SOLVED !

Yug Faa
on 4/23/14, 10:35 AM

no . I did n't make this here is the link. http://pastebin.com/tcAyKUG9

on 4/23/14, 10:47 AM

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/23/14, 6:27 AM
Seen: 4327 times
Last updated: 9/26/17, 12:15 AM