Skip to Content
Catalog / SAL · Sales / Sale Order Cost Tracking
Sale Order Cost Tracking
sale_costs_alshayeb

Sale Order Cost Tracking

Capture vendor costs on every sales order and bill them in a click to protect margin

v19.0.1.0.0 AlshayebCo Sales

Adds model sales order cost line (One2many on sales order via cost_line_ids) holding vendor, service product, qty, price, computed amount, qty_billed/qty_to_bill and a billing_status selection. sales order is extended with computed cost_total, margin_amount, margin_percent and cost_bill smart-button helpers; journal entry gains sale_order_id and journal item gains sale_cost_line_id for back-references. Bills are built via _create_vendor_bill using Command.create, validating single vendor/order. A SQL-view model sale cost report (_auto=False) powers the graph/pivot/list Cost Analysis. Integrity via models.Constraint CHECK clauses; multi-company ir.rule on cost lines. Depends on sale_management and account.

Overview

Sales teams often commit external vendor costs against a deal but have no lightweight way to record them without raising full Purchase Orders. This module adds a Costs tab to the Sales Order where each vendor cost line is captured, then turns those lines directly into vendor bills (one per line or grouped by vendor). It computes total cost, margin amount and margin percentage in real time on every order, and ships a Cost Analysis report so managers can see profitability by salesperson, team, customer and period without the overhead of stock moves or purchase orders.

Workflow

Sale Order Cost Line

Nothing to Bill
Partially Billed
Fully Billed

Key Features

  • Adds a Costs tab to the Sales Order to record vendor cost lines with vendor, service product, quantity, unit price and date.
  • Generates vendor bills straight from cost lines, either one bill per line or a single bill grouped per vendor for all unbilled costs.
  • Tracks billing progress per cost line with a Nothing/Partially/Fully Billed status badge and billed-versus-remaining quantities.
  • Computes total costs, margin amount and margin percentage live on each order and shows them in optional Sales Order list columns.
  • Provides smart buttons that jump between a Sales Order and its source vendor bills, and from a bill back to its originating order.
  • Maintains full traceability by linking each bill line back to the cost line and each vendor bill to its source Sales Order.
  • Delivers a Cost Analysis report (graph, pivot and list) for margin profitability by salesperson, team, customer, status and period.
  • Adds search filters for orders that have costs, high margin, low margin and negative margin to flag at-risk deals.
  • Enforces data integrity with checks for positive quantity, non-negative price and billed quantity never exceeding ordered quantity.
  • Ships a default Vendor Cost service product and is multi-company aware via a record rule on cost lines.

Technical Details

Technical Name sale_costs_alshayeb
Version 19.0.1.0.0
License LGPL-3
Domain SAL · Sales

Menu Structure

Costs (Sales > Reporting)

Security

Salespeople can read, create and edit cost lines; Sales Managers and Invoicing/Accountants additionally can delete them. Both Salespeople and Sales Managers can view the Cost Analysis report (read-only). A multi-company record rule limits cost lines to the user's allowed companies.

Salesperson (sales_team.group_sale_salesman) - read/write/create cost lines, read Cost Analysis Sales Manager (sales_team.group_sale_manager) - full CRUD on cost lines, read Cost Analysis Invoicing/Accountant (account.group_account_invoice) - full CRUD on cost lines

Dependencies

sale_management account