Skip to content

Conversation

@peregrine-2024
Copy link

: This pull request resolves the Delivery Slip formatting inconsistency across different delivery validation states (Draft, Waiting, Ready, Done, Cancelled). The QWeb report template in the stock module has been modified to enforce a consistent layout that always displays 'Coda Part No.', 'Description', 'Ordered' (no decimals), and 'Delivered' (no decimals) fields.

Implemented solution using Cursor CLI automation
@peregrine-2024
Copy link
Author

🛠️ Automated Fix: Stock Delivery Slip Format Enhancement

This pull request implements a standardized delivery slip format for stock picking reports, ensuring consistent presentation of product information and quantities across all delivery validation states.

✅ Changes Overview

The following files were added and modified to achieve the desired formatting:


🔧 stock_delivery_slip_format/__init__.py
  • Added module initialization to include the models subpackage.
📄 stock_delivery_slip_format/__manifest__.py
  • Created manifest file defining:
    • Module name: Stock Delivery Slip Format
    • Version: 18.0.1.0.0
    • License: AGPL-3
    • Category: Inventory
    • Dependencies: stock
    • Data files: reports/delivery_slip_report.xml
    • Installable: True
📦 stock_delivery_slip_format/models/__init__.py
  • Imported stock_picking and stock_move modules for extension.
📦 stock_delivery_slip_format/models/stock_move.py
  • Extended the stock.move model with two new helper methods:
    • _get_formatted_ordered_qty() – Returns ordered quantity as an integer string (no decimals).
    • _get_formatted_delivered_qty() – Sums qty_done from move lines and returns result as an integer string (no decimals).
📄 stock_delivery_slip_format/models/stock_picking.py
  • Empty file created for potential future use; currently unused but retained for extensibility.
🖨️ stock_delivery_slip_format/reports/delivery_slip_report.xml
  • Inherited and customized the default delivery slip report (stock.report_deliveryslip) to enforce:
    • Consistent column headers:
      • Coda Part No.
      • Description
      • Ordered (right-aligned, no decimals)
      • Delivered (right-aligned, no decimals)
    • Updated table body to display:
      • Product default code (default_code)
      • Product display name (display_name)
      • Formatted ordered quantity using _get_formatted_ordered_qty()
      • Formatted delivered quantity using _get_formatted_delivered_qty()

🧪 Implementation Notes

  • The formatting logic ensures that both Ordered and Delivered quantities are displayed without decimal points.
  • Error handling is included in the quantity formatting functions to safely handle invalid or missing data.
  • The report override targets the correct HTML structure to maintain compatibility with Odoo’s standard delivery slip rendering.

⚠️ Review & Testing Requirements

Please verify:

  • The updated delivery slip report displays correctly in all delivery states.
  • Quantity formatting works as expected for various product configurations.
  • No regressions occur in existing functionality related to stock moves or pickings.

This change addresses Ticket #69878 by enforcing consistent formatting across delivery slips.


Odoo Ticket: 69878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants