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

Element '<field name="invoice_policy">' cannot be located in parent view

購読

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

この質問にフラグが付けられました
fieldsxmlproduct.productposition
1 返信
3911 ビュー
アバター
random_mai

 I want to move the fields to a different notebook (or tab) in the view and hide the company field: invoice_policy (Invoice Policy), tic_category_id (TaxCloud Category), company_id (Company). However, I encountered an error, this is applicable to the fields mentions:

When i use "position=replace" the fields:

Element '' cannot be located in parent view

When i call the fields again to their new position:

Field "tic_category_id" does not exist in model "product.product"


Here's my code, i am inheriting the form view in Inventory module:




<record id="view_product" model="ir\.ui\.view\"\>


\ \ \ \ \ \ \ \ \<field\ name=\"name\"\>custom.product.product.form.inherit</field>


       <field name="model">product.product</field>


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


        <field name="inherit_id" ref="product.product_normal_form_view" />


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


            <!-- When i do this i don’t encounter an error —>


            <field name="barcode" position="replace"/>


            <!-- When i do this i encounter an error an error —>


            <field name="invoice_policy" position="replace"/>


            <group name="group_general" position="inside">


                <!— No error here whenever i call the field —>


                <field name="barcode"/>


                <!— Error when calling again the invoice_policy, saying that it does not exist in product.product —>


                <field name="invoice_policy"/>


            </group>           


        </field>


    </record>



I'm not sure why these 3 fields are experiencing an error and why i can't use the field again. As much as possible i don't want to use xpath. Although, i tried xpath, i still encountered the error above.


Please help. Thank you so much


0
アバター
破棄
shubham shiroya

You can visible the invisible field
field name="field_name" invisible="0"/>

アバター
shubham shiroya
最善の回答

The error you're encountering when using position="replace" or calling the fields again in a different position is likely due to the fact that these fields are defined within a notebook (page or notebook) in the original view, and you're trying to replace or move them outside of that notebook.

To overcome this issue and move the fields to a different notebook or tab while hiding the company_id field, you can use the following approach:

record id="view_product" model=" rel="ugc">ir.ui.view">
fieldname="name">custom.product.product.form.inherit
field name="model">product.product
field name="priority" eval="6"/>
field name="inherit_id" ref="product.product_normal_form_view" />
field name="arch" type="xml">
data>
!-- Find the notebook/page where the fields are defined -->

xpath expr="//notebook/page[@name='page_general_information']" position="inside">
!-- Remove the company_id field -->
field name="company_id" position="replace">
field name="company_id" invisible="1"/>
/field>
-- Move the fields to a different notebook or tab -->
page string="Custom Tab">
group>
field name="invoice_policy"/>
field name="tic_category_id"/>
/group>
/page>
/xpath>
/data>
/field>
/record>

In the above code, we use an XPath expression to find the notebook (page_general_information) where the fields are defined. Then, we remove the company_id field by replacing it with a hidden version of itself ().

Next, we create a new page (or notebook tab) called "Custom Tab" and move the desired fields (invoice_policy and tic_category_id) inside this new page using the tag.

1
アバター
破棄
random_mai
著作者

I'm still getting an error. For company id -> ERR: Cannot read properties of undefined (reading 'company_id')

And for moving the invoice_policy and tic_category_id -> ERR: Field "invoice_policy" does not exist in model "product.product"

shubham shiroya

he invoice_policy and tic_category_id fields might be defined in related models or inherited models.
To resolve these errors and successfully move or hide the fields, you need to find the correct model where these fields are defined and update your code accordingly. Here's an example of how you can modify the code:

record id="view_product" model="ir.ui.view">
field name="name">custom.product.product.form.inherit</field>
field name="model">product.template</field>
field name="priority" eval="6"/>
field name="inherit_id" ref="product.product_template_only_form_view"/>
field name="arch" type="xml">
xpath expr="//page[@name='general_information']" position="inside">
field name="barcode" position="replace"/>
/xpath>
xpath expr="//page[@name='general_information']/group[@name='general_info_group']" position="inside">
field name="invoice_policy" position="replace"/>
field name="tic_category_id" position="replace"/>
/xpath>
/field>
/record>

In this modified code:

The model field is changed to product.template to match the correct model where the fields are defined.

The inherit_id is set to product.product_template_only_form_view to inherit the form view specific to the product.template model.

The <xpath> expressions are adjusted to target the correct locations within the view hierarchy, considering the new model and view.

random_mai
著作者

sorry, now i'm getting this error -> Field "invoice_policy" does not exist in model "product.template"

apparently it still doesn't exist. this is odoo16v if it helps

shubham shiroya

model in Odoo 16, you can use the following approach:
record id="view_product_template_form" model="ir.ui.view">
field name="name">custom.product.template.form.inherit</field>
field name="model">product.template</field>
field name="inherit_id" ref="product.product_template_only_form_view"/>
field name="arch" type="xml">
xpath expr="//field[@name='barcode']" position="replace">
!-- Your modified barcode field -->
/xpath>
xpath expr="//field[@name='tic_category_id']" position="replace">
<!-- Your modified tic_category_id field -->
/xpath>
xpath expr="//field[@name='company_id']" position="attributes">
attribute name="invisible">1</attribute>
/xpath>
/field>
/record>
In this example, I have assumed that the barcode and tic_category_id fields exist in the product.template model. You can modify the code inside the <xpath> tags to define the modifications you want to make to these fields.

Make sure to update the model attribute in the <record> tag to match the target model for your customization.

random_mai
著作者

the fields are now hidden, thank you for that. however, i still can't use invoice_policy and tic_category_id

random_mai
著作者

Can i use xpath to show the field?

shubham shiroya

yes,you can

random_mai
著作者

how can i use xpath to show the invisible field?

random_mai
著作者

<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 13.0px 'Helvetica Neue'
}

p.p2 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 13.0px 'Helvetica Neue';
min-height: 15.0px
}
</style>
<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue'
}

p.p2 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue';
min-height: 12.0px
}
</style>
<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 13.0px 'Helvetica Neue'
}

p.p2 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue';
min-height: 12.0px
}

p.p3 {
margin: 0.0px 0.0px 0.0px 0.0px;
font: 11.0px 'Helvetica Neue'
}
</style>
<p>&nbsp;&lt;xpath expr=&quot;//field[@name=&apos;invoice_policy&apos;]&quot; position=&quot;attributes&quot;&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;attribute name=&quot;invisible&quot;&gt;0&lt;/attribute&gt;</p>
<p>&lt;/xpath&gt;</p>

This code doesn't display the invoice_policy

random_mai
著作者

i need to use xpath instead of field since i am having an error that the field doesnt exist

shubham shiroya

xpath expr="//field[@name='invoice_policy']" position="attributes">
attribute name="invisible">0</attribute>
/xpath>

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

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

登録
関連投稿 返信 ビュー 活動
How make the values of a field dissappear in QWEB report?
xml product.product
アバター
アバター
1
5月 20
2693
Pass field value to iframe src 解決済
fields xml iframe
アバター
アバター
アバター
2
8月 22
8673
Is it possible to use fa-icons in field string?
fields xml string v14
アバター
アバター
1
2月 24
2450
View displays duplicate fields despite setting it as invisible 解決済
field product.product position odoo16features
アバター
アバター
アバター
2
6月 23
3322
Calling res.partner field in pos receipt
javascript fields xml odoo10
アバター
アバター
1
6月 23
4500
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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