sale
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 Sale Module helps organise and manage sales made by the company. It adds the concept of a sale to Tryton and allows it to be tracked through its states from draft to done. It also oversees the creation of customer shipments and invoices for the sales, and allows reports to be generated that contain aggregated sales figures.
The analysis found 11 Python files, 44 XML files, 54 views, 128 actions, 7 menus, and 1 reports.
Functional user guide
Who should use it
This module is relevant to people responsible for sale 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 sale, 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.country— 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. - ir.cron: groups 1 model(s), including
ir.cron. 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 3 model(s), including
party.party,party.party.customer_currency,party.party.sale_method. 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.configuration: groups 2 model(s), including
product.configuration,product.configuration.default_lead_time. These records form the information users inspect or modify during the process. - product.lead_time: groups 1 model(s), including
product.lead_time. 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.sale: groups 1 model(s), including
product.sale.context. 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. - sale.configuration: groups 4 model(s), including
sale.configuration,sale.configuration.quotation,sale.configuration.sale_method,sale.configuration.sequence. These records form the information users inspect or modify during the process. - sale.handle: groups 4 model(s), including
sale.handle.invoice.exception,sale.handle.invoice.exception.ask,sale.handle.shipment.exception,sale.handle.shipment.exception.ask. These records form the information users inspect or modify during the process. - sale.line: groups 1 model(s), including
sale.line. These records form the information users inspect or modify during the process. - sale.line-account: groups 1 model(s), including
sale.line-account.tax. These records form the information users inspect or modify during the process. - sale.line-ignored-stock: groups 1 model(s), including
sale.line-ignored-stock.move. These records form the information users inspect or modify during the process. - sale.line-recreated-stock: groups 1 model(s), including
sale.line-recreated-stock.move. These records form the information users inspect or modify during the process. - sale.modify_header: groups 1 model(s), including
sale.modify_header. These records form the information users inspect or modify during the process. - sale.open_product: groups 1 model(s), including
sale.open_product. These records form the information users inspect or modify during the process. - sale.reporting: groups 21 model(s), including
sale.reporting.context,sale.reporting.country,sale.reporting.country.subdivision,sale.reporting.country.subdivision.time_series,sale.reporting.country.time_series. These records form the information users inspect or modify during the process. - sale.return_sale: groups 2 model(s), including
sale.return_sale,sale.return_sale.start. These records form the information users inspect or modify during the process. - sale.sale: groups 1 model(s), including
sale.sale. These records form the information users inspect or modify during the process. - sale.sale-ignored-account: groups 1 model(s), including
sale.sale-ignored-account.invoice. These records form the information users inspect or modify during the process. - sale.sale-recreated-account: groups 1 model(s), including
sale.sale-recreated-account.invoice. 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.
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.manual_shipment— action or transition that starts manual shipment. 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.shipped— action or transition that starts shipped. Check permissions, current state, and related records before running it.sale.handle.invoice.exception— wizard that collects data and performs sale › handle › invoice › exception. Check permissions, current state, and related records before running it.sale.handle.shipment.exception— wizard that collects data and performs sale › handle › shipment › exception. Check permissions, current state, and related records before running it.sale.modify_header— wizard that collects data and performs sale › modify header. Check permissions, current state, and related records before running it.sale.open_product— wizard that collects data and performs sale › open product. Check permissions, current state, and related records before running it.sale.reporting.country.tree.open— wizard that collects data and performs sale › reporting › country › tree › open. Check permissions, current state, and related records before running it.sale.reporting.region.tree.open— wizard that collects data and performs sale › reporting › region › tree › open. Check permissions, current state, and related records before running it.sale.return_sale.start— wizard that collects data and performs sale › return sale › 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 70 Python classes and declares or extends 57 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.lineir.cronparty.eraseparty.partyparty.party.customer_currencyparty.party.sale_methodparty.replaceproduct.configurationproduct.configuration.default_lead_timeproduct.lead_timeproduct.productproduct.sale.contextproduct.templatesale.configurationsale.configuration.quotationsale.configuration.sale_methodsale.configuration.sequencesale.handle.invoice.exceptionsale.handle.invoice.exception.asksale.handle.shipment.exceptionsale.handle.shipment.exception.asksale.linesale.line-account.taxsale.line-ignored-stock.movesale.line-recreated-stock.movesale.modify_headersale.open_productsale.reporting.contextsale.reporting.countrysale.reporting.country.subdivisionsale.reporting.country.subdivision.time_seriessale.reporting.country.time_seriessale.reporting.country.treesale.reporting.country.tree.opensale.reporting.customersale.reporting.customer.categorysale.reporting.customer.category.time_seriessale.reporting.customer.category.treesale.reporting.customer.time_seriessale.reporting.mainsale.reporting.main.time_seriessale.reporting.productsale.reporting.product.categorysale.reporting.product.category.time_seriessale.reporting.product.category.treesale.reporting.product.time_seriessale.reporting.region.treesale.reporting.region.tree.opensale.return_salesale.return_sale.startsale.salesale.sale-ignored-account.invoicesale.sale-recreated-account.invoicestock.movestock.shipment.outstock.shipment.out.return
Field types used
BooleanCharDateFloatFunctionIntegerMany2ManyMany2OneMultiValueNumericOne2ManyReferenceSelectionTextTimeDelta
Detected classes and public methods
Classes: Abstract, AbstractTimeseries, Configuration, ConfigurationQuotation, ConfigurationSaleMethod, ConfigurationSequence, Context, Country, CountryMixin, CountryTimeseries, CountryTree, Cron, Customer, CustomerCategory, CustomerCategoryMixin, CustomerCategoryTimeseries, CustomerCategoryTree, CustomerMixin, CustomerTimeseries, DefaultLeadTime, Erase, HandleInvoiceException, HandleInvoiceExceptionAsk, HandleShipmentException, HandleShipmentExceptionAsk, Invoice, Line, Main, MainTimeseries, ModifyHeader, ModifyHeaderStateView, Move, OpenCountryTree, OpenProduct, OpenRegionTree, Party, PartyCustomerCurrency, PartyLocationError, PartySaleMethod, Product, ProductCategory, ProductCategoryMixin, ProductCategoryTimeseries, ProductCategoryTree, ProductLeadTime, ProductMixin, ProductTimeseries, RegionTree, Replace, ReturnSale, ReturnSaleStart, Sale, SaleConfirmError, SaleContext, SaleIgnoredInvoice, SaleLine, SaleLineIgnoredMove, SaleLineRecreatedMove, SaleLineTax, SaleMoveQuantity, SaleQuotationError, SaleRecreatedInvoice, SaleReport, SaleValidationError, ShipmentOut, ShipmentOutReturn, Subdivision, SubdivisionMixin, SubdivisionTimeseries, Template
Methods: cancel(), cancel_expired_quotation(), chat_language(), check_erase_company(), check_for_quotation(), check_method(), check_modification(), check_move_quantity(), check_origin_types(), compute_shipping_date(), compute_taxes(), compute_unit_price(), confirm(), copy(), create_invoice(), create_shipment(), default(), default_ask(), default_company(), default_currency(), default_customer(), default_from_date(), default_invoice_method(), default_invoice_state(), default_locations(), default_payment_term(), default_period(), default_quantity(), default_quotation_validity(), default_sale_date(), default_sale_invoice_method(), default_sale_sequence(), default_sale_shipment_method(), default_shipment_method(), default_shipment_state(), default_state(), default_to_date(), default_type(), default_warehouse(), delivery_full_address(), do(), do_return_(), do_start(), domain_quotation_expire(), draft(), execute(), fields_to_replace(), full_number(), func(), get_amount(), get_context(), get_cost_price(), get_currency(), get_defaults(), get_from_location(), get_invoice_line(), get_invoice_progress(), get_invoice_state(), get_invoices(), get_move(), get_moves(), get_moves_exception(), get_moves_progress(), get_name(), get_origin(), get_rec_name(), get_resources_to_copy(), get_sale(), get_sale_exception_state(), get_sale_price(), get_sale_price_uom(), get_sale_states(), get_sales(), get_shipment_state(), get_tax_amount(), get_tax_identifier(), get_time_series(), get_to_location(), get_total(), get_trend(), get_view(), get_warehouse(), handle_invoice_exception(), handle_shipment_exception(), is_done(), lead_time_used(), manual_invoice(), manual_shipment(), method(), modify_header(), movable_types(), multivalue_model(), on_change_company(), on_change_default_uom(), on_change_invoice_party(), on_change_lines(), on_change_party(), on_change_product(), on_change_quantity(), on_change_sale()
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.xmlir.pymessage.xmlparty.pyparty.xmlproduct.pyproduct.xmlsale.pysale.xmlsale_reporting.pysale_reporting.xmlstock.pystock.xmlview/configuration_form.xmlview/handle_invoice_exception_ask_form.xmlview/handle_shipment_exception_ask_form.xmlview/modify_header_form.xmlview/move_list_shipment.xmlview/party_form.xmlview/product_configuration_form.xmlview/product_list_sale_line.xmlview/product_sale_context_form.xmlview/return_sale_start_form.xmlview/sale_form.xmlview/sale_line_form.xmlview/sale_line_tree.xmlview/sale_line_tree_sequence.xmlview/sale_reporting_context_form.xmlview/sale_reporting_country_tree.xmlview/sale_reporting_customer_category_list.xmlview/sale_reporting_customer_category_tree.xmlview/sale_reporting_customer_graph_number.xmlview/sale_reporting_customer_graph_revenue.xmlview/sale_reporting_customer_list.xmlview/sale_reporting_main_graph_number.xmlview/sale_reporting_main_graph_revenue.xmlview/sale_reporting_main_list.xmlview/sale_reporting_main_time_series_graph_number.xmlview/sale_reporting_main_time_series_graph_revenue.xmlview/sale_reporting_main_time_series_list.xmlview/sale_reporting_product_category_list.xmlview/sale_reporting_product_category_tree.xmlview/sale_reporting_product_graph_number.xmlview/sale_reporting_product_graph_revenue.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 8.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 · Sale · Reports · Sale Report · Wizards · Handle Shipment Exception · Handle Invoice Exception · Modify Header · Return Sale · Sale Context · Sale Reporting · By Customer · By Product · By Category · By Region · By Country · By Subdivision · Configuration · Sale Module · Usage · Making products salable · Finding sale prices and availability · Creating a sales order · Changing a sales order · Sending a quotation · Shipping a sale · Part shipments · Invoicing a sale · Handling shipment and invoice exceptions · Finishing a sale · Getting sales data · Cancelling sales · Handling customer returns
-
- doc/design.rst: The Sale Module introduces the concepts that are required to manage sales. It also extends existing concepts so sales become an fully integrated part of the system.
-
- doc/index.rst: The Sale Module helps organise and manage sales made by the company. It adds the concept of a sale to Tryton and allows it to be tracked through its states from draft to done. It also oversees the creation of customer shipments and invoices for the sales, and allows reports to be generated that contain aggregated sales figures.
-
- doc/usage/index.rst: Configuration, management, and reporting tasks relating to sales can be found under the [
Sales] main menu item.
- doc/usage/index.rst: Configuration, management, and reporting tasks relating to sales can be found under the [
-
- doc/usage/presales.inc.rst: Before you can add a
Product <product:concept-product>to aSale <model-sale.sale>it must be marked as salable. When you do this you will also be able to set some additional properties such as theUnit of Measure <product:model-product.uom>the product is normally sold in and how long it normally takes before the product can be delivered.
- doc/usage/presales.inc.rst: Before you can add a
-
- doc/usage/process.inc.rst: Creating a new sales order is simply a matter of creating a new
Sale <model-sale.sale>and adding the lines that are required. Most of the fields are optional or have sensible default values.
- doc/usage/process.inc.rst: Creating a new sales order is simply a matter of creating a new
-
- doc/usage/reporting.inc.rst: You can analyse aggregated sales data using the items found under the [
Sales --> Reporting] main menu item. TheseSales Reports <concept-sale.reporting>allow you to view sales grouped by a range of different factors.
- doc/usage/reporting.inc.rst: You can analyse aggregated sales data using the items found under the [
-
- doc/usage/returns.inc.rst: You can easily cancel
Sales <model-sale.sale>that are not yet confirmed using theCancelbutton.
- doc/usage/returns.inc.rst: You can easily cancel