Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Show product image and sales description on picking & delivery app

Naroči se

Get notified when there's activity on this post

This question has been flagged
imageinventorypicking
2 Odgovori
1513 Prikazi
Avatar
Yuqi Li

Hello every, I'm trying to add product image and sales description on picking & delivery app(note: not printed report). When you try to mark inventory, you need click Inverntory from Home page and click either picking/ delivery. After jumping to picking/ delivery page, you will see product name and quantity required. At this section, I hope to add product image & sales description next to product name. 

I'm not familiar with python, so please send step by step image and code. Thank you very much.

0
Avatar
Opusti
Christoph Farnleitner

What version of Odoo?

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


Try the following code to add the product image to the delivery line.

1- Inherit the model 'stock.move' and define the image field.

Python

from odoo import fields, models


class StockMove(models.Model):
"""Inherits the model stock move to add image field"""
_inherit = 'stock.move'

order_line_image = fields.Binary(string="Image",
related="product_id.image_1920",
help='Product Image in Sale orderLine')

2- Add the field in to the XML view.

    <field name="name">
stock.picking.view.form.inherit.order.line
</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='move_ids_without_package']//list//field[@name='product_id']"
position="after">
<field name="order_line_image" widget="image"
style="height:30px ;width:30px;" readonly="1"/>
</xpath>
</field>
</record>

3- Make sure that the Python file is added to the init file and the path of the XML file is added in the manifest file.

4- Result.



For more reference,

* https://apps.odoo.com/apps/modules/18.0/sale_product_image

* https://www.odoo.com/sl_SI/forum/pomoc-1/add-the-product-image-to-the-line-item-on-a-sales-and-purchase-order-252695


Hope it helps

0
Avatar
Opusti
Avatar
Piyush H
Best Answer

Hey Yuqi,

Important Prerequisites:

  • Odoo Version: This guide assumes you're using a relatively recent version of Odoo (14 or later). The steps should be similar in older versions, but the interface might look slightly different.
  • Developer Mode: Make sure you have activated developer mode in Odoo. (Settings > Activate the developer mode).

Step-by-Step Guide:

Step 1: Identify the Correct View

  1. Navigate to Picking/Delivery: Go to the Inventory app. Click on "Operations" and then either "Pickings" or "Deliveries" (depending on which one you want to modify).
  2. Open a Record: Open any existing picking or delivery order.
  3. Activate Debug Mode: Make sure you're in developer mode.
  4. Inspect the View: Click the Debug View icon (the bug icon in the top right corner).
  5. Choose "View: Form" or "View: Tree":
    • If you want to modify the form view (the detailed view of a picking), choose "View: Form".
    • If you want to modify the list view (the list of products within a picking), choose "View: Tree".
  6. Note the View ID: A popup will appear. Look for the "External ID". This is the technical name of the view. It will look something like stock.view_picking_form (for the form view) or stock.move.line.tree (for the tree view). Write this down! This is crucial.

Step 2: Create the Inherited View

  1. Go to Views: Go to Settings > Technical > User Interface > Views.
  2. Create a New View: Click "Create".
  3. Fill in the View Information:
    • View Name: Give it a descriptive name (e.g., picking_product_image_form or picking_product_image_tree).
    • Inherited View: Check the box next to "Inherited View".
    • Inherit From: In the "Inherit From" field, enter the External ID you wrote down in Step 1 (e.g., stock.view_picking_form or stock.move.line.tree).
    • Architecture: Leave this blank for now.

Step 3: Add the XML Code

  1. Choose the Correct XML Code: The XML code will depend on whether you're modifying the form view or the tree view.
    • Form View (Modifying the detailed picking view):
      <record id="picking_product_image_form" model="ir.ui.view">
          <field name="name">picking.product.image.form</field>
          <field name="inherit_id" ref="stock.view_picking_form"/>  <!-- REPLACE WITH YOUR VIEW ID -->
          <field name="arch" type="xml">
              <xpath expr="//field[@name='product_id']" position="after">
                  <field name="product_id.image_1920" widget="image" class="oe_avatar"/>
                  <field name="product_id.description_sale"/>
              </xpath>
          </field>
      </record>
      
    • Tree View (Modifying the list of products within the picking):
      <record id="picking_product_image_tree" model="ir.ui.view">
          <field name="name">picking.product.image.tree</field>
          <field name="inherit_id" ref="stock.move_line_tree"/>  <!-- REPLACE WITH YOUR VIEW ID -->
          <field name="arch" type="xml">
              <xpath expr="//field[@name='product_id']" position="before">
                  <field name="product_id.image_128" widget="image" style="width: 40px; height: 40px;"/>
              </xpath>
              <xpath expr="//field[@name='product_id']" position="after">
                  <field name="product_id.description_sale"/>
              </xpath>
          </field>
      </record>
      
  2. Paste the Code: Copy the appropriate XML code (either the form view or the tree view code) and paste it into the "Architecture" field of the view you're creating.
  3. Replace the View ID: IMPORTANT: In the XML code, find the line that says <field name="inherit_id" ref="YOUR_VIEW_ID"/>. Replace YOUR_VIEW_ID with the External ID you wrote down in Step 1. For example, if your External ID was stock.view_picking_form, the line should look like this: <field name="inherit_id" ref="stock.view_picking_form"/>.
  4. Save the View: Click "Save" to save the view.

