跳至內容
選單
此問題已被標幟
1 回覆
150 瀏覽次數

Bonjour 

Nous venons de basculer sur la version 18 et dans mes devis où bons de commandes, mode code produit apparait en plus de la description. Nous ne souhaitons pas que ce code apparaissent sur nos rapports seulement la description. Savez-vous comment faire ?

Merci

頭像
捨棄
最佳答案

Hi,


in Odoo 18, by default, reports like quotes, sales orders, or purchase orders now show both the product name and the internal reference (product code). This is because the QWeb templates have been updated to include product.default_code alongside product.name in the line description.


To remove the code from the reports and display only the description, you have a few options:

Option 1: Customize the QWeb report template


    Go to Settings → Technical → Reports → Reports.


    Find the report you want to modify (e.g., Quotation / Sale Order, Purchase Order).


    Open the QWeb template (under the Report Template field).


    Look for the line displaying the product, it often looks like:

     <t t-esc="line.product_id.display_name"/>

     Modify it to show only the name:

    <t t-esc="line.product_id.name"/>





Option 2: Create a studio/override snippet (no coding)


    If you don’t want to modify XML directly, you can use Odoo Studio:

        Edit the report in Studio.

        Select the product line.

        Remove or replace the field showing the internal reference (default_code).

        Save changes.


Option 3: Override in a custom module

    If you have a custom module, you can inherit the QWeb template:

         <template id="report_saleorder_document_custom" inherit_id="sale.report_saleorder_document">

    <xpath expr="//td[@class='product_name']" position="replace">

        <td><span t-esc="line.product_id.name"/></td>

    </xpath>

</template>


Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
10月 25
2
0
10月 25
2
2
10月 25
346
0
9月 25
1
0
9月 25
1