Skip to Content
Catalog / PUR · Purchase / Purchase Create Bills Enhancement
Purchase Create Bills Enhancement
purchase_create_bills_enhancement

Purchase Create Bills Enhancement

Set the exact exchange rate when turning foreign-currency purchase orders into vendor bills

v19.0.1.0.0 Abdelfatah Mohammad (AlshayebCo) Purchase Application

Inherits purchase order to override action_create_invoice: single-company-currency orders defer to super, while foreign or mixed-currency selections open the purchase order create bill wizard (TransientModel) seeded with per-currency purchase currency rate rows. The wizard's create_bill builds invoice values via new _prepare_invoice_enhancement (purchase order) and _prepare_account_move_line_enhance (purchase order line) helpers, applying the user-set rates, then groups by (company, partner, currency) and creates journal entry records. Depends on invoice_bill_show_currency_rate for the ac_currency_rate field used in onchange rate computation.

Overview

When a purchase order is in a foreign currency, Odoo's standard 'Create Bill' action silently applies the system exchange rate of the day, which rarely matches the rate the vendor actually invoiced. This module intercepts bill creation for foreign or mixed-currency purchase orders and opens a wizard where the buyer chooses the bill currency, the invoice date, and the precise currency rate to apply per currency. The resulting vendor bills are then generated and grouped using the rate the user confirmed, keeping payables aligned with the real amounts owed.

Key Features

  • Detects foreign-currency and mixed-currency purchase orders and routes them through a dedicated bill-creation wizard instead of the default flow.
  • Lets the user pick the bill currency and the invoice date before any vendor bill is created.
  • Captures a precise invoice currency rate, pre-filled from the purchase order's own rate, and applies it to every bill line.
  • Provides an editable per-currency rate table so each currency in the selection gets its own confirmed conversion rate.
  • Recomputes rates automatically when the chosen bill currency changes, averaging across orders that share a currency.
  • Generates vendor bills from invoiceable lines only, carrying over quantities, discounts, taxes and analytic distribution at the chosen rate.
  • Groups the created bills by company, vendor and currency, consolidating origins and references into a single bill where possible.
  • Falls back to Odoo's standard bill creation for same-company-currency orders so normal purchasing is untouched.

Technical Details

Technical Name purchase_create_bills_enhancement
Version 19.0.1.0.0
License LGPL-3
Domain PUR · Purchase

Security

Both helper models (the create-bill wizard and the temporary currency-rate records) grant full read/write/create/delete access to all users with no group restriction; the wizard is reached through the standard purchase order Create Bill button, so it follows the user's existing access to purchase orders.

Dependencies