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

How to display another view that a form view when I click on a record ?

購読

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

この質問にフラグが付けられました
treevieweditrecordformviewpivot
9 返信
18232 ビュー
アバター
MIADI

Hello,

In a personal module, I have a model and when I click on a record in the treeview, I have the form view to edit this record.

How to display another form view (like a pivot view or other) ?

Thanks for answers

0
アバター
破棄
Mohammed Amal N

Hello Miadi,

Are you trying to add a pivot view for your model?

MIADI
著作者

When I click on a menuitem, I have a treeview with some records and when I click on a record, I want to show a pivot view.

MIADI
著作者

Instead of the form view that is display by default

Mohammed Amal N

I think what you are trying to achieve is making a pivot view for a single record instead of all the records of the model. As per my understanding this is not possible.

MIADI
著作者

Please check what I post in an answer and tell me if it's possible please

アバター
MIADI
著作者 最善の回答

Or, I found another solution : it's to add a button on each record to display the pivot view. but it's gives me this error :

AttributeError: type object 'miadi.tarifs' has no attribute 'display_pivot_view'


Here are my codes :

class miadi_tarifs(models.Model):
    _name = 'miadi.tarifs'
    
    code = fields.Char(string='Code', default='', required=True)
    libelle = fields.Char(string='Libellé', default='', required=True)
    remise = fields.Float(string='Remise', digits=(5,2), default=0)
    
    _sql_constraints = [
    ('uniq_id', 'unique(code)', 'A pricelist already exists with this code. It must be unique !'),
    ]

@api.multi
    def display_pivot_view(self):
        tarif = self.code
        return {'name': _('Pivot Lines'), 'view_type': 'form', 'view_mode': 'pivot,tree', 'view_id': False, 'views': [(self.env.ref('miadi_packaging.miadi_lignestarifs_pivot').id or False, 'pivot'), (self.env.ref('miadi_packaging.miadi_lignestarifs_tree').id or False, 'tree')], 'res_model': 'miadi.lignestarifs', 'type': 'ir.actions.act_window', 'target': 'current', 'domain': [('code_tarif', '=', tarif),]} #Retourne la vue tableau, la treeview et la vue formulaire
class miadi_lignesTarifs(models.Model):
    _name = 'miadi.lignestarifs'
    
    code_tarif = fields.Many2one('miadi.tarifs', 'Price Code', default='', required=True, ondelete='cascade')
    numero_ordre = fields.Integer('Order number')
    produit_id = fields.Many2one('product.product', 'Product', required=True, ondelete='cascade')
    conditionnement_id = fields.Many2one('miadi.packaging', 'Packaging', required=True, ondelete='cascade')
    prix_unitaire = fields.Float('Unit Price', default=0)
<record id="miadi_tarifs_tree" model="ir.ui.view">
            <field name="name">miadi.tarifs.tree</field>
            <field name="model">miadi.tarifs</field>
            <field name="arch" type="xml">
                <tree string="Prices" >
                    <field name="code" />
                    <field name="libelle" />
                    <field name="remise" />
                    <button name="display_pivot_view" type="object" string="Table view" class="oe_highlight" />
                </tree>
            </field>
        </record>

How to fix the problem ?

0
アバター
破棄
Mohammed Amal N

You give your button action in "wizard.pivot.view" and button in "miadi.tarifs"

Mohammed Amal N

also display button in form view not tree

MIADI
著作者

Yes I saw the error just before to see your comment.

I had a button in each record in the treeview because I want on click on the button to display the pivot view for this record

MIADI
著作者

Can you help me ?

With the code in the answer, when I click oon the button for a record, it display the pivot form but with all records (all prices) but I want only the pivot view for the record where I click on the button. I don't know if you understand me

Mohammed Amal N

Pivot view is usually used for analysing all datas. There is no point in showing a single record.

Anyway you can achieve that by passing required filters

MIADI
著作者

It worked in a post where you answered yesterday. So, why here it doesn't work ?

Mohammed Amal N

I told you whats the error.

MIADI
著作者

Yesterday, in this post (mine) : https://www.odoo.com/fr_FR/forum/aide-1/question/how-to-display-a-pivot-view-after-a-form-view-depending-of-a-field-120339

You gave me a solution to have the pivot view depending of one field and here, it's the same but it doesn't work...

The difference is, instead of open a wizard with a field, I add a button directly in the record in the table where the field were selected.

MIADI
著作者

I found the solution ! Thank you for your help

アバター
Tai Le Thanh
最善の回答

In the action

 <!-- action --> 
    <record id="yourid" model="ir.actions.act_window">
    <field name="name">....</field>
    <field name="res_model">yourmodel</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
</record>
I just know "view_type" which is the type of view when I click on a record
0
アバター
破棄
MIADI
著作者

Hi, I tried to put "pivot" instead of "form" in the view_type and it gives me : ParseError: "Wrong value for ir.actions.act_window.view_type: 'pivot'"

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

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

登録
関連投稿 返信 ビュー 活動
How to open another type of view thant a form view when I click on a record ?
click record formview pivot
アバター
2
6月 17
4654
From tree view to dynamic form view
treeview formview
アバター
アバター
1
9月 23
5417
How can I use a specific tree view with the pivot table
treeview pivot
アバター
アバター
2
5月 21
4922
Its possible to add a tree view inside a form view with group_by filter applied
treeview group_by formview
アバター
アバター
2
6月 22
4761
How to redirect to form view after clicking row in custom SQL tree view? (14.0)
views treeview formview
アバター
0
9月 21
3250
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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