Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    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
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all IndustriesInauguration Odoo Lyon
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Server error on delivery note with kit

Subscribe

Get notified when there's activity on this post

This question has been flagged
manufacturingkitdeliverynotekits
1 Reply
228 Views
Avatar
Daniel Huying

We recently activated the manufacturing app (Version 19.0.2.0) in our Odoo 19.0 test system to see if bill-of-materials (BOM) for kits would be a suitable solution for us.

We created a BOM for a new article, then used it in a sales order. On attempt to print the delivery note, we're getting a server error:

Odoo Server Error

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 758, in _render_iterall
for item in frame.iterator:
File "<2064>", line 1372, in template_stock_report_delivery_document_2064_t_call_1
KeyError: 'move_lines'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/report.py", line 120, in report_download
response = self.report_routes(reportname, docids=docids, converter=converter, context=context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_qweb.py", line 852, in _render_iterall
raise QWebError(qweb_error_info) from error
odoo.addons.base.models.ir_qweb.QWebError: Error while rendering the template:
KeyError: 'move_lines'
Template: stock.report_delivery_document
Reference: 2064
Path: /t/t/t/div/t[21]/t
Element: <t t-set="move_lines" t-value="move_lines.filtered(lambda m: not m.move_id.bom_line_id)"/>
From: (2069, '/t/t/t', '<t t-call="stock.report_delivery_document" t-inner-content="True" t-options-lang="o._get_report_lang()"/>')
(2064, '/t/t', '<t t-call="web.html_container"/>')
(198, '/t/t[2]', '<t t-call="web.report_layout"/>')
(196, '/t/html/body/div/main/t', '<t t-out="0"/>')
(198, '/t/t[2]', '<t t-call="web.report_layout"/>')
(196, '/t/html/body/div/main/t', '<t t-out="0"/>')
(2064, '/t/t', '<t t-call="web.html_container"/>')
(2064, '/t/t/t', '<t t-call="web.external_layout"/>')
(2064, '/t/t/t/div/t[21]/t', '<t t-set="move_lines" t-value="move_lines.filtered(lambda m: not m.move_id.bom_line_id)"/>')

Has anyone else encountered this? How can it be fixed?


0
Avatar
Discard
Muhammad Farooq Iqbal

perfect

Avatar
Muhammad Farooq Iqbal
Best Answer

Hi,

This error is most likely coming from a customized or inherited delivery note report, not from the kit BoM itself.

The report is failing because this line is trying to use move_lines, but move_lines has not been defined before that point:

<t t-set="move_lines" t-value="move_lines.filtered(lambda m: not m.move_id.bom_line_id)"/>

So Odoo raises:

KeyError: 'move_lines'

Please check any custom / Studio inherited view of:

stock.report_delivery_document

Especially check any customization added to hide kit component lines or filter BoM lines.

The fix is to define move_lines before filtering it, or use the correct Odoo 19 variable from the delivery order, for example:

<t t-set="move_lines" t-value="o.move_line_ids"/>
<t t-set="move_lines" t-value="move_lines.filtered(lambda m: not m.move_id.bom_line_id)"/>

or adjust the report to use o.move_ids / o.move_line_ids depending on which section of the delivery slip you are customizing.

I would suggest reverting the delivery slip report to the standard version and testing again. If it prints correctly, then the issue is definitely in the inherited/custom report view, not in the kit setup.

0
Avatar
Discard
Daniel Huying
Author

The line in question is apparently being added by the inherited view
mrp.stock_report_delivery_document_inherit_mrp . This is directly below stock.report_delivery_document in the inheritance, and seems to have been added by the manufacturing module. Our custom view for the delivery note is at the same level, but it does not use or define a variable move_lines. Deactivating it eliminated the error; it is apparently overloading the section where move_lines is being defined. So it looks like I can take the solution from here.

Daniel Huying
Author

I added <t t-set="move_lines" t-value="o.move_line_ids"/> in our custom view and now the error no longer appears.

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

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

Sign up
Related Posts Replies Views Activity
A product with a kit-type bill of materials can not have a reordering rule Solved
manufacturing reordering kits
Avatar
Avatar
1
Jun 25
1749
How to break up delivery note into Kits? Odoo13
kit deliverynote Odoo13
Avatar
Avatar
1
Dec 23
4435
Manufacturing order for Kit BOM
manufacturing bom kit
Avatar
Avatar
1
Nov 23
4749
Kit Component replacement
manufacturing sale.order kit
Avatar
0
Oct 21
3452
MTO and availability of product online
sales manufacturing kit MTO
Avatar
Avatar
Avatar
3
Sep 24
2913
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 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