purchase
This page combines editorial guidance with evidence extracted from the selected official branch. Always test the flow with your own permissions and configuration.
Purpose
The Purchase Module provides everything that is required to create and manage purchases made by the company. It adds the idea of a purchase to Tryton, and allows it to be tracked as it moves through various states from draft to done. It makes it easy to create supplier shipments for the purchase, and includes the ability to automatically create related supplier invoices.
The analysis found 11 Python files, 44 XML files, 42 views, 88 actions, 8 menus, and 1 reports.
Functional user guide
Who should use it
This module is relevant to people responsible for purchase processes, company configuration, and result review. Administrators should participate whenever dependencies, permissions, or sequences are introduced.
What you will be able to do
After configuration, you will be able to identify the records added by purchase, execute actions in the correct state, produce its reports, and understand the information shared with other modules.
Requirements and preparation
Before activation, verify company, currency, users, and groups. Install and configure required dependencies first. When real data exists, rehearse activation and upgrades on a restored copy.
Activate dependencies first, review company configuration, and rehearse the complete workflow before production use.
Required dependencies
account— must be installed and configured before testing this module.account_invoice— must be installed and configured before testing this module.account_invoice_stock— must be installed and configured before testing this module.account_product— must be installed and configured before testing this module.company— must be installed and configured before testing this module.currency— must be installed and configured before testing this module.ir— must be installed and configured before testing this module.party— must be installed and configured before testing this module.product— must be installed and configured before testing this module.res— must be installed and configured before testing this module.stock— must be installed and configured before testing this module.
Optional integrations
- —
Recommended initial configuration
- Activate the module and sign in again to load menus and permissions.
- Review new company configuration options and defaults.
- Assign groups to test users using least privilege.
- Create small, verifiable master data before bulk imports.
- Run one complete scenario from draft to final state and inspect related records.
Module objects and concepts
- account.invoice: groups 2 model(s), including
account.invoice,account.invoice.line. These records form the information users inspect or modify during the process. - party.erase: groups 1 model(s), including
party.erase. These records form the information users inspect or modify during the process. - party.party: groups 4 model(s), including
party.party,party.party.customer_code,party.party.supplier_currency,party.party.supplier_lead_time. These records form the information users inspect or modify during the process. - party.replace: groups 1 model(s), including
party.replace. These records form the information users inspect or modify during the process. - product.product: groups 1 model(s), including
product.product. These records form the information users inspect or modify during the process. - product.template: groups 1 model(s), including
product.template. These records form the information users inspect or modify during the process. - purchase.configuration: groups 3 model(s), including
purchase.configuration,purchase.configuration.purchase_method,purchase.configuration.sequence. These records form the information users inspect or modify during the process. - purchase.handle: groups 4 model(s), including
purchase.handle.invoice.exception,purchase.handle.invoice.exception.ask,purchase.handle.shipment.exception,purchase.handle.shipment.exception.ask. These records form the information users inspect or modify during the process. - purchase.line: groups 1 model(s), including
purchase.line. These records form the information users inspect or modify during the process. - purchase.line-account: groups 1 model(s), including
purchase.line-account.tax. These records form the information users inspect or modify during the process. - purchase.line-ignored-stock: groups 1 model(s), including
purchase.line-ignored-stock.move. These records form the information users inspect or modify during the process. - purchase.line-recreated-stock: groups 1 model(s), including
purchase.line-recreated-stock.move. These records form the information users inspect or modify during the process. - purchase.modify_header: groups 1 model(s), including
purchase.modify_header. These records form the information users inspect or modify during the process. - purchase.open_supplier: groups 1 model(s), including
purchase.open_supplier. These records form the information users inspect or modify during the process. - purchase.product_supplier: groups 2 model(s), including
purchase.product_supplier,purchase.product_supplier.price. These records form the information users inspect or modify during the process. - purchase.purchase: groups 1 model(s), including
purchase.purchase. These records form the information users inspect or modify during the process. - purchase.purchase-ignored-account: groups 1 model(s), including
purchase.purchase-ignored-account.invoice. These records form the information users inspect or modify during the process. - purchase.purchase-recreated-account: groups 1 model(s), including
purchase.purchase-recreated-account.invoice. These records form the information users inspect or modify during the process. - purchase.reporting: groups 7 model(s), including
purchase.reporting.context,purchase.reporting.main,purchase.reporting.main.time_series,purchase.reporting.product,purchase.reporting.product.time_series. These records form the information users inspect or modify during the process. - purchase.return_purchase: groups 2 model(s), including
purchase.return_purchase,purchase.return_purchase.start. These records form the information users inspect or modify during the process. - stock.location: groups 1 model(s), including
stock.location. These records form the information users inspect or modify during the process. - stock.move: groups 1 model(s), including
stock.move. These records form the information users inspect or modify during the process. - stock.shipment: groups 2 model(s), including
stock.shipment.in,stock.shipment.in.return. These records form the information users inspect or modify during the process.
Typical workflow
- Select the correct company and date before creating a document.
- Complete master data before lines or details.
- Use form buttons for state changes; saving is not the same as validating or posting.
- Review warnings, totals, related documents, and traceability.
- Generate the report and compare it with the record before delivery.
Actions, states, and wizards
cancel— action or transition that starts cancel. Check permissions, current state, and related records before running it.confirm— action or transition that starts confirm. Check permissions, current state, and related records before running it.draft— action or transition that starts draft. Check permissions, current state, and related records before running it.handle_invoice_exception— action or transition that starts handle invoice exception. Check permissions, current state, and related records before running it.handle_shipment_exception— action or transition that starts handle shipment exception. Check permissions, current state, and related records before running it.manual_invoice— action or transition that starts manual invoice. Check permissions, current state, and related records before running it.modify_header— action or transition that starts modify header. Check permissions, current state, and related records before running it.process— action or transition that starts process. Check permissions, current state, and related records before running it.quote— action or transition that starts quote. Check permissions, current state, and related records before running it.cancelled— action or transition that starts cancelled. Check permissions, current state, and related records before running it.confirmed— action or transition that starts confirmed. Check permissions, current state, and related records before running it.done— action or transition that starts done. Check permissions, current state, and related records before running it.processing— action or transition that starts processing. Check permissions, current state, and related records before running it.quotation— action or transition that starts quotation. Check permissions, current state, and related records before running it.received— action or transition that starts received. Check permissions, current state, and related records before running it.purchase.handle.invoice.exception— wizard that collects data and performs purchase › handle › invoice › exception. Check permissions, current state, and related records before running it.purchase.handle.shipment.exception.ask— wizard that collects data and performs purchase › handle › shipment › exception › ask. Check permissions, current state, and related records before running it.purchase.modify_header— wizard that collects data and performs purchase › modify header. Check permissions, current state, and related records before running it.purchase.open_supplier— wizard that collects data and performs purchase › open supplier. Check permissions, current state, and related records before running it.purchase.return_purchase.start— wizard that collects data and performs purchase › return purchase › start. Check permissions, current state, and related records before running it.
Controls before production
- Define who creates, reviews, confirms, cancels, and reads.
- Test closed periods, unauthorized users, and incomplete data.
- Verify numbering, currency, rounding, and time zone where applicable.
- Document error correction without direct database edits.
- Include its tables and files in backup and restore procedures.
Troubleshooting
- If a menu is missing, verify activation, module-list update, groups, and a new login session.
- If a field rejects a value, inspect its domain, company, state, and configured dependencies.
- If a button is hidden or disabled, check permissions and valid transitions; never change state with SQL.
- If results differ, reproduce a minimal case and compare related records before and after.
- Keep the full traceback, version, active modules, and minimal data needed to diagnose an error.
Developer guide
Architecture and extension points
The package contains 50 Python classes and declares or extends 41 models. It uses Boolean, Char, Date, Float, Function, Integer, Many2Many, Many2One, MultiValue, Numeric, One2Many, Reference, Selection, Text, TimeDelta. Developers should first determine whether a class creates a model or uses PoolMeta to extend one, preserve super() calls, and avoid duplicating dependency rules.
Registered or extended models
account.invoiceaccount.invoice.lineparty.eraseparty.partyparty.party.customer_codeparty.party.supplier_currencyparty.party.supplier_lead_timeparty.replaceproduct.productproduct.templatepurchase.configurationpurchase.configuration.purchase_methodpurchase.configuration.sequencepurchase.handle.invoice.exceptionpurchase.handle.invoice.exception.askpurchase.handle.shipment.exceptionpurchase.handle.shipment.exception.askpurchase.linepurchase.line-account.taxpurchase.line-ignored-stock.movepurchase.line-recreated-stock.movepurchase.modify_headerpurchase.open_supplierpurchase.product_supplierpurchase.product_supplier.pricepurchase.purchasepurchase.purchase-ignored-account.invoicepurchase.purchase-recreated-account.invoicepurchase.reporting.contextpurchase.reporting.mainpurchase.reporting.main.time_seriespurchase.reporting.productpurchase.reporting.product.time_seriespurchase.reporting.supplierpurchase.reporting.supplier.time_seriespurchase.return_purchasepurchase.return_purchase.startstock.locationstock.movestock.shipment.instock.shipment.in.return
Field types used
BooleanCharDateFloatFunctionIntegerMany2ManyMany2OneMultiValueNumericOne2ManyReferenceSelectionTextTimeDelta
Detected classes and public methods
Classes: Abstract, AbstractTimeseries, Configuration, ConfigurationPurchaseMethod, ConfigurationSequence, Context, CustomerCode, HandleInvoiceException, HandleInvoiceExceptionAsk, HandleShipmentException, HandleShipmentExceptionAsk, Invoice, InvoiceLine, Line, LineIgnoredMove, LineRecreatedMove, LineTax, Location, Main, MainTimeseries, ModifyHeader, ModifyHeaderStateView, Move, OpenSupplier, Party, PartyErase, PartyLocationError, PartyReplace, PartySupplierCurrency, Product, ProductMixin, ProductSupplier, ProductSupplierPrice, ProductTimeseries, Purchase, PurchaseIgnoredInvoice, PurchaseMoveQuantity, PurchaseQuotationError, PurchaseRecreatedInvoice, PurchaseReport, PurchaseUOMWarning, ReturnPurchase, ReturnPurchaseStart, ShipmentIn, ShipmentInReturn, Supplier, SupplierLeadTime, SupplierMixin, SupplierTimeseries, Template
Methods: cancel(), check_erase_company(), check_for_quotation(), check_move_quantity(), check_origin_types(), compute_purchase_date(), compute_supply_date(), compute_taxes(), compute_unit_price(), confirm(), copy(), create(), create_invoice(), create_move(), create_return_shipment(), default_ask(), default_company(), default_currency(), default_delivery_date_edit(), default_from_date(), default_invoice_method(), default_invoice_state(), default_period(), default_purchase_invoice_method(), default_purchase_sequence(), default_quantity(), default_shipment_state(), default_state(), default_to_date(), default_type(), default_warehouse(), delete(), delivery_full_address(), do(), do_open_(), do_return_(), done(), draft(), execute(), fields_to_replace(), full_number(), func(), get_amount(), get_context(), get_defaults(), get_from_location(), get_invoice_line(), get_invoice_state(), get_invoices(), get_last_purchase_price_uom(), get_move(), get_move_product_types(), get_moves(), get_moves_exception(), get_moves_progress(), get_origin(), get_pattern(), get_purchase(), get_purchase_exception_state(), get_purchase_price(), get_purchase_price_uom(), get_purchase_states(), get_purchases(), get_rec_name(), get_resources_to_copy(), get_shipment_state(), get_supplier(), get_tax_amount(), get_time_series(), get_to_location(), get_trend(), get_view(), get_warehouse(), handle_invoice_exception(), handle_shipment_exception(), is_done(), lead_time_used(), manual_invoice(), match(), method(), modify_header(), multivalue_model(), on_change_company(), on_change_default_uom(), on_change_delivery_date_edit(), on_change_invoice_party(), on_change_lines(), on_change_party(), on_change_product(), on_change_product_supplier(), on_change_purchase(), on_change_quantity(), on_change_taxes(), on_change_type(), on_change_unit(), on_change_with_amount(), on_change_with_company(), on_change_with_currency(), on_change_with_delivery_date(), on_change_with_party_lang()
Code map
Detected 11 Python files, 44 XML files, and 0 explicit access files. XML connects models to views, menus, actions, and reports; access CSV files establish initial permissions.
__init__.pyconfiguration.pyconfiguration.xmldoc/conf.pyexceptions.pyinvoice.pyinvoice.xmlmessage.xmlparty.pyparty.xmlproduct.pyproduct.xmlpurchase.pypurchase.xmlpurchase_reporting.pypurchase_reporting.xmlsetup.pystock.pystock.xmlview/configuration_form.xmlview/handle_invoice_exception_ask_form.xmlview/handle_shipment_exception_ask_form.xmlview/location_form.xmlview/modify_header_form.xmlview/move_list_shipment.xmlview/move_list_shipment_in.xmlview/party_form.xmlview/product_list_purchase_line.xmlview/product_supplier_form.xmlview/product_supplier_price_form.xmlview/product_supplier_price_list_sequence.xmlview/product_supplier_price_tree.xmlview/product_supplier_tree.xmlview/product_supplier_tree_sequence.xmlview/purchase_form.xmlview/purchase_line_form.xmlview/purchase_line_tree.xmlview/purchase_line_tree_sequence.xmlview/purchase_reporting_context_form.xmlview/purchase_reporting_main_graph_expense.xmlview/purchase_reporting_main_graph_number.xmlview/purchase_reporting_main_list.xmlview/purchase_reporting_main_time_series_graph_expense.xmlview/purchase_reporting_main_time_series_graph_number.xmlview/purchase_reporting_main_time_series_list.xmlview/purchase_reporting_product_graph_expense.xmlview/purchase_reporting_product_graph_number.xmlview/purchase_reporting_product_list.xmlview/purchase_reporting_supplier_graph_expense.xmlview/purchase_reporting_supplier_graph_number.xml
Test plan
- Activation on an empty database and upgrade from the previous revision.
- Create, update, copy, and delete according to state and access rights.
- Every button, transition, and wizard with valid and invalid scenarios.
- Applicable multi-company rules, translations, time zones, and currencies.
- Combined installation with required and optional dependencies.
- Backup and restore of records, attachments, and generated reports.
Compatibility and upgrades
Keep server and modules on series 7.0. Before upgrading, compare tryton.cfg, __register__ migrations, state changes, XML IDs, and permissions. A successful build does not replace a rehearsed migration or functional data reconciliation.
Official documentation evidence
Topics found: Design · Purchase · Reports · Purchase Report · Wizards · Handle Shipment Exception · Handle Invoice Exception · Modify Header · Return Purchase · Product Supplier · Purchase Reporting · By Supplier · By Product · Configuration · Purchase Module · Usage · Listing Suppliers · Making products purchasable · Setting bulk prices · Creating a purchase order · Changing a purchase order · Receiving a shipment · Getting invoiced · Handling shipment and invoice exceptions · Finishing a purchase · Cancelling purchases · Returning purchases
-
- doc/design.rst: The Purchase Module introduces some new concepts and updates existing concepts to make them work seamlessly with purchases.
-
- doc/index.rst: The Purchase Module provides everything that is required to create and manage purchases made by the company. It adds the idea of a purchase to Tryton, and allows it to be tracked as it moves through various states from draft to done. It makes it easy to create supplier shipments for the purchase, and includes the ability to automatically create related supplier invoices.
-
- doc/usage/index.rst: Settings, information and tasks relating to purchases can be found under the [
Purchase] main menu item.
- doc/usage/index.rst: Settings, information and tasks relating to purchases can be found under the [
-
- doc/usage/prepurchase.rst: In Tryton, by definition, the
Parties <party:model-party.party>that yourCompany <company:model-company.company>has bought from are its suppliers. The Purchase Module lets you list these when you open the [Parties --> Parties --> Associated to Purchases] main menu item.
- doc/usage/prepurchase.rst: In Tryton, by definition, the
-
- doc/usage/process.rst: Creating a new purchase order is simply a matter of creating a new
Purchase <model-purchase.purchase>and adding the lines that are required. Most of the fields are optional or have sensible default values.
- doc/usage/process.rst: Creating a new purchase order is simply a matter of creating a new
-
- doc/usage/returns.rst: You can easily cancel
Purchases <model-purchase.purchase>that are not yet confirmed using theCancelbutton.
- doc/usage/returns.rst: You can easily cancel