コンテンツへスキップ
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
このフォーラムについて
ヘルプ

odoo 13 error while adding emplyoee id field in hr_employee module

購読

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

この質問にフラグが付けられました
1 返信
6966 ビュー
アバター
Madara

hi all iam trying to add a field (employee id)  in the employee module, so i have changed these but iam getting this error , but when upgrading the module iam getting this error

Error:

Odoo Server Error


Traceback (most recent call last):

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 392, in _check_xml

    self.postprocess_and_fields(view.model, view_doc, view.id)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 964, in postprocess_and_fields

    self.raise_view_error(message, view_id)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 592, in raise_view_error

    raise ValueError(message)

ValueError: Field `employee_id` does not exist


Error context:

View `hr.employee.form`

[view_id: 766, xml_id: hr.view_employee_form, model: hr.employee, parent_id: n/a]


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/odoo/odoo-server/odoo/tools/convert.py", line 712, in parse

    self._tag_root(de)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 674, in _tag_root

    f(rec)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 674, in _tag_root

    f(rec)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 577, in _tag_record

    record = model._load_records([data], self.mode == 'update')

  File "/odoo/odoo-server/odoo/models.py", line 4040, in _load_records

    data['record']._load_records_write(data['values'])

  File "/odoo/odoo-server/odoo/models.py", line 3978, in _load_records_write

    self.write(values)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write

    return super(View, self).write(self._compute_defaults(vals))

  File "/odoo/odoo-server/odoo/models.py", line 3556, in write

    fields[0].determine_inverse(real_recs)

  File "/odoo/odoo-server/odoo/fields.py", line 1114, in determine_inverse

    getattr(records, self.inverse)()

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch

    view.write(data)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write

    return super(View, self).write(self._compute_defaults(vals))

  File "/odoo/odoo-server/odoo/models.py", line 3551, in write

    real_recs._validate_fields(set(vals) - set(inverse_fields))

  File "/odoo/odoo-server/odoo/models.py", line 1167, in _validate_fields

    check(self)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 394, in _check_xml

    raise ValidationError("%s\n\n%s" % (_("Error while validating view"), tools.ustr(e)))

odoo.exceptions.ValidationError: ('Error while validating view\n\nField `employee_id` does not exist\n\nError context:\nView `hr.employee.form`\n[view_id: 766, xml_id: hr.view_employee_form, model: hr.employee, parent_id: n/a]', None)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/odoo/odoo-server/odoo/http.py", line 619, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/odoo/odoo-server/odoo/http.py", line 309, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 14, in reraise

    raise value

  File "/odoo/odoo-server/odoo/http.py", line 664, in dispatch

    result = self._call_function(**self.params)

  File "/odoo/odoo-server/odoo/http.py", line 345, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/odoo/odoo-server/odoo/service/model.py", line 93, in wrapper

    return f(dbname, *args, **kwargs)

  File "/odoo/odoo-server/odoo/http.py", line 338, in checked_call

    result = self.endpoint(*a, **kw)

  File "/odoo/odoo-server/odoo/http.py", line 910, in __call__

    return self.method(*args, **kw)

  File "/odoo/odoo-server/odoo/http.py", line 510, in response_wrap

    response = f(*args, **kw)

  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1324, in call_button

    action = self._call_kw(model, method, args, kwargs)

  File "/odoo/odoo-server/addons/web/controllers/main.py", line 1312, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/odoo/odoo-server/odoo/api.py", line 387, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

  File "/odoo/odoo-server/odoo/api.py", line 374, in _call_kw_multi

    result = method(recs, *args, **kwargs)

  File "<decorator-gen-65>", line 2, in button_immediate_upgrade

  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 72, in check_and_log

    return method(self, *args, **kwargs)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 629, in button_immediate_upgrade

    return self._button_immediate_function(type(self).button_upgrade)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function

    modules.registry.Registry.new(self._cr.dbname, update_module=True)

  File "/odoo/odoo-server/odoo/modules/registry.py", line 86, in new

    odoo.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/odoo/odoo-server/odoo/modules/loading.py", line 419, in load_modules

    force, status, report, loaded_modules, update_module, models_to_check)

  File "/odoo/odoo-server/odoo/modules/loading.py", line 315, in load_marked_modules

    perform_checks=perform_checks, models_to_check=models_to_check

  File "/odoo/odoo-server/odoo/modules/loading.py", line 225, in load_module_graph

    load_data(cr, idref, mode, kind='data', package=package, report=report)

  File "/odoo/odoo-server/odoo/modules/loading.py", line 68, in load_data

    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 736, in convert_file

    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 803, in convert_xml_import

    obj.parse(doc.getroot())

  File "/odoo/odoo-server/odoo/tools/convert.py", line 721, in parse

    exc_info[2]

  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 13, in reraise

    raise value.with_traceback(tb)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 712, in parse

    self._tag_root(de)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 674, in _tag_root

    f(rec)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 674, in _tag_root

    f(rec)

  File "/odoo/odoo-server/odoo/tools/convert.py", line 577, in _tag_record

    record = model._load_records([data], self.mode == 'update')

  File "/odoo/odoo-server/odoo/models.py", line 4040, in _load_records

    data['record']._load_records_write(data['values'])

  File "/odoo/odoo-server/odoo/models.py", line 3978, in _load_records_write

    self.write(values)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write

    return super(View, self).write(self._compute_defaults(vals))

  File "/odoo/odoo-server/odoo/models.py", line 3556, in write

    fields[0].determine_inverse(real_recs)

  File "/odoo/odoo-server/odoo/fields.py", line 1114, in determine_inverse

    getattr(records, self.inverse)()

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch

    view.write(data)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 490, in write

    return super(View, self).write(self._compute_defaults(vals))

  File "/odoo/odoo-server/odoo/models.py", line 3551, in write

    real_recs._validate_fields(set(vals) - set(inverse_fields))

  File "/odoo/odoo-server/odoo/models.py", line 1167, in _validate_fields

    check(self)

  File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 394, in _check_xml

    raise ValidationError("%s\n\n%s" % (_("Error while validating view"), tools.ustr(e)))

odoo.tools.convert.ParseError: "Error while validating view


Field `employee_id` does not exist


Error context:

View `hr.employee.form`

[view_id: 766, xml_id: hr.view_employee_form, model: hr.employee, parent_id: n/a]

None" while parsing /odoo/odoo-server/addons/hr/views/hr_employee_views.xml:2, near

