İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Error saving record in model inherited from crm.meeting?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
calendarcreateinherit
1 Cevapla
8112 Görünümler
Avatar
Anabela Damas

Hi, I've inherit the 'crm.meeting' and change the name to 'radar.eventos 'but now I can't save a record. I've this error :

   2013-06-17 19:06:56,060 27957 ERROR teste17junho openerp.netsvc: ValidateError
    The value "radar.eventos,4" for the field "calendar_attendee.ref" is not in the selection
    Traceback (most recent call last):
      File "/opt/openerp-7.0-20130516-231144/openerp/netsvc.py", line 292, in dispatch_rpc
        result = ExportService.getService(service_name).dispatch(method, params)
      File "/opt/openerp-7.0-20130516-231144/openerp/service/web_services.py", line 626, in dispatch
        res = fn(db, uid, *params)
      File "/opt/openerp-7.0-20130516-231144/openerp/osv/osv.py", line 188, in execute_kw
        return self.execute(db, uid, obj, method, *args, **kw or {})
      File "/opt/openerp-7.0-20130516-231144/openerp/osv/osv.py", line 144, in wrapper
        raise except_osv(inst.name, inst.value)
    except_osv: (u'ValidateError', u'The value "radar.eventos,4" for the field "calendar_attendee.ref" is not in the selection')

My code is: mymodule/mymodule.py

class radar_eventos(osv.osv):
    """ Model for Events """
    _name = 'radar.eventos'
    _description = "Events"
    _inherit = 'crm.meeting'
    _columns = {
        'state': fields.selection([
            ('novo', 'Novo'),
            ('cancelado', 'Cancelado'),
            ('agendado', 'Agendado'),
            ('emcurso', 'Em Curso'),
            ('realizado', 'Realizado'),
            ], 'Status', readonly=True),

        'eventotipo_ids': fields.many2many('radar.eventos.tipo', 'radar_tipo_eventos_rel',
            'evento_id','tipo_id','Tipo de Evento'),
        'id_evento': fields.char('Id Evento', size=64, readonly=True),
        'registo_id': fields.many2one('registos.vigilancia',u'Registo de Vigilância'),
        'accoes_tarefas_id': fields.one2many('accoes.tarefas','evento_id', u'Acções e Tarefas'),
        'ideias_id': fields.one2many('gestao.ideias','evento_id', u'Ideias'),
        'objectivos': fields.text('Objectivos'),

        #fields many2one - new tables
        'attendee_ids': fields.many2many('calendar.attendee', 'radar_attendee_rel', 'event_id', 'attendee_id', 'Attendees', states={'done': [('readonly', True)]}),

        'partner_ids': fields.many2many('res.partner', 'radar_partner_rel', 'meeting_id', 'partner_id',
            string='Attendees', states={'done': [('readonly', True)]}),

    }
    _defaults = {
            'state': 'novo',
    }

    def create(self, cr, uid, vals, context=None):
        if vals.get('id_evento') == None:
            vals['id_evento'] = self.pool.get('ir.sequence').get(cr, uid, 'radar.eventos.id_evento')
        return super(radar_eventos, self).create(cr, uid, vals, context)

    def copy(self, cr, uid, id, default=None, context=None):
        default.update({
            'id_evento': self.pool.get('ir.sequence').get(cr, uid, 'radar.eventos.id_evento'),
        })
        return super(radar_eventos, self).create(cr, uid, vals, context)
radar_eventos()

mymodule/mymodule_view.xml

    <record model="ir.ui.view" id="view_radar_eventos_form">
    <field name="name">Eventos Form</field>
    <field name="model">radar.eventos</field>
    <field name="inherit_id" ref="base_calendar.view_crm_meeting_form" />
    <field name="arch" type="xml">
    <xpath expr="/form/field[@name='state']" position="replace">
        <header>
        <field name="state" widget="statusbar"
            statusbar_visible="novo,agendado,emcurso,realizado,cancelado"/>
       </header>
    </xpath>

    <xpath expr="/form/sheet/div" position="after">
        <group>
        <group>
            <field name="id_evento"/>
        </group>
        <group>
            <field name="registo_id"/>
        </group>
        </group>
    </xpath>

    <xpath expr="/form/sheet/notebook/page/group/group/field[@name='categ_ids']" position="replace">
        <field name="eventotipo_ids" widget="many2many_tags" style="width: 50%%"/>
    </xpath>

    <xpath expr="/form/sheet/notebook/page/label[@for='description']" position="replace">
    </xpath>
    <xpath expr="/form/sheet/notebook/page/field[@name='description']" position="replace">
        <separator string="Descrição"/>
        <field name="description" placeholder="Descrição..."/>
        <separator string="Objectivos"/>
        <field name="objectivos" placeholder="Objectivos..."/>
    </xpath>

    <xpath expr="/form/sheet/notebook/page[@string='Invitations']" position="after">
        <page string="Ideias">
        <separator string="Informação sobre as ideias ...."/>
        <field name="ideias_id"/>
        </page>
        <page string="Acções e Tarefas">
        <separator string="Informação sobre as tarefas ...."/>
        <field name="accoes_tarefas_id"/>
        </page>
    </xpath>
    </field>
</record>

<!-- Tree View para os Eventos herdada do CRM Meeting -->

    <record model="ir.ui.view" id="view_radar_eventos_tree">
    <field name="name">Eventos Tree</field>
    <field name="model">radar.eventos</field>
    <field name="inherit_id" ref="base_calendar.view_crm_meeting_tree" />
    <field name="arch" type="xml">
    <xpath expr="/tree/field[@name='name']" position="before">
        <field name="id_evento"/>
        <field name="registo_id" string="Reg. Vigilância"/>
    </xpath>
    <xpath expr="/tree/field[@name='name']" position="after">
        <field name="eventotipo_ids"/>
        <field name="description" string="Descrição"/>
        <field name="objectivos"/>
    </xpath>
    <xpath expr="/tree/field[@name='user_id']" position="replace">
        <field name="user_id" string="Responsável"/>
    </xpath>
    <xpath expr="/tree/field[@name='state']" position="replace">
        <field name="state"/>
    </xpath>
    </field>
</record> 

<!-- Calendar View para os Eventos herdada do CRM Meeting -->
<record model="ir.ui.view" id="view_radar_eventos_calendar">
    <field name="name">Eventos Calendar</field>
    <field name="model">radar.eventos</field>
    <field name="priority" eval="2"/>
    <field name="inherit_id" ref="base_calendar.view_crm_meeting_calendar" />
    <field name="arch" type="xml">
    <xpath expr="/calendar" position="replace">
        <calendar string="Events" date_start="date" color="user_id" date_stop="date_deadline" date_delay="duration">
        <field name="name"/>
        <field name="user_id"/>
        <field name="eventotipo_ids"/>
        </calendar>
    </xpath>
    </field>
</record>

<!-- search View para os Eventos herdada do CRM Meeting -->


<record id="view_radar_eventos_search" model="ir.ui.view">
    <field name="name">Eventos Search</field>
    <field name="model">radar.eventos</field>
    <field name="inherit_id" ref="base_calendar.view_crm_meeting_search" />
    <field name="arch" type="xml">
    <xpath expr="/search/field[@name='name']" position="after">
        <field name="eventotipo_ids"/>
        <field name="id_evento"/>
        <field name="registo_id"/>
    </xpath>
    </field>
</record>

<!-- Action View para os Eventos herdada do CRM Meeting -->

<record id="action_radar_eventos" model="ir.actions.act_window">
    <field name="name">Eventos</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">radar.eventos</field>
    <field name="view_type">form</field>
    <field name="view_mode">calendar,tree,form</field>
    <field name="search_view_id" ref="view_radar_eventos_search"/> 
</record> 

<record model="ir.actions.act_window.view" id="action_radar_eventos_calendar">
    <field name="act_window_id" ref="action_radar_eventos"/>
    <field name="sequence" eval="1"/>
    <field name="view_mode">calendar</field>
    <field name="view_id" ref="view_radar_eventos_calendar"/>
</record>

<record model="ir.actions.act_window.view" id="action_radar_eventos_tree">
    <field name="act_window_id" ref="action_radar_eventos"/>
    <field name="sequence" eval="2"/>
    <field name="view_mode">tree</field>
    <field name="view_id" ref="view_radar_eventos_tree"/>
</record>

<record model="ir.actions.act_window.view" id="action_radar_eventos_form">
    <field name="act_window_id" ref="action_radar_eventos"/>
    <field name="sequence" eval="3"/>
    <field name="view_mode">form</field>
    <field name="view_id" ref="view_radar_eventos_form"/>
</record>

       <menuitem id="menu_eventos" name="Eventos" parent="menu_gestao_ideias"></menuitem>
    <menuitem id="menu_eventos_action" name="Eventos" parent="menu_eventos" action="action_radar_eventos"></menuitem>

I don't understand what am I doing wrong, can you please help me ?

I made a debug and in the function _links_get the res as this :

 [{'id': 1, 'name': u'Partner', 'object': u'res.partner'},
 {'id': 2, 'name': u'Product', 'object': u'product.product'},
 {'id': 3, 'name': u'Invoice', 'object': u'account.invoice'},
 {'id': 4, 'name': u'Voucher', 'object': u'account.voucher'},
 {'id': 5, 'name': u'Sales Order', 'object': u'sale.order'},
 {'id': 6, 'name': u'Event', 'object': u'calendar.event'},
 {'id': 7, 'name': u'Meeting', 'object': u'crm.meeting'},
 {'id': 8, 'name': u'Serial Number', 'object': u'stock.production.lot'},
 {'id': 9, 'name': u'Purchase Order', 'object': u'purchase.order'},
 {'id': 10, 'name': u'Project', 'object': u'project.project'},
 {'id': 11, 'name': u'Project task', 'object': u'project.task'}]

I think that I'm getting the error above because my module isn't in this list. I created my inherit with another name (radar.eventos) because I don't wanted to change the calendar of other modules, I wanted to keep the original in the other modules of Openerp and create a new one with new tables to my new module.

1
Avatar
Vazgeç
Avatar
ClueLogics Technologies Pvt. Ltd.
En İyi Yanıt

Hi

the the class name always treated a table in openERP , if you are want use same object crm.meeting then you must

change the class name crm_meeting or object name crm.meeting

so plz be careful in this part

Thanks
Sandeep

2
Avatar
Vazgeç
Anabela Damas
Üretici

Hi, I update my question above. If I understand what you told me to do, you told me to do like this :

_name = 'crm.meeting'
_inherit = 'crm.meeting'

But I wanted to create a new object with new tables, and keep the crm.meeting original to the other modules.

I made some debug and the res in the_links_get function doesn't have my module so it isn't in the seletion of field res in calendar.attendee... Do you know how to solve this ?

Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Is it possible to choose the priority of an overload of a function ? Çözüldü
function create inherit
Avatar
Avatar
2
Tem 25
5054
Override create on model with no create method?
create v7 inherit
Avatar
Avatar
1
Mar 15
7207
how can I find calendar edit form footer and inherit?
calendar templates inherit footer
Avatar
0
Mar 21
3113
How to override a method using inherit? Çözüldü
calendar inheritance inherit override
Avatar
Avatar
Avatar
2
Şub 18
34289
Jalali-calendar- odoo18
calendar
Avatar
Avatar
1
Tem 25
1443
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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