Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

convert islamic datepicker from odoo8 to odoo9

Odoberať

Get notified when there's activity on this post

This question has been flagged
datepickerodoo8.0odoo9.0
2 Replies
3377 Zobrazenia
Avatar
Mohamed Hamada


I have islamic datepicker work on odoo8 well

how can I convert it to odoo9 ?

please help

0
Avatar
Zrušiť
Avatar
Mohamed Hamada
Autor Best Answer

it is donot work on any version except 8 without any errors or warning

but I solved it with another way

I didnot use JavaScript , I used only python and XML

and translated the traditional date from datetime field  to islamic date in Char field with the following code with out generate islamic calender Just convert date from traditional to higri date


import math
import datetime
from odoo import fields,models,api
from datetime import datetime,date
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
class Go_And_Inspection(models.Model):
    _name='inspection.report'
   inspection_date=fields.Datetime('Inspection Date ',required=True)
    higri_date=fields.Char('Higri Date ', compute="get_hijri_passport")

   @api.onchange('inspection_date')    
    def get_hijri_passport(self):
       
        if self.inspection_date:
          my_date = datetime.strptime(self.inspection_date, DEFAULT_SERVER_DATETIME_FORMAT)
          
          day = my_date.day
          mth = my_date.month
          yr = my_date.year
          self.higri_date=self.Gregorian2Hijri(yr, mth, day)
          #return self.higri_date
    
    def intPart(self,floatNum):
        if floatNum < -0.0000001: return math.ceil(floatNum - 0.0000001)
        return math.floor(floatNum + 0.0000001)

    def Gregorian2Hijri(self,yr, mth, day):
        if ((yr > 1582) or ((yr == 1582) and (mth > 10)) or ((yr == 1582) and (mth == 10) and (day > 14))):
           jd1 = self.intPart((1461 * (yr + 4800 + self.intPart((mth - 14) / 12.0))) / 4)
           jd2 = self.intPart((367 * (mth - 2 - 12 * (self.intPart((mth - 14) / 12.0)))) / 12)
           jd3 = self.intPart((3 * (self.intPart((yr + 4900 + self.intPart((mth - 14) / 12.0)) / 100))) / 4)
           jd = jd1 + jd2 - jd3 + day - 32075
        else:
           jd1 = self.intPart((7 * (yr + 5001 + self.intPart((mth - 9) / 7.0))) / 4)
           jd2 = self.intPart((275 * mth) / 9.0)
           jd = 367 * yr - jd1 + jd2 + day + 1729777

        l = jd - 1948440 + 10632
        n = self.intPart((l - 1) /10631.0)
        l = l - 10631 * n + 354
        j1 = (self.intPart((10985 - l) / 5316.0)) * (self.intPart((50 * l) / 17719.0))
        j2 = (self.intPart(l / 5670.0)) * (self.intPart((43 * l) / 15238.0))
        j = j1 + j2
        l1 = (self.intPart((30 - j) / 15.0)) * (self.intPart((17719 * j) / 50.0))
        l2 = (self.intPart(j / 16.0)) * (self.intPart((15238 * j) / 43.0))
        l = l - l1 - l2 + 29
        m = int(self.intPart((24 * l) / 709.0))
        d = int(l - self.intPart((709 * m) / 24.0))
        y = int(30 * n + j - 30)
                   
        self.higri_date=str(y) + "-"+ str(m) + "-" + str(d)
        return self.higri_date
    
    def Hijri2Gregorian(self,yr, mth, day):
        jd1 = self.intPart((11 * yr + 3) / 30.0)
        jd2 = self.intPart((mth - 1) / 2.0)
        jd = jd1 + 354 * yr + 30 * mth - jd2 + day + 1948440 - 385
        
        if jd > 2299160:
            l = jd + 68569
            n = self.intPart((4 * l) / 146097.0)
            l = l - self.intPart((146097 * n + 3) / 4.0)
            i = self.intPart((4000 * (l + 1)) / 1461001.0)
            l = l - self.intPart((1461 * i) / 4.0) + 31
            j = self.intPart((80 * l) / 2447.0)
            d = l - self.intPart((2447 * j) / 80.0)
            l = self.intPart(j / 11.0)
            m = j + 2 - 12 * l
            y = 100 * (n - 49) + i + l
                
        else:
            j = jd + 1402
            k = self.intPart((j - 1) / 1461.0)
            l = j - 1461 * k
            n = self.intPart((l - 1) / 365.0) - self.intPart(l / 1461.0)
            i = l - 365 * n + 30
            j = self.intPart((80 * i) / 2447.0)
            d = i - self.intPart((2447 * j) / 80.0)
            i = self.intPart(j / 11.0)
            m = j + 2 - 12 * i
            y = 4 * k + n + i - 4716
        
       return y, m, d
0
Avatar
Zrušiť
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Just to try to install it in V9 and check whether it get installed and it is working or not. If you get any errors in that process, just try to fix it and go forward.

Thanks

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Missing moules in server
openerp odoo8.0 odoo9.0
Avatar
0
jún 16
3611
Migration from Odoo 8 to 9 using OpenUpgrade 9.0
migration odoo8.0 openupgrade odoo9.0
Avatar
Avatar
1
okt 25
5731
any help to Downgrade js file from v9 to v8
javascript odooV8 odoo8.0 odoo9.0
Avatar
0
feb 21
5085
Will Odoo continue supporting the forum module? Solved
forum website odoo8.0 odoo9.0
Avatar
Avatar
1
aug 15
5009
Is there any module for manage test cases in odoo?
odoo9.0
Avatar
Avatar
1
dec 24
6879
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now