Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

convert islamic datepicker from odoo8 to odoo9

Subscriure's

Get notified when there's activity on this post

This question has been flagged
datepickerodoo8.0odoo9.0
2 Respostes
3373 Vistes
Avatar
Mohamed Hamada


I have islamic datepicker work on odoo8 well

how can I convert it to odoo9 ?

please help

0
Avatar
Descartar
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
Descartar
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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
Missing moules in server
openerp odoo8.0 odoo9.0
Avatar
0
de juny 16
3610
Migration from Odoo 8 to 9 using OpenUpgrade 9.0
migration odoo8.0 openupgrade odoo9.0
Avatar
Avatar
1
d’oct. 25
5730
any help to Downgrade js file from v9 to v8
javascript odooV8 odoo8.0 odoo9.0
Avatar
0
de febr. 21
5085
Will Odoo continue supporting the forum module? Solved
forum website odoo8.0 odoo9.0
Avatar
Avatar
1
d’ag. 15
5008
Is there any module for manage test cases in odoo?
odoo9.0
Avatar
Avatar
1
de des. 24
6878
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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