<odoo>

    <data>


        <record id="view_employee_filter" model="ir.ui.view">

            <field name="name">hr.employee.search</field>

            <field name="model">hr.employee</field>

            <field name="arch" type="xml">

                <search string="Employees">

                    <field name="name" string="Employee" filter_domain="['|', ('work_email', 'ilike', self), ('name', 'ilike', self)]"/>

                    <field name="category_ids" groups="hr.group_hr_user"/>

                    <field name="job_id"/>

                    <separator/>

                    <filter string="Unread Messages" name="message_needaction" domain="[('message_needaction', '=', True)]"/>

                    <separator/>

                    <filter invisible="1" string="Late Activities" name="activities_overdue" domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"/>

                    <filter invisible="1" string="Today Activities" name="activities_today" domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>

                    <filter invisible="1" string="Future Activities" name="activities_upcoming_all" domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>

                    <separator/>

                    <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>

                    <group expand="0" string="Group By">

                        <filter name="group_manager" string="Manager" domain="[]" context="{'group_by': 'parent_id'}"/>

                        <filter name="group_department" string="Department" domain="[]" context="{'group_by': 'department_id'}"/>

                        <filter name="group_job" string="Job" domain="[]" context="{'group_by': 'job_id'}"/>

                    </group>

                    <searchpanel>

                        <field name="company_id" groups="base.group_multi_company" icon="fa-building"/>

                        <field name="department_id" icon="fa-users"/>

                    </searchpanel>

                </search>

             </field>

        </record>


        <record id="view_employee_form" model="ir.ui.view">

            <field name="name">hr.employee.form</field>

            <field name="model">hr.employee</field>

            <field name="arch" type="xml">

                <form string="Employee" js_class="hr_employee_form">

                    <field name="active" invisible="1"/>

                    <field name="user_partner_id" invisible="1"/>

                    <field name="hr_presence_state" invisible="1"/>

                    <header>

                        <button string="Chat" class="btn btn-primary o_employee_chat_btn" attrs="{'invisible': [('user_id','=', False)]}"/>

                        <button name="%(plan_wizard_action)d" string="Launch Plan" type="action" groups="hr.group_hr_manager"/>

                    </header>

                    <sheet>

                        <div name="button_box" class="oe_button_box">

                            <button id="hr_presence_button" class="oe_stat_button" disabled="1" attrs="{'invisible': ['|', ('last_activity', '=', False), ('user_id', '=', False)]}">

                                <div role="img" class="fa fa-fw fa-circle text-success o_button_icon" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}" aria-label="Available" title="Available"/>

                                <div role="img" class="fa fa-fw fa-circle text-warning o_button_icon" attrs="{'invisible': [('hr_presence_state', '!=', 'to_define')]}" aria-label="Away" title="Away"/>

                                <div role="img" class="fa fa-fw fa-circle text-danger o_button_icon" attrs="{'invisible': [('hr_presence_state', '!=', 'absent')]}" aria-label="Not available" title="Not available"/>


                                <div class="o_stat_info" attrs="{'invisible': [('hr_presence_state', '=', 'present')]}">

                                    <span class="o_stat_text">

                                        Not Connected

                                    </span>

                                </div>

                                <div class="o_stat_info" attrs="{'invisible': [('hr_presence_state', '!=', 'present')]}">

                                    <span class="o_stat_value" attrs="{'invisible': [('last_activity_time', '=', False)]}">

                                        <field name="last_activity_time"/>

                                    </span>

                                    <span class="o_stat_value" attrs="{'invisible': [('last_activity_time', '!=', False)]}">

                                        <field name="last_activity"/>

                                    </span>

                                    <span class="o_stat_text">Present Since</span>

                                </div>

                            </button>

                        </div>

                        <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>

                        <field name="image_1920" widget="image" class="oe_avatar" options="{&quot;zoom&quot;: true, &quot;preview_image&quot;:&quot;image_128&quot;}"/>

                        <div class="oe_title">

                            <h1>

                                <field name="name" placeholder="Employee's Name" required="True"/>

                            </h1>

                            <h2>

                                <field name="employee_id" placeholder="Employee Id" required="True"/>

                            </h2>

                            <h3>

                                <field name="job_title" placeholder="Job Position"/>

                            </h3>

                            <field name="category_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" placeholder="Tags" groups="hr.group_hr_manager"/>

                        </div>

                        <group>

                            <group>

                                <field name="mobile_phone" widget="phone"/>

                                <field name="work_phone" widget="phone"/>

                                <field name="work_email" widget="email"/>

                                <field name="work_location"/>

                                <field name="company_id" groups="base.group_multi_company"/>

                            </group>

                            <group>

                                <field name="department_id"/>

                                <field name="job_id"/>

                                <field name="parent_id"/>

                            </group>

                        </group>

                        <notebook>

                            <page name="public" string="Work Information">

                                <div id="o_work_employee_container"> <!-- These two div are used to position org_chart -->

                                    <div id="o_work_employee_main">

                                        <group string="Location">

                                            <field name="address_id" context="{'show_address': 1}" options="{&quot;always_reload&quot;: True, &quot;highlight_first_line&quot;: True}"/>

                                        </group>

                                        <group name="managers" string="Responsibles">

                                            <field name="coach_id"/>

                                        </group>

                                        <group name="departure" string="Departure" attrs="{'invisible': [('active', '=', True)]}">

                                            <field name="departure_reason"/>

                                            <field name="departure_description"/>

                                        </group>

                                        <group string="Schedule" groups="base.group_no_one">

                                            <field name="resource_calendar_id" required="1"/>

                                            <field name="tz"/>

                                        </group>

                                    </div>

                                </div>

                            </page>

                            <page name="personal_information" string="Private Information" groups="hr.group_hr_user">

                                <group>

                                    <group string="Private Contact">

                                        <field name="address_home_id" context="{                                                 'show_address': 1,                                                 'default_type': 'private',                                                 'form_view_ref': 'base.res_partner_view_form_private'}" options="{&quot;always_reload&quot;: True, &quot;highlight_first_line&quot;: True}"/>

                                        <field name="birthday"/>

                                        <field name="age"/>

                                        <field name="private_email" string="Email"/>

                                        <field name="phone" groups="hr.group_hr_user" string="Phone"/>

                                        <field name="bank_account_id" context="{'default_partner_id': address_home_id}"/>

                                        <field name="km_home_work" groups="hr.group_hr_user"/>

                                    </group>

                                    <group string="Citizenship">

                                        <field name="country_id" options="{&quot;no_open&quot;: True, &quot;no_create&quot;: True}"/>

                                        <field name="identification_id" groups="hr.group_hr_user"/>

                                        <field name="passport_id" groups="hr.group_hr_user"/>

                                        <field name="gender"/>

                                        <field name="place_of_birth" groups="hr.group_hr_user"/>

                                        <field name="country_of_birth" groups="hr.group_hr_user"/>

                                    </group>

                                    <group string="Marital Status">

                                        <field name="marital"/>

                                        <field name="spouse_complete_name" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}" groups="hr.group_hr_user"/>

                                        <field name="spouse_birthdate" attrs="{'invisible': [('marital', 'not in', ['married', 'cohabitant'])]}" groups="hr.group_hr_user"/>

                                    </group>

                                    <group string="Dependant">

                                        <field name="children"/>

                                    </group>

                                    <group string="Emergency">

                                        <field name="emergency_contact"/>

                                        <field name="emergency_phone"/>

                                    </group>

                                    <group string="Work Permit" name="work_permit">

                                        <field name="visa_no"/>

                                        <field name="permit_no"/>

                                        <field name="visa_expire"/>

                                    </group>

                                    <group string="Education">

                                        <field name="certificate"/>

                                        <field name="study_field"/>

                                        <field name="study_school"/>

                                    </group>

                                </group>

                            </page>

                            <page name="hr_settings" string="HR Settings" groups="hr.group_hr_user">

                                <group>

                                    <group string="Status" name="active_group">

                                        <field name="user_id" string="Related User"/>

                                    </group>

                                    <group string="Attendance" name="identification_group">

                                        <field name="pin" string="PIN Code"/>

                                        <label for="barcode"/>

                                        <div class="o_row">

                                            <field name="barcode"/>

                                            <button string="Generate" class="btn btn-link" type="object" name="generate_random_barcode" attrs="{'invisible': [('barcode', '!=', False)]}"/>

                                            <button name="%(hr_employee_print_badge)d" string="Print Badge" class="btn btn-link" type="action" attrs="{'invisible': [('barcode', '=', False)]}"/>

                                        </div>

                                    </group>

                                </group>

                            </page>

                        </notebook>


                    </sheet>

                    <div class="oe_chatter">

                        <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>

                        <field name="activity_ids" widget="mail_activity"/>

                        <field name="message_ids" widget="mail_thread"/>

                    </div>

                </form>

            </field>

        </record>


        <record id="view_employee_tree" model="ir.ui.view">

            <field name="name">hr.employee.tree</field>

            <field name="model">hr.employee</field>

            <field name="arch" type="xml">

                <tree string="Employees">

                    <field name="name"/>

                    <field name="work_phone"/>

                    <field name="work_email"/>

                    <field name="company_id" groups="base.group_multi_company"/>

                    <field name="department_id"/>

                    <field name="job_id"/>

                    <field name="parent_id"/>

                    <field name="coach_id" invisible="1"/>

                </tree>

            </field>

        </record>


        <record id="hr_kanban_view_employees" model="ir.ui.view">

           <field name="name">hr.employee.kanban</field>

           <field name="model">hr.employee</field>

           <field name="priority">10</field>

           <field name="arch" type="xml">

               <kanban class="o_hr_employee_kanban">

                   <field name="id"/>

                   <field name="hr_presence_state"/>

                   <templates>

                       <t t-name="kanban-box">

                       <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record">

                           <field name="image_128" widget="image" class="o_kanban_image_fill_left" options="{'zoom': true, 'zoom_delay': 1000, 'background': true, 'preventClicks': false}"/>


                            <div class="oe_kanban_details">

                               <div class="o_kanban_record_top">

                                   <div class="o_kanban_record_headings">

                                       <strong class="o_kanban_record_title">

                                            <div class="float-right" t-if="record.hr_presence_state.raw_value == 'present'">

                                                <span class="fa fa-circle text-success" role="img" aria-label="Present" title="Present" name="presence_present"/>

                                            </div>

                                            <div class="float-right" t-if="record.hr_presence_state.raw_value == 'absent'">

                                                <span class="fa fa-circle text-danger" role="img" aria-label="Absent" title="Absent" name="presence_absent"/>

                                            </div>

                                            <div class="float-right" t-if="record.hr_presence_state.raw_value == 'to_define'">

                                                <span class="fa fa-circle text-warning" role="img" aria-label="To define" title="To define" name="presence_to_define"/>

                                            </div>

                                            <field name="name" placeholder="Employee's Name"/>

                                       </strong>

                                       <span t-if="record.job_title.raw_value" class="o_kanban_record_subtitle"><field name="job_title"/></span>

                                   </div>

                               </div>

                               <field name="category_ids" widget="many2many_tags" options="{'color_field': 'color'}" groups="hr.group_hr_manager"/>

                               <ul>

                                   <li id="last_login"/>

                                   <li t-if="record.work_email.raw_value" class="o_text_overflow"><field name="work_email"/></li>

                                   <li t-if="record.work_phone.raw_value"><field name="work_phone"/></li>

                               </ul>

                           </div>

                       </div>

                       </t>

                   </templates>

               </kanban>

            </field>

        </record>


        <record id="hr_employee_view_activity" model="ir.ui.view">

            <field name="name">hr.employee.activity</field>

            <field name="model">hr.employee</field>

            <field name="arch" type="xml">

                <activity string="Employees">

                    <field name="id"/>

                    <templates>

                        <div t-name="activity-box">

                            <img t-att-src="activity_image('hr.employee', 'image_128', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>

                            <div>

                                <field name="name" display="full"/>

                                <field name="job_id" muted="1" display="full"/>

                            </div>

                        </div>

                    </templates>

                </activity>

            </field>

        </record>


        <record id="open_view_employee_list_my" model="ir.actions.act_window">

            <field name="name">Employees</field>

            <field name="res_model">hr.employee</field>

            <field name="view_mode">kanban,tree,form,activity</field>

            <field name="domain">[]</field>

            <field name="context">{}</field>

            <field name="view_id" eval="False"/>

            <field name="search_view_id" ref="view_employee_filter"/>

            <field name="help" type="html">

             <p class="o_view_nocontent_smiling_face">

               Add a new employee

             </p><p>

               With just a quick glance on the Odoo employee screen, you

               can easily find all the information you need for each person;

               contact data, job position, availability, etc.

             </p>

            </field>

        </record>


        <record id="open_view_employee_tree" model="ir.actions.act_window">

            <field name="name">Employees Structure</field>

            <field name="res_model">hr.employee</field>

            <field name="view_mode">tree,form</field>

            <field name="view_id" ref="view_employee_tree"/>

            <field name="domain">[('parent_id','=',False)]</field>

            <field name="search_view_id" ref="view_employee_filter"/>

        </record>


        <record id="open_view_employee_list" model="ir.actions.act_window">

            <field name="name">Employees</field>

            <field name="res_model">hr.employee</field>

            <field name="view_mode">form,tree</field>

            <field name="view_id" eval="False"/>

            <field name="search_view_id" ref="view_employee_filter"/>

        </record>


        <!-- Employee tree by manager -->

        <record id="view_partner_tree2" model="ir.ui.view">

            <field name="name">hr.employee.tree</field>

            <field name="model">hr.employee</field>

            <field name="priority" eval="20"/>

            <field name="arch" type="xml">

                <tree string="Employees">

                    <field name="name"/>

                    <field name="work_phone"/>

                    <field name="work_email"/>

                    <field name="company_id" groups="base.group_multi_company"/>

                    <field name="department_id"/>

                    <field name="job_id"/>

                    <field name="coach_id" invisible="1"/>

                    <field name="parent_id" invisible="1"/>

                </tree>

            </field>

        </record>


        <record id="act_employee_from_department" model="ir.actions.act_window">

            <field name="name">Employees</field>

            <field name="res_model">hr.employee</field>

            <field name="view_mode">kanban,form,tree</field>

            <field name="search_view_id" ref="view_employee_filter"/>

            <field name="context">{

                "searchpanel_default_department_id": active_id,

                "default_department_id": active_id}

            </ Field>

            <field name = "help" type = "html">

              <p class = "o_view_nocontent_smiling_face">

                Add a new employee

              </ P> <p>

                With just a quick glance on the Odoo employee screen, you

                can easily find all the information you need for each person;

                contact data, job position, availability, etc.

              </ P>

            </ Field>

        </ Record>


    </ Data>

