Purchase Module Customization

Enhances procurement with multi-level approvals, vendor/product intelligence , and operational tools (line copying, pending quantities). Features employee accountability tracking, cancellation reasons, and visual product IDs. Includes comprehensive reporting and audit trails. Streamlines purchasing while improving compliance and decision-making.

Skills You'll Gain:
Odoo Module Development Workflow Automation Custom Model Design Security Rules UI/UX Customization
17 Tasks

Project Tasks

11. Purchase Order Print Counter

he customer wants to track how many times each purchase order has been printed. This will help monitor document circulation and identify frequently accessed orders.

Implementation Steps:
  1. In your extended purchase.order model to add Counter field
    • This field should be designed to store integer values
  2. Create method add_count() to increment counter
  3. In your extended purchase.order report template: Note: Mentioned on task NO 7
    • Display current print count on document example: Printed: 1 time
    • Increment counter when user prints the Purchase Order

12. Purchase Cancel Reason Model and Configuration View

Create a system to manage predefined cancellation reasons for purchase orders, allowing administrators to maintain a list of common reasons.

Implementation Steps:
  1. Create a new model named purchase.cancel.reasons with a user-friendly description and define the following fields:
    • Reason: Char and required field
  2. Create editable tree view for managing reasons
  3. Add menu item under Purchase Configuration
  4. Enable quick editing in list view

12. Define Access Rights for Cancel Reason

Your customer needs to implement access rights for the purchase.cancel.reasons model ,Purchase managers should have full permissions to create, edit, and delete cancel reasons

Implementation Steps:
  1. Create an ACL for the purchase.cancel.reasons model to grant full access to Purchase managers

13. Purchase Cancellation Wizard with Reason Tracking

The customer needs to capture the reason for canceling purchase orders to maintain proper documentation and audit trails.

Implementation Steps:
  1. Create a new wizard model named purchase.cancel.reason and define the following fields:
    • purchase_order_id: Relational field with purchase.order model Linked purchase order
    • Predefined Reason: Boolean field to toggle between predefined/custom reasons.
    • Custom Reason: Text field to allow user to enter his custom reason.
    • Reason: Relational field with purchase.cancel.reasons model Linked the model that you created in Task NO 11 this field should appear only when the Predefined Reason field checked
  2. Create a Form View for the purchase.cancel.reason wizard:
    • Use a structured layout with group
    • Create an Action (ir.actions.act_window): to call this wizard when user clicks on Cancel button in purchase order form.

14. Add Total Units Counter to Purchase Orders

The customer needs to see the total sum of all product quantities in a purchase order at a glance, displayed near the order totals.

Implementation Steps:
  1. In your extended purchase.order model to add Total Quantity field
    • This field should be designed to store integer values
    • Make it automatically calculated and stored in database
    • Add help text explaining what it shows
  2. Create the Calculation Method
    • Write a function called _compute_total_units
    • Make it run whenever line quantities change
    • This function should Add up all product quantities from order lines and Save the total to the total_units field
  3. Update the Purchase Order View:
    • Add the new total_units field right after tax information
    • Set it as read-only since it's auto-calculated

15. Restrict Vendor Information Access in Products

The customer needs to limit who can view and edit vendor information (prices, suppliers) in product forms to only authorized users. This ensures sensitive supplier data remains confidential while allowing other team members to work with basic product information.

Implementation Steps:
  1. Create Security Group
    • Make a new group called "Show Vendors in Product"
    • Assign to administrators by default
  2. Modify Product Views:
    • Locate the vendor information sections in product forms
    • Add group restriction to:
      • Main vendor list (seller_ids)
      • Variant-specific vendors (variant_seller_ids)

16. Display Product Images in Purchase Orders

The customer wants to see product images in purchase order lines to help visually identify items during procurement and receiving processes.

Implementation Steps:
  1. In your extended purchase.order.line:
    • Add image field image_128:
    • Auto-populate when product is selected (it is related to the selected product)
  2. Modify Purchase Order Form View:
    • Add image column after product name
    • Use avatar-style widget for compact display
    • AEnsure proper image sizing
  3. Update PDF Report:
    • Add image column to printed document
    • Maintain proper layout and formatting
    • Handle cases where no image exists

17. Employee Purchase Order Tracking

The customer needs to track and display purchase orders assigned to each employee to improve accountability and workload management in the procurement process

Implementation Steps:
  1. In your extended purchase.order add the following field:
    • Responsible User : It is relational field with res.users to represents the assigned user
    • Position this field in purchase order form near Order Date for visibility
  2. Extend hr.employee: model:
    • Purchase Order Count An integer field that calculates the total number of purchase orders responded to by this employee.
  3. Modify Employee Form View:
    • Include Purchase Order Count in both form and kanban views
    • Create smart button to view assigned purchase orders