コンテンツへスキップ
Odoo メニュー
  • サインイン
  • 無料で15日試す
  • アプリ
    財務
    • 会計
    • 請求
    • 経費
    • スプレッドシート(BI)
    • ドキュメント管理
    • 署名
    販売
    • CRM
    • 販売
    • POS店舗
    • POSレストラン
    • サブスクリプション
    • レンタル
    ウェブサイト
    • ウェブサイトビルダー
    • eコマース
    • ブログ
    • フォーラム
    • ライブチャット
    • eラーニング
    サプライチェーン
    • 在庫
    • 製造
    • 製品ライフサイクル管理 (PLM)
    • 購買
    • 整備
    • 品質
    人事業務
    • 従業員管理
    • 採用
    • 休暇管理
    • 人事評価
    • リファラル
    • フリート
    マーケティング
    • ソーシャルマーケティング
    • メールマーケティング
    • SMSマーケティング
    • イベント
    • マーケティングオートメーション
    • アンケート調査
    サービス
    • プロジェクト管理
    • タイムシート
    • フィールドサービス
    • ヘルプデスク
    • 計画
    • アポイントメント
    生産性向上ツール
    • ディスカッション
    • 承認
    • IoT
    • VoIP
    • ナレッジ
    • WhatsApp
    サードパーティアプリ Odooスタジオ Odooクラウドプラットホーム
  • インダストリー(業種別ソリューション)
    小売
    • 書店
    • アパレルショップ
    • 家具専門店
    • 食料品店
    • 金物店
    • 玩具店
    飲食・ホスピタリティ業界
    • バー・パブ
    • レストラン
    • ファストフード
    • ゲストハウス
    • 飲料販売代理店
    • ホテル
    不動産
    • 不動産会社
    • 建築事務所
    • 建設
    • 不動産管理
    • 造園
    • 住宅所有者組合
    コンサルティング
    • 会計事務所
    • Odooパートナー
    • マーケティングエージェンシー
    • 法律事務所
    • 人材派遣
    • 監査・認証
    製造
    • テキスタイル
    • 金属
    • 家具
    • 飲食
    • 醸造所
    • コーポレートギフト
    ヘルス & フィットネス
    • スポーツクラブ
    • 眼鏡店
    • フィットネスセンター
    • ウェルネス専門家
    • 薬局
    • ヘアサロン
    業種
    • 便利屋
    • IT ハードウェア・サポート
    • 太陽エネルギーシステム
    • 靴メーカー
    • クリーニングサービス
    • 空調設備サービス
    その他
    • 非営利団体
    • 環境機関
    • ビルボードレンタル
    • 写真
    • 自転車リース
    • ソフトウェアリセラー
    すべての業種を見る
  • コミュニティ
    学ぶ
    • チュートリアル
    • ドキュメンテーション
    • 認定
    • トレーニング
    • ブログ
    • ポッドキャスト
    教育サポート
    • 教育プログラム
    • Scale Up! ビジネスゲーム
    • Odooオフィス訪問
    ソフトを入手
    • ダウンロード
    • エディションを比較
    • リリース
    コラボレーション
    • Github
    • フォーラム
    • イベント
    • 翻訳
    • パートナーになる
    • パートナー様向けサービス
    • 会計事務所を登録
    サービス利用
    • パートナー一覧
    • 会計事務所一覧
    • 今すぐ相談する
    • 導入支援サービス
    • お客様一覧
    • サポート
    • アップグレード
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    製品デモを利用する
  • 料金
  • ヘルプ

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

  • CRM
  • e-Commerce
  • 会計
  • 在庫
  • PoS
  • プロジェクト
  • MRP
All apps
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

Error saving record in model inherited from crm.meeting?

購読

この投稿に活動があった際に通知を受け取ります

この質問にフラグが付けられました
calendarcreateinherit
1 返信
8136 ビュー
アバター
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
アバター
破棄
アバター
ClueLogics Technologies Pvt. Ltd.
最善の回答

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
アバター
破棄
Anabela Damas
著作者

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 ?

ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

今すぐアカウントを作成して、限定機能を利用したり、素晴らしいコミュニティと交流しましょう!

登録
関連投稿 返信 ビュー 活動
Is it possible to choose the priority of an overload of a function ? 解決済
function create inherit
アバター
アバター
2
7月 25
5101
Override create on model with no create method?
create v7 inherit
アバター
アバター
1
3月 15
7220
how can I find calendar edit form footer and inherit?
calendar templates inherit footer
アバター
0
3月 21
3125
How to override a method using inherit? 解決済
calendar inheritance inherit override
アバター
アバター
アバター
2
2月 18
34313
Jalali-calendar- odoo18
calendar
アバター
アバター
1
7月 25
1456
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • Github
  • Runbot
  • 翻訳
サービス
  • Odoo.shホスティング
  • サポート
  • アップグレード
  • カスタム開発
  • 教育プログラム
  • 会計事務所一覧
  • パートナー一覧
  • パートナーになる
企業情報
  • 会社概要
  • ブランドアセット
  • お問い合わせ
  • 採用情報
  • イベント
  • ポッドキャスト
  • ブログ
  • お客様一覧
  • リーガル情報 • プライバシーポリシー
  • セキュリティ
الْعَرَبيّة 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(オドゥー)は、CRM、eコマース、会計、在庫管理、POS、プロジェクト管理など、企業のさまざまな業務を一つのシステムで管理できる、ベルギー発のオープンソースのERPソフトウェアです。

高機能で使いやすく、完全に統合されたERPとして、ユニークな価値を提供しています。

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