İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

After validate the delivery slip is not comes up but get error code

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
deliverydeliverynoteInventory
4 Cevaplar
1779 Görünümler
Avatar
Mickey

Hi i try to validate delivery but get error message and delivery slip is not create.

Do you know to to solve this problem?


RPC_ERROR

Odoo Server Error


Traceback (most recent call last):
  File "<198>", line 142, in template_198
  File "<198>", line 42, in template_198_content
KeyError: 'doc'

 

1
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,


The error KeyError: 'doc' happens when the delivery slip report tries to use a variable doc that hasn’t been defined.


Odoo provides a variable called docs (a list of records), but the template is using doc without setting it first.


This usually happens in a custom module or a modified delivery slip report template.


To check this, activate Developer Mode > go to Technical > Reports > Reports > search for Delivery Slip > open the related QWeb template.


If you see something like <t t-esc="doc.name"/>, but there’s no doc defined, that’s the cause of the error.


To fix it, add <t t-set="doc" t-value="docs[0]"/> before using doc if only one record is printed.


If the report is for multiple deliveries, wrap your code in <t t-foreach="docs" t-as="doc"> ... </t> to make doc available.


After updating the template, upgrade your custom module and try validating the delivery again-the slip should now be created without errors.



Hope it helps

1
Avatar
Vazgeç
Mickey
Üretici

I followed your instruction but key error is change to "o"

odoo.addons.base.models.ir_qweb.QWebException: Error while render the template
KeyError: 'o'
Template: stock.report_delivery_document
Path: /t/t/t/t[2]
Node: <t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/>

code i updated as below; in report_deliveryslip

<t t-name="stock.report_deliveryslip">
<t t-set="doc" t-value="docs[0]"/>
<t t-foreach="docs" t-as="doc">
<t t-call="stock.report_delivery_document" t-lang="doc._get_report_lang()"/>
</t>
</t>

Avatar
Mickey
Üretici En İyi Yanıt

Finally, i did go to the template : web.address_layout (Customize by studioX)

 and delete  "Inherited View" and all work deliveryslip can print out.


Thank you for all help.


I appreciated.

0
Avatar
Vazgeç
Avatar
Piyush H
En İyi Yanıt

The error message KeyError: 'doc' in Odoo when validating a delivery slip indicates that the system is trying to access a variable or key named 'doc' that doesn't exist in the template or code being executed. This often occurs during the report generation process.

Here are steps to troubleshoot and resolve this problem:

1. Identify the specific report template:

  • The traceback indicates the error is within a template file <198>. You'll need to find the exact name of the delivery slip template being used.
  • In Odoo, go to Settings > Technical > Reporting > Reports. Search for "Delivery Slip" or a similar name related to delivery operations.
  • Once you find the report, examine its External ID (e.g., stock.report_delivery_slip). This ID helps identify the associated QWeb template.
  • Then, navigate to Settings > Technical > User Interface > Views and search for the external ID of the report to find the corresponding view.

2. Examine the QWeb template:

  • Open the QWeb view identified in the previous step.
  • Carefully review the template code, looking for where the variable doc is used. The error KeyError: 'doc' means that the code is trying to access a dictionary key or object property named doc, but it's not available in the context.
  • Possible causes:
    • Typo: A simple typo in the template code when referencing doc.
    • Missing Definition: The variable doc is not being properly passed or defined within the template's context.
    • Incorrect Context: The template is expecting a different type of object than what's being provided.

3. Check the report's Python code:

  • The QWeb template receives its data from a Python class. You need to find the Python code that generates the data for the delivery slip report.
  • Go to Settings > Technical > Actions > Reports. Find the delivery slip report. Check the "Model" field. This tells you which Odoo model is used as the basis for the report (e.g., stock.picking).
  • Examine the code related to that model, especially any methods that are called when generating the delivery slip. Look for how the doc variable (or its equivalent) is being prepared and passed to the QWeb template.
  • Possible issues:
    • The Python code is not correctly fetching or preparing the data that the template expects.
    • The doc variable is not being added to the context dictionary that's passed to the template.

4. Solutions

  • Correct the template: If there's a typo or missing definition in the QWeb template, fix it. Ensure that doc is correctly referenced and that all necessary data is available in the template's context.
  • Modify the Python code: If the Python code is not providing the correct data, adjust it to fetch the required information and pass it to the template. Make sure the doc variable (or its equivalent) is properly populated.
  • Check for customizations: If you or someone else has customized the delivery slip report, review those changes carefully. Customizations are often the source of such errors.
  • Update Odoo: If you're using an older version of Odoo, consider updating to the latest stable release. Bug fixes and improvements in newer versions might resolve the issue.
  • Check installed modules: In some cases, this error can be caused by a faulty or incompatible module. Try disabling recently installed modules to see if that resolves the issue.

Example Scenario and Solution

Let's say the delivery slip template has this line:

<span t-esc="doc.name"/>

And the Python code preparing the data looks like this:

def _get_report_values(self, docids, data=None):
    docs = self.env['stock.picking'].browse(docids)
    return {
        'doc_ids': docids,
        'doc': docs,
    }

In this case, doc is a collection of stock.picking records. To access the name of the first record, you should modify the template:

<span t-esc="doc[0].name"/>

0
Avatar
Vazgeç
Avatar
DataInteger Consultancy Services LLP
En İyi Yanıt
Cause

Your QWeb report (usually stock.report_deliveryslip_document ) tries to use the variable doc , but it's not defined .

In Odoo, the report engine passes a variable called docs (a recordset). If you use doc , you must define it first.


Step-by-Step Fix:
  1. Go to Developer Mode
    • Activate Developer Mode in Odoo.
  2. Navigate to QWeb Views
    • Menu: Technical → User Interface → Views
    • Search for the delivery slip template:
      Example: stock.report_deliveryslip_document (or your custom report)
  3. Edit the Template

At the top of the XML , add this line right after the opening <t> tag:

<t t-set="doc" t-value="docs[0]"/>
Example of Correct Template Structure
<t t-name="stock.report_deliveryslip_document">
  <t t-call="web.html_container">
    <t t-set="doc" t-value="docs[0]"/> <!-- ✅ Fix line -->
    <div class="page">
      <h2 t-esc="doc.name"/> <!-- Example usage -->
      <p t-esc="doc.partner_id.name"/>
      <!-- Your report content -->
    </div>
  </t-call>
</t>

This sets doc = docs[0] , so all your t-esc="doc.xyz" calls now work.

Why This Fix Works
  • docs is the standard list of records Odoo passes into QWeb reports.
  • If you're using doc , but it isn't defined from docs[0] , you get a KeyError .


Thanks & Regards,

Email: contact@datainteger.com 

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

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Delivery Note in Repair
delivery repair deliverynote
Avatar
Avatar
1
Ağu 20
3891
Quant's editing is restricted, you can't do this operation.
Inventory
Avatar
Avatar
Avatar
2
Kas 25
413
Error with Check Status
delivery
Avatar
0
Eyl 25
824
Odoo module to allow customers to sign off on delivery slip Çözüldü
delivery signature deliverynote deliveryslip v14
Avatar
Avatar
Avatar
2
Ağu 25
6672
How to attach specific locations to products
Inventory
Avatar
Avatar
Avatar
2
Ağu 25
1428
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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