Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

inherited view from base_calendar view

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
_inherits
2 Odpowiedzi
11466 Widoki
Awatar
oumaima

Hi everyone,I'm trying to inherit the base_calendar view in a new module that i was developed but i have these errors:

OpenERP Server Error

AssertionError: Did not expect element record there, line 1

myfile.py

from osv import fields,osv import time from datetime import datetime from tools.translate import _ from datetime import datetime, timedelta, date from dateutil import parser from dateutil import rrule from dateutil.relativedelta import relativedelta from openerp.osv import fields, osv from openerp.service import web_services from openerp.tools.translate import _ import pytz import re import time from openerp import tools, SUPERUSER_ID

class emploi_temps(osv.osv):

_name = 'emploi.temps'
_columns = {
  'name': fields.char('Objet',size=32, required=True),
  'date_debut': fields.datetime('Date Début', required=True),
  'date_fin': fields.datetime('Date fin', required=True),
  'professeur_id': fields.many2one('professeur.entity','Professeur', required=True),
}

emploi_temps()

class calendar_event(osv.osv):

_name = 'calendar.event'
_inherit='calendar.event'
_columns = {

}

calendar_event()

myfile.xml:

<?xml version="1.0" encoding="utf-8"?>

<openerp> <data>

<!--  ce menu est celui existant dans la barre en haut -->
<menuitem name="Gestion Emploi" id="menu_emp"/>

<menuitem name="Emploi" id="menu_emp1" parent="menu_emp"/>

    <record model="ir.ui.view" id="view_school_emploi_form">
        <field name="name">emploi.form</field>
        <field name="model">emploi.temps</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
           <form string="Emploi du temps"  version="7.0">

                <group col="4" colspan="6">      
                    <field name="professeur_id" />
                    <field name="name" />
                    <field name="date_debut" />
                    <field name="date_fin" />
                </group>
           </form>
        </field>
    </record>   

    <record model="ir.ui.view" id="view_school_emploi__tree">
        <field name="name">emploi.tree</field>
        <field name="model">emploi.temps</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Emploi du temps">
                <field name="professeur_id" />
                <field name="name" />
                <field name="date_debut" />
                <field name="date_fin" />
            </tree>
        </field>
    </record>


**<record model="ir.ui.view" id="view_calendar_inherit">
    <field name="name">calendar.event.inherit</field>
    <field name="model">calendar.event</field>
    <field name="type">calendar</field>
    <field name="inherit_id" ref="base_calendar.view_crm_meeting_calendar">calendar</field>
    <field name="arch" type="xml">

    </field>
</record>** 


<record model="ir.actions.act_window" id="action_school_emploi_form">
    <field name="name">Emploi du temps</field>
    <field name="res_model">emploi.temps</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form,calendar</field>
</record>

<!--  Et finalement il y a le menu qui contient l'action pour ouvrir la vue tree de ton module -->

<menuitem action="action_school_emploi_form" id="menu_emp2" parent="menu_emp1" />

</data> </openerp>

0
Awatar
Odrzuć
Awatar
Borni DHIFI
Najlepsza odpowiedź

Hi,

you can create the view calender without inherit.

For example :

<record id="emploi_temps_calendar" model="ir.ui.view">
            <field name="name">emploi.temps.calendar</field>
            <field name="model">emploi.temps</field>
            <field name="type">calendar</field>              
            <field name="arch" type="xml">
                <calendar color="professeur_id" date_delay="duration"
                    date_start="date_debut" string="temps">
                    <field name="name" />
                    <field name="date_debut" />
                    <field name="date_fin" />                        
                </calendar>
            </field>
</record>
0
Awatar
Odrzuć
oumaima
Autor

Hi thank you for your answer; I did it at first;but i want to create a recurrent meetings that's why i used the inheritance from the calendar_event;any other idea please?

nagarjuna

@oumaima your requirement is displaying multiple models data in same calendar view. right ?

Awatar
oumaima
Autor Najlepsza odpowiedź

Hi now i can install the module and i have not error;but i added a new class that i linked to my calendar view.The problem is that i want to display my calendar view in a new menuitem;also when i want to add a new element (in the enseignant view) i have a view a bad view calendar

emploi.py

class emploi_temps(osv.osv):

_name = 'emploi.temps'
_inherit = 'calendar.event'
_columns = {
  'professeur_id': fields.many2one('professeur.entity','Professeur', required=True),
}

emploi_temps()

emploi_view.xml