Step 4: Clear Odoo's Cache

  1. Go to Reload Server Registry: Go to Settings > Technical > Actions > Reload Server Registry.
  2. Click "Reload Server Registry": Click the "Reload Server Registry" button. This clears Odoo's cache and forces it to recognize your changes.

Step 5: Test and Adjust

  1. Go Back to Picking/Delivery: Go back to the Inventory app and open a picking or delivery order.
  2. Check for the Image and Description: See if the product image and sales description are now displayed in the view you modified.
  3. Adjust if Necessary:
    • Image Size: If the image is too large or too small, you can adjust the width and height attributes in the XML code (in the <field> tag for the image). You can also try using a different image field (e.g., image_128 instead of image_1920 for a smaller image).
    • Description Placement: If the description is not in the right place, you might need to adjust the xpath expression. The xpath tells Odoo where to insert the new fields. Inspect the original view's XML (using the "View Architecture" option in developer mode) to find the correct location.

Explanation of the XML Code:

  • <record id="unique_id" model="ir.ui.view">: This creates a new view record in Odoo. The id should be a unique identifier for your view.
  • <field name="name">view.name</field>: This gives your view a name.
  • <field name="inherit_id" ref="original_view_id"/>: This tells Odoo that you're inheriting from an existing view. original_view_id is the External ID of the view you're modifying.
  • <field name="arch" type="xml">: This contains the XML code that defines the changes you're making to the view.
  • <xpath expr="//some/xpath/expression" position="after|before|inside|replace">: This is the most important part. It tells Odoo where to insert your new code.
    • expr="//some/xpath/expression": This is an XPath expression that selects a specific element in the original view's XML. You need to find the correct XPath expression to insert your code in the right place.
    • position="after|before|inside|replace": This tells Odoo how to insert your code:
      • after: Insert the code after the selected element.
      • before: Insert the code before the selected element.
      • inside: Insert the code inside the selected element (as a child element).
      • replace: Replace the selected element with your code.
  • <field name="product_id.image_1920" widget="image"/>: This adds the product image. product_id.image_1920 refers to the image_1920 field of the product_id (which is the product). widget="image" tells Odoo to display it as an image.
  • <field name="product_id.description_sale"/>: This adds the sales description.

Troubleshooting:

  • Nothing Happens:
    • Make sure you cleared the cache (Reload Server Registry).
    • Double-check that you entered the correct External ID in the inherit_id field.
    • Double-check that your XPath expression is correct.
  • Error Message:
    • Read the error message carefully. It will usually tell you what's wrong (e.g., invalid XML syntax, invalid XPath expression).
  • Image Not Displaying:
    • Make sure the product actually has an image.
    • Try using a different image field (e.g., image_128).
    • Check the image size and adjust the width and height attributes.
  • Description Not Displaying:
    • Make sure the product actually has a sales description.
    • Double-check that the field name is correct (description_sale).

This is a detailed guide, but it requires careful attention to detail. The most important parts are identifying the correct view, using the correct XML code, and making sure your XPath expression is correct. Good luck!

🚀 Did This Solve Your Problem?

If this answer helped you save time, money, or frustration, consider:

✅ Upvoting (👍) to help others find it faster

✅ Marking as "Best Answer" if it resolved your issue

Your feedback keeps the Odoo community strong! 💪

(Need further customization? Drop a comment—I’m happy to refine the solution!)

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Picking Customization Option
warehouses inventory picking
Avatar
Avatar
1
maj 25
2162
Version 16EE Two step delivery of inventory randomly changes to one step delivery.
inventory picking Rules
Avatar
0
dec. 24
1861
Inventory Packages inside one container package
inventory picking storage
Avatar
0
maj 23
2334
If a full package quantity is ordered, pick from a location containing the full quantity
inventory picking packagings
Avatar
Avatar
1
apr. 23
3409
PoS Sale from 2 locations
pos inventory picking
Avatar
Avatar
Avatar
3
maj 18
6265
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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