Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Show product image and sales description on picking & delivery app

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
imageinventorypicking
2 Răspunsuri
1447 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Christoph Farnleitner

What version of Odoo?

Imagine profil
Cybrosys Techno Solutions Pvt.Ltd
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Piyush H
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Picking Customization Option
warehouses inventory picking
Imagine profil
Imagine profil
1
mai 25
2079
Version 16EE Two step delivery of inventory randomly changes to one step delivery.
inventory picking Rules
Imagine profil
0
dec. 24
1808
Inventory Packages inside one container package
inventory picking storage
Imagine profil
0
mai 23
2262
If a full package quantity is ordered, pick from a location containing the full quantity
inventory picking packagings
Imagine profil
Imagine profil
1
apr. 23
3362
PoS Sale from 2 locations
pos inventory picking
Imagine profil
Imagine profil
Imagine profil
3
mai 18
6193
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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