</ Odoo>



hr.emp.py :

    name = fields.Char (string = "Employee Name", related = 'resource_id.name', store = True, readonly = False, tracking = True)

    employee_id = fields.Char (string = "Employee Id", related = 'resource_id.name', store = True, readonly = False, tracking = True)

    user_id = fields.Many2one ('res.users', 'User', related = 'resource_id.user_id', store = True, readonly = False)

    user_partner_id = fields.Many2one (related = 'user_id.partner_id', related_sudo = False, string = "User's partner")

    active = fields.Boolean ('Active', related = 'resource_id.active', default = True, store = True, readonly = False)



h_views.py:

                        <div class = "oe_title">

                            <H1>

                                <field name = "name" placeholder = "Employee's Name" required = "True" />

                            </ H1>

                            <H2>

                                <field name = "employee_id" placeholder = "Employee Id" required = "True" />

                            </ H2>

                            <H3>

                                <field name = "job_title" placeholder = "Job Position" />

                            </ H3>

                            <field name = "category_ids" widget = "many2many_tags" options = "{'color_field': 'color', 'no_create_edit': True}" placeholder = "Tags" groups = "hr.group_hr_manager" />

                        </ Div>


0
アバター
破棄
アバター
Niyas Raphy (Walnut Software Solutions)
最善の回答

Hi,

This error is raised when you use a field which is not defined in corresponding model. Here in the above code in the views you might have added the field employee_id in the views, just make sure that the field is added to corresponding model also.

If you have already added it to the model, make sure that the service is restarted and python file is called in the init file.

You can activate the developer mode and go to Settings -> Technical -> Database Structure -> Models, open the corresponidng model and see whether the added field is there or not.


See this: How to Fix Field Does Not Exist Error in Odoo


Also while posting any question try to post only relevant part of the error messages and relavant part of the code. Also please avoid posting same question multiple times :) .


Thanks

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

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

登録
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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