<openerp>
<data>



 <record model="ir.ui.view" id="event_form_view_inherit">
        <field name="name">emploi.temps.form</field>
        <field name="model">emploi.temps</field>
        <field name="inherit_id" ref="base_calendar.event_form_view"/>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <field name="name" position="after">
      <field name="professeur_id" />
    </field>
        </field>
    </record>


 <record model="ir.ui.view" id="event_tree_view_inherit">
        <field name="name">emploi.temps.tree</field>
        <field name="model">emploi.temps</field>
        <field name="inherit_id" ref="base_calendar.event_tree_view"/>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <field name="name" position="after">
      <field name="professeur_id" />
    </field>
        </field>
    </record>


 <record model="ir.ui.view" id="event_calendar_view_inherit">
        <field name="name">emploi.temps.calendar</field>
        <field name="model">emploi.temps</field>
        <field name="inherit_id" ref="base_calendar.event_calendar_view"/>
        <field name="type">calendar</field>
        <field name="arch" type="xml">
            <field name="name" position="after">
      <field name="professeur_id" />
    </field>
        </field>
    </record>

</data> </openerp>

professeur.py

enter code hereclass professeur_entity(osv.osv):

_name = 'professeur.entity'
_columns = {
  'name': fields.char('Nom', required=True, size=32),
  'prenom': fields.char('Prenom', required=True, size=32),
  'emp_ids': fields.one2many('emploi.temps','professeur_id', 'Emploi'),
}

professeur_entity()

professeur_view.xml

enter code here<!--  ce menu est celui existant dans la barre en haut -->
<menuitem name="Gestion professeur" id="menu_prof"/>

<menuitem name="Enseignant" id="menu_prof1" parent="menu_prof"/>

<record model="ir.ui.view" id="view_school_prof_form">
    <field name="name">prof.form</field>
    <field name="model">professeur.entity</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
       <form string="Enseignant"  version="7.0">
           <group col="4" colspan="6">       
               <field name="name"/>
               <field name="prenom"/>
            </group>
            <field name="emp_ids" colspan="4" nolabel="1" />    
       </form>
    </field>
</record>   

    <record model="ir.ui.view" id="view_school_prof_tree">
    <field name="name">prof.tree</field>
    <field name="model">professeur.entity</field>
    <field name="type">tree</field>
    <field name="arch" type="xml">
        <tree string="Enseignants"  version="7.0">
               <field name="name"/>
               <field name="prenom"/>

       </tree>
    </field>
</record>

<record model="ir.actions.act_window" id="action_school_prof_form">
    <field name="name">Liste des enseignants</field>
    <field name="res_model">professeur.entity</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
</record>

    <!--  Et finalement il y a le menu qui contient l'action pour ouvrir la vue tree de ton module -->

<menuitem action="action_school_prof_form" id="menu_prof2" parent="menu_prof1" />
0
Awatar
Odrzuć
Borni DHIFI

To display calendar view in a new menuitem . create a new record model="ir.actions.act_window" and with <field name="view_mode">calendar</field>

oumaima
Autor

Hi thank you for you're reply;i can install the module but when i click in the calendar view i have this error:Uncaught Error: Champ state inconnu dans le domaine [["state","in",["done"]]]

Borni DHIFI

in your view xml add <field name="state" invisible="1" />

oumaima
Autor

I did: <field name="state" position="replace"/> because it's a inherit view but it still doesn't work;any other idea please?

oumaima
Autor

it work now but the view is disorganized and when i cliked in the calendar view i have this error ;any idea please?
TypeError: Invalid attribute dictionary: str

Anabela Damas

Did you did it ? I'm trying to do something like this but the view is disorganized... And I also have that error :"TypeError: Invalid attribute dictionary: str" ...

oumaima
Autor

Hi Anabela,it work's for me i just change the inherited module and for the disorganized view you can rewrite the code of the inherited view

Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
unable to add column in res.users table Rozwiązane
_inherits
Awatar
Awatar
Awatar
Awatar
Awatar
17
gru 21
25741
how to change default digits of precision?
_inherits
Awatar
Awatar
1
gru 18
20393
Reg - _inherits OpenERP
_inherits
Awatar
Awatar
1
lip 15
7801
aading a new menuitem in fleet module
_inherits
Awatar
Awatar
2
mar 15
6168
TypeError: The model "fleet.vehicle" specifies an unexisting parent class "fleet.vehicle"
_inherits
Awatar
Awatar
Awatar
2
mar 15
9647
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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