コンテンツへスキップ
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 accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

Remove Empty Space Between Widget

購読

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

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

Hi,

I added a custom widget field in the invoice_line_ids  view. The widget displays correctly, but it creates a  empty space between the widget , making the layout look uneven.

Screenshot attached.

How can I remove this extra space

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<data>
<record id="inherit_invoice_line" model="ir.ui.view">
<field name="name">inherit.invoice.line</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='quantity']" position="after">
<field name="current_on_hand_average_cost" optional="hide" groups="zl_account_base.groups_cost_group_manager"/>
<field name="cost" optional="hide" sum="Cost" groups="zl_account_base.groups_cost_group_manager"/>
<field name="product_type" column_invisible="1"/>
<!-- This button opens a wizard to update the cost of the invoice line -->
<button name="%(zl_product_report.action_update_cost_wizard)d"
type="action"
icon="fa-pencil"
aria-label="Update Cost"
title="Update Cost"
groups="zl_account_base.group_management"
invisible="not product_id"/>
<field name="is_cost_updated" column_invisible="1"/>
<field name="total_cost" optional="hide" sum="Total Cost" groups="zl_account_base.groups_cost_group_manager"/>
<field name="margin" optional="hide" sum="Margin" groups="zl_account_base.groups_cost_group_manager"/>
</xpath>

<!-- ONE XPATH - both icons together, right after product_id -->
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='product_id']" position="after">
<button data-hotkey="w"
name="action_open_product_transactions_wizard" type="object"
class="fa fa-info-circle btn-primary"
/>
<field name="company_stock_info" widget="company_stock_widget" nolabel="1" width="10px"/>
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/list/field[@name='account_id']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
<!-- <xpath expr="//field[@name='invoice_line_ids']/list/field[@name='tax_ids']" position="after">-->
<!-- <field name="line_tax_amount" optional="show" sum="Total Tax Amount"/>-->
<!-- </xpath>-->

</field>
</record>

<record id="view_move_form_margin_recompute" model="ir.ui.view">
<field name="name">account.move.form.margin.recompute</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<!-- Button for Customer Invoices -->
<button name="button_recompute_margins" type="object" string="Recompute Margins"
class="oe_highlight"
groups="zl_account_base.group_management" invisible="move_type not in ['out_invoice','out_refund']"/>

<!-- Button for Vendor Bills -->
<button name="recompute_margins_on_related_invoices" type="object" string="Update Sales Margins"
class="oe_highlight"
groups="zl_account_base.groups_cost_group_manager" invisible="move_type != 'in_invoice' or state != 'posted'"/>
help="Manually triggers the recalculation of margins on all sales invoices affected by this bill."/>
</xpath>
</field>
</record>

<!-- 2. Custom List View -->
<record id="view_invoice_line_analysis_tree" model="ir.ui.view">
<field name="name">account.move.line.analysis.tree</field>
<field name="model">account.move.line</field>
<field name="arch" type="xml">
<list string="Invoice Lines" create="false" edit="false" delete="false">
<field name="invoice_date" optional="show"/>
<field name="move_id"/>
<field name="partner_id" optional="show"/>
<field name="product_id"/>
<field name="quantity"/>
<field name="price_unit"/>
<field name="cost" optional="show"/>
<field name="margin" optional="show"/>
<field name="price_subtotal" sum="Total"/>
<field name="line_tax_amount" sum="Total Tax" optional="hide"/>
<button name="button_update_line_cost" type="object" icon="fa-refresh" help="Update Cost &amp; Margin for this line"/>
</list>
</field>
</record>


<!-- 1. Main Action Window -->
<record id="action_invoice_line_analysis" model="ir.actions.act_window">
<field name="name">Invoice Lines</field>
<field name="res_model">account.move.line</field>
<field name="view_mode">list,form</field>
<field name="view_id" ref="view_invoice_line_analysis_tree"/>
<field name="domain">[('display_type', '=', 'product'), ('move_id.state', '=', 'posted')]</field>
<field name="context">{
'search_default_sales_invoices': 1,
'create': False,
'edit': False,
'delete':False
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No invoice lines found. Let's create one!
</p>
</field>
</record>

<!-- 3. Custom Search View with Filters -->
<record id="view_invoice_line_analysis_search" model="ir.ui.view">
<field name="name">account.move.line.analysis.search</field>
<field name="model">account.move.line</field>
<field name="arch" type="xml">
<search string="Search Invoice Lines">
<field name="product_id"/>
<field name="partner_id"/>
<field name="move_id"/>
<separator/>
<filter string="Sales Invoices" name="sales_invoices" domain="[('move_id.move_type', '=', 'out_invoice')]"/>
<filter string="Purchase Bills" name="purchase_bills" domain="[('move_id.move_type', '=', 'in_invoice')]"/>
<filter string="Credit Notes" name="credit_notes" domain="[('move_id.move_type', '=', 'out_refund')]"/>
<filter string="Refunds" name="refunds" domain="[('move_id.move_type', '=', 'in_refund')]"/>
<group expand="0" string="Group By">
<filter string="Invoice/Bill" name="groupby_move" context="{'group_by': 'move_id'}"/>
<filter string="Product" name="groupby_product" context="{'group_by': 'product_id'}"/>
<filter string="Partner" name="groupby_partner" context="{'group_by': 'partner_id'}"/>
</group>
</search>
</field>
</record>

<!-- 4. Server Action for Mass Update -->
<record id="action_server_update_line_cost" model="ir.actions.server">
<field name="name">Update Cost &amp; Margin</field>
<field name="model_id" ref="account.model_account_move_line"/>
<field name="binding_model_id" ref="account.model_account_move_line"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
if records:
records.button_update_line_cost()
</field>
</record>

<record id="account_move_list_view_inherited" model="ir.ui.view">
<field name="name">account.move.list.view</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_out_invoice_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount_total_in_currency_signed']" position="after">
<field name="total_margin" sum="Total Margin"/>
</xpath>
</field>
</record>

<!-- 5. Menu Item -->
<menuitem
id="menu_invoice_line_analysis"
name="Invoice Lines"
parent="account.menu_finance_reports"
groups="zl_account_base.groups_cost_group_manager"
action="action_invoice_line_analysis"
sequence="100"/>
</data>
</odoo>

Any guidance would be appreciated.

Thanks.

0
アバター
破棄
アバター
Muhammad Farooq Iqbal
最善の回答

Below is a clean updated version. The main change is: remove width="10px" from the XML and control the widget column using a CSS/SCSS class.

1. Updated XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>

        <record id="inherit_invoice_line" model="ir.ui.view">
            <field name="name">inherit.invoice.line</field>
            <field name="model">account.move</field>
            <field name="inherit_id" ref="account.view_move_form"/>
            <field name="arch" type="xml">

                <!-- Add icon button + custom widget after product -->
                <xpath expr="//field[@name='invoice_line_ids']/list/field[@name='product_id']" position="after">

                    <button data-hotkey="w"
                            name="action_open_product_transactions_wizard"
                            type="object"
                            icon="fa-info-circle"
                            title="Product Info"
                            class="btn-link o_invoice_line_icon_btn"/>

                    <field name="company_stock_info"
                           widget="company_stock_widget"
                           nolabel="1"
                           class="o_company_stock_widget_col"/>

                </xpath>

                <!-- Add cost/margin fields after quantity -->
                <xpath expr="//field[@name='invoice_line_ids']/list/field[@name='quantity']" position="after">

                    <field name="current_on_hand_average_cost"
                           optional="hide"
                           groups="zl_account_base.groups_cost_group_manager"/>

                    <field name="cost"
                           optional="hide"
                           sum="Cost"
                           groups="zl_account_base.groups_cost_group_manager"/>

                    <field name="product_type"
                           column_invisible="1"/>

                    <button name="%(zl_product_report.action_update_cost_wizard)d"
                            type="action"
                            icon="fa-pencil"
                            aria-label="Update Cost"
                            title="Update Cost"
                            class="btn-link o_invoice_line_icon_btn"
                            groups="zl_account_base.group_management"
                            invisible="not product_id"/>

                    <field name="is_cost_updated"
                           column_invisible="1"/>

                    <field name="total_cost"
                           optional="hide"
                           sum="Total Cost"
                           groups="zl_account_base.groups_cost_group_manager"/>

                    <field name="margin"
                           optional="hide"
                           sum="Margin"
                           groups="zl_account_base.groups_cost_group_manager"/>

                </xpath>

                <!-- Hide account field by default -->
                <xpath expr="//field[@name='invoice_line_ids']/list/field[@name='account_id']" position="attributes">
                    <attribute name="optional">hide</attribute>
                </xpath>

            </field>
        </record>

    </data>
</odoo>

2. Add SCSS/CSS file

Create this file:

your_module/static/src/scss/invoice_line_widget.scss

Add this:

/* Reduce spacing for custom invoice line icons/widgets */

.o_field_x2many_list_row_add,
.o_list_view {
    .o_invoice_line_icon_btn {
        padding-left: 2px !important;
        padding-right: 2px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-width: 24px !important;
        width: 24px !important;
        text-align: center;
    }

    .o_company_stock_widget_col {
        width: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        padding-left: 2px !important;
        padding-right: 2px !important;
        text-align: center;
        white-space: nowrap;
    }

    .o_company_stock_widget_col > * {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
0
アバター
破棄
ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

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

登録
関連投稿 返信 ビュー 活動
Increase the width of the product description
column width
アバター
アバター
2
5月 24
3079
Fields [width & height]
width Height
アバター
0
6月 22
3616
How to register width and length of each item in a sale order? 解決済
sale.order.line width
アバター
アバター
1
3月 18
5049
Width of selection field 解決済
selection width
アバター
アバター
アバター
3
8月 17
7536
Kanban cards on 2 columns
kanban width
アバター
0
5月 17
5889
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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 Svenska ภาษาไทย 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