Metadata-Version: 2.1
Name: odoo-addon-sale_certification
Version: 17.0.1.0.0.2
Requires-Python: >=3.10
Requires-Dist: odoo>=17.0a,<17.1dev
Summary: This module allows to certificate sales orders in a construction context
Home-page: https://github.com/OCA/vertical-construction
License: AGPL-3
Author: Binhex,Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 17.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 4 - Beta
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

==================
Sale Certification
==================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:396fcf2b0cd4617a52b7d00fbb6e36d9d483640db9f10ca95b10ff3e301e44c2
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fvertical--construction-lightgray.png?logo=github
    :target: https://github.com/OCA/vertical-construction/tree/17.0/sale_certification
    :alt: OCA/vertical-construction
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/vertical-construction-17-0/vertical-construction-17-0-sale_certification
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/vertical-construction&target_branch=17.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module introduces a certification workflow between sales orders and
invoicing, commonly used in construction and large-scale contracting
industries.

Instead of invoicing directly from sales orders, this module allows the
creation of **certifications** that represent approved progress or
partial completion. These certifications can then generate invoices,
optionally applying **retention amounts** (withholding a percentage of
the payment until final project acceptance).

Key Features:

- Add a certification step between sales and invoicing.
- Generate invoices based on certified quantities.
- Support for configurable retention percentages per certification.
- Tracks invoiced vs. certified amounts for better financial oversight
  at sale level.

**Table of contents**

.. contents::
   :local:

Use Cases / Context
===================

In construction and large-scale contracting, the client pays against
certified progress, not against the whole sale order. This module lets a
sale order be certified in parts and invoiced from each certification,
withholding a retention until final acceptance.

Configuration
=============

Access to certifications follows the Sales access groups. Go to
*Settings > Users & Companies > Users* and, in the *Sales* field of each
user:

- **User: Own Documents Only**: the user sees the *Certifications* menu
  and can create, confirm, cancel and invoice the certifications of the
  sale orders whose salesperson is the user or that have no salesperson.
  The certifications of other salespeople are not visible. No invoicing
  access group is needed for that.
- **User: All Documents**: the same, over the certifications of every
  sale order, whoever its salesperson is.
- **Administrator**: the user can also delete certifications.

Users without any Sales access group do not see the *Certifications*
menu. Users with the *Billing* access group, or with the read-only
accounting group (*Show Accounting Features - Readonly*), and no Sales
access group can read the certifications and their lines, whoever the
salesperson of the order is, and open them from the **Certifications**
button of an invoice. They cannot create, change or delete them.

Usage
=====

1.  **Create a Sales Order** as usual with your products or services.

2.  Enable the **Certifiable?** checkbox on the Sales Order.

3.  Confirm the Sales Order.

4.  Once confirmed:

    - A **Certified Percentage** will be displayed at the Sales Order
      level.
    - A **Quantity Certified** field will appear at the line level.

5.  Based on the invoice policy of your products, the same logic will
    apply to the certification process. A new **Certification** button
    will appear in the header.

6.  Certifiable orders are not invoiced with the standard **Create
    Invoice** button of the Sales Order, neither as a regular invoice
    nor as a down payment (percentage or fixed amount). The error
    "Certifiable orders are invoiced from their certifications" lists
    the orders. When a regular invoice is requested for a selection of
    orders, the certifiable ones are skipped and the others are
    invoiced.

7.  Creating a new Certification offers three options:

    - **Regular** – Automatically includes all available lines based on
      the invoice policy.
    - **Percentage** – Applies a percentage to the amounts from the
      regular option (not the total sale).
    - **Chapter** – Allows selection of specific sections (sale order
      lines within sections) to include in the certification.

    The **Create certifications** action of the Sales Orders list only
    accepts orders with **Certifiable?** enabled. If the selection
    includes others, an error lists them by name and no certification is
    created.

    |Create certifications wizard|

8.  After creating a certification, you can freely adjust quantities or
    remove lines. These changes will be reflected in the Sales Order,
    following the same logic as invoices.

9.  When you confirm the certification, the confirmation date will be
    set.

10. Click **Create Invoice**. If you select **Apply Retention Monies**,
    you will have two retention options:

    - **Percentage** of the certified base amount.
    - **Fixed Value** over the certified base amount.

    |Create Invoices wizard with retention|

    This will:

    - Create a negative line in the invoice subtracting the retention
      amount.
    - Generate a separate invoice to hold the retention amount (if no
      draft retention invoice already exists), accessible from the Sales
      Order view.

11. You can set a payment method or reminders on the retention invoice
    to charge the client later or cancel the invoice if necessary.

12. When you cancel or delete an invoice created from a certification
    with retention, or reverse it with a credit note, its line is
    removed from the retention invoice, and the retention invoice is
    cancelled if it is left without lines.

    - If the retention invoice is posted, the cancellation, deletion or
      credit note is refused until you reset the retention invoice to
      draft.
    - The retention line of an invoice created from a certification
      cannot be removed on its own. To invoice a certification without
      retention, cancel the invoice and create it again without **Apply
      Retention Monies**.
    - **Reverse and Create Invoice** is refused on invoices with
      retention. Use **Reverse** and invoice the certification again.

13. A credit note of an invoice created from a certification keeps the
    link with the certification lines, so its quantities are subtracted
    from the **Invoiced Quantity**. After a full credit note the
    certification is back to **To Invoice** and you can click **Create
    Invoice** again.

.. |Create certifications wizard| image:: https://raw.githubusercontent.com/OCA/vertical-construction/17.0/sale_certification/static/description/usage_create_certifications.png
.. |Create Invoices wizard with retention| image:: https://raw.githubusercontent.com/OCA/vertical-construction/17.0/sale_certification/static/description/usage_create_invoices_retention.png

Known issues / Roadmap
======================

- Grouped certifications: each certification belongs to a single sales
  order and is invoiced on its own. A certification covering several
  orders, or one consolidated invoice for several certifications, is not
  supported yet.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/vertical-construction/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/vertical-construction/issues/new?body=module:%20sale_certification%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Binhex

Contributors
------------

- Christian Ramos <c.ramos@binhex.cloud>
- Edilio Escalona Almira <e.escalona@binhex.cloud>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-edescalona| image:: https://github.com/edescalona.png?size=40px
    :target: https://github.com/edescalona
    :alt: edescalona

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-edescalona| 

This module is part of the `OCA/vertical-construction <https://github.com/OCA/vertical-construction/tree/17.0/sale_certification>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
