Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
ee81a1f
[10.0][ADD] sale_invoice_policy
rousseldenis May 4, 2018
1097143
[IMP] Add search method, secures _get_to_invoice_qty,compute_invoice_…
rousseldenis May 4, 2018
972cbeb
[IMP] sale_invoice_policy: Implement inverse
rousseldenis May 4, 2018
e17ba15
[IMP] sale_invoice_policy: Let the availability of choosing no policy…
rousseldenis May 7, 2018
d749128
[IMP] sale_invoice_policy: Add config for default_policy and if polic…
rousseldenis May 7, 2018
7bfb0af
[FIX] Fix perf issue during compute invoice status (of sale.order.line)
acsonefho Nov 6, 2018
b785934
[UPD] Update sale_invoice_policy.pot
oca-travis Oct 1, 2019
f893e31
[ADD] icon.png
OCA-git-bot Oct 2, 2019
983ff63
[MIG]sale_invoice_policy to v12
AaronHForgeFlow Dec 31, 2019
e3ae565
[UPD] Update sale_invoice_policy.pot
oca-travis Jan 8, 2020
0f829c7
Update translation files
oca-transbot Jan 17, 2020
d52bc78
Added translation using Weblate (Catalan)
georginaf Feb 26, 2020
1656110
Translated using Weblate (Catalan)
georginaf Feb 26, 2020
d88d414
Update translation files
oca-transbot Aug 16, 2020
81647ac
Added translation using Weblate (Portuguese)
pedrocs-exo Sep 3, 2020
217cf3e
Translated using Weblate (Portuguese)
pedrocs-exo Sep 3, 2020
776a83d
[FIX] pep8 and pylint
renatonlima Sep 4, 2020
beaea0e
Translated using Weblate (French)
SandieFavre Sep 9, 2020
b7cc52a
Translated using Weblate (French)
quentinDupont Oct 20, 2020
71f79d7
[IMP] sale_invoice_policy: black, isort, prettier
alexeirivera87 Mar 28, 2021
4923f3d
[MIG] sale_invoice_policy: Migration to 13.0
alexeirivera87 Mar 28, 2021
e5d0426
[UPD] Update sale_invoice_policy.pot
oca-travis May 5, 2021
daa70fe
[UPD] README.rst
OCA-git-bot May 5, 2021
8ffb616
sale_invoice_policy 13.0.1.0.1
OCA-git-bot May 5, 2021
5468500
Added translation using Weblate (Spanish (Mexico))
alan196 Jun 1, 2021
10e1ebc
Translated using Weblate (Spanish (Mexico))
alan196 Jun 1, 2021
b38f0cd
[IMP] sale_invoice_policy: black, isort, prettier
yankinmax May 17, 2022
d19f2d0
[FIX] sale_invoice_policy: linter issues
yankinmax May 17, 2022
23a81cd
[15.0][MIG] sale_invoice_policy: Migration to 15.0
yankinmax May 17, 2022
13e6b33
[UPD] Update sale_invoice_policy.pot
Jun 5, 2022
7c165a6
[IMP] sale_invoice_policy: Don't repeat selection values
pedrobaeza Mar 8, 2023
0e3c3c8
sale_invoice_policy 15.0.1.0.1
OCA-git-bot Mar 8, 2023
503477e
[MIG] sale_invoice_policy: Migration to 16.0
ljsalvatierra-factorlibre Mar 13, 2023
28a741c
[UPD] Update sale_invoice_policy.pot
Apr 28, 2023
1ddf4fa
[UPD] README.rst
OCA-git-bot Apr 28, 2023
7e54400
[FIX] sale_invoice_policy: Wrong inheritance field with precompute at…
sergio-teruel Jun 2, 2023
b1a215b
[UPD] README.rst
OCA-git-bot Sep 3, 2023
5e315b2
Update translation files
weblate Oct 9, 2023
3b246e4
[UPD] sale_invoice_policy: Don't install it anymore
rousseldenis Nov 7, 2023
8379417
Added translation using Weblate (Italian)
mymage Dec 7, 2023
c8e9a09
Translated using Weblate (Italian)
mymage Dec 13, 2023
82e73d6
[16.0][FIX] sale_invoice_policy: compute qty to invoice
ACheung-FactorLibre Nov 7, 2023
bc85f93
[UPD] Update sale_invoice_policy.pot
May 2, 2024
b116c81
[BOT] post-merge updates
OCA-git-bot May 2, 2024
8019ff2
Update translation files
weblate May 2, 2024
38ba67a
[FIX] sale_invoice_policy: Don't use the 'required' parameter
rousseldenis Oct 24, 2024
241387c
[IMP] sale_invoice_policy: Don't reuse fields in depends
rousseldenis Oct 24, 2024
d794e28
[IMP] sale_invoice_policy: Don't rely on required option to compute t…
rousseldenis Oct 24, 2024
48504b4
[IMP] sale_invoice_policy: Don't rewrite Odoo core compute method
rousseldenis Oct 24, 2024
2d040a1
[IMP] sale_invoice_policy: save products invoice policy values in a s…
rousseldenis Oct 24, 2024
b58f551
[IMP] sale_invoice_policy: Add the default behavior as sale invoice p…
rousseldenis Oct 24, 2024
21b41a6
[IMP] sale_invoice_policy: Use protecting() instead of deprecated nor…
rousseldenis Oct 25, 2024
a578b59
[IMP] sale_invoice_policy: Improve README
rousseldenis Oct 25, 2024
807b2c0
[IMP] sale_invoice_policy: pre-commit auto fixes
marielejeune Nov 18, 2024
8bcfdb5
[MIG] sale_invoice_policy: Migration to 18.0
marielejeune Nov 18, 2024
195457f
[UPD] Update sale_invoice_policy.pot
Jun 2, 2025
fc74511
[BOT] post-merge updates
OCA-git-bot Jun 2, 2025
dcadc42
[IMP] sale_invoice_policy: automatic invoice
jbaudoux Jun 6, 2025
afedef7
[FIX] sale_invoice_policy: external dependency
jbaudoux Jun 6, 2025
2e5b7d3
[BOT] post-merge updates
OCA-git-bot Jun 30, 2025
fe645ea
[MIG] sale_invoice_policy: Migration to 19.0
therbin200 Dec 12, 2025
e05a008
[DON'T MERGE] test-requirements.txt
therbin200 Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
openupgradelib
138 changes: 138 additions & 0 deletions sale_invoice_policy/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================
Sale invoice Policy
===================

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

.. |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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/19.0/sale_invoice_policy
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_invoice_policy
: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/sale-workflow&target_branch=19.0
:alt: Try me on Runboat

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

This module adds an invoicing policy on sale order level in order to
apply that invoicing policy on the whole sale order.

That invoicing policy can take three values:

- Products Invoicing Policy: The sale order will follow the standard
behavior and apply the policy depending on products configurations.
- Ordered Quantities: The sale order will invoice the ordered
quantities.
- Delivered Quantities: The sale order will invoice the delivered
quantities.

Following the chosen policy, the quantity to invoice and the amount to
invoice on each line will be computed accordingly.

You will be able also to define a default invoicing policy (globally per
company) that can be different than the default invoicing policy for new
products.

**Table of contents**

.. contents::
:local:

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

In Odoo, products have their own invoicing policy that can be:

- Invoicing on ordered quantities
- Invoicing on ordered quantities

Following that configuration, when trying to create invoices from sale
orders, each line of product will apply its invoicing policy.

In some cases, user needs to apply an invoicing policy on a whole sale
order.

The solution proposed here is to add an invoicing policy on sale order
level.

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

- Go to Sale > Configuration > Settings > Sale Invoice Policy
- Choose the one that fits your needs.

Usage
=====

- Create Sale Order
- Select Invoicing Policy on Sale Order or let it on Products Invoicing
Policy
- The created invoices will use the configuration on sale order.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_invoice_policy%0Aversion:%2019.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
-------

* ACSONE SA/NV

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

- Cédric Pigeon <cedric.pigeon@acsone.eu>
- François Honoré <francois.honore@acsone.eu>
- Denis Roussel <denis.roussel@acsone.eu>
- Alexei Rivera <arivera@archeti.com>
- Luis J. Salvatierra <luis.salvatierra@factorlibre.com>
- Alejandro Ji Cheung <alejandro.jicheung@factorlibre.com>
- Ioan Galan <ioan@studio73.es>
- Laurent Mignon <laurent.mignon@acsone.eu>
- Marie Lejeune <marie.lejeune@acsone.eu>
- Jacques-Etienne Baudoux (BCIM) <<je.bcim.be>>
- Thomas Herbin <the@apik.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.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/19.0/sale_invoice_policy>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_invoice_policy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .hooks import pre_init_hook
from . import models
20 changes: 20 additions & 0 deletions sale_invoice_policy/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sale invoice Policy",
"summary": """
Sales Management: let the user choose the invoice policy on the
order""",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"category": "Sales Management",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"depends": ["base", "sale_stock", "base_partition"],
"external_dependencies": {"python": ["openupgradelib"]},
"data": [
"views/res_config_settings_view.xml",
"views/sale_view.xml",
],
"pre_init_hook": "pre_init_hook",
}
22 changes: 22 additions & 0 deletions sale_invoice_policy/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 ACSONE SA/NV (<https://acsone.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def pre_init_hook(env):
"""
Create the sale order invoice policy with the "product" policy (standard)
but with a postgres query to avoid an update on all sale order records
"""
field_spec = [
(
"invoice_policy",
"sale.order",
False,
"selection",
False,
"sale_invoice_policy",
"product",
)
]
openupgrade.add_fields(env, field_spec=field_spec)
109 changes: 109 additions & 0 deletions sale_invoice_policy/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_invoice_policy
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-02-26 18:13+0000\n"
"Last-Translator: georginaf <georgina.fornes@qubiq.es>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.10\n"

#. module: sale_invoice_policy
#: model:ir.model,name:sale_invoice_policy.model_res_config_settings
msgid "Config Settings"
msgstr "Configuració"

#. module: sale_invoice_policy
#: model:ir.model.fields.selection,name:sale_invoice_policy.selection__sale_order__invoice_policy__delivery
msgid "Delivered quantities"
msgstr "Quantitats entregades"

#. module: sale_invoice_policy
#: model:ir.model.fields,field_description:sale_invoice_policy.field_sale_order__invoice_policy
msgid "Invoice Policy"
msgstr "Política de Facturació"

#. module: sale_invoice_policy
#: model:ir.model.fields,field_description:sale_invoice_policy.field_sale_order__invoice_policy_required
msgid "Invoice Policy Required"
msgstr "Política de Facturació"

#. module: sale_invoice_policy
#: model_terms:ir.ui.view,arch_db:sale_invoice_policy.view_sales_config
msgid "Invoice Policy required in Sale Orders"
msgstr "Política de Facturació"

#. module: sale_invoice_policy
#: model:ir.model.fields,help:sale_invoice_policy.field_sale_order__invoice_policy
msgid ""
"Ordered Quantity: Invoice based on the quantity the customer ordered.\n"
"Delivered Quantity: Invoiced based on the quantity the vendor delivered "
"(time or deliveries)."
msgstr ""
"Quantitat demanada: Factura basada en la quantitat demanada pel client.\n"
"Quantitat entregada: Factura basada en funció de la quantitat entregada pel "
"proveïdor ( temps o entregues)."

#. module: sale_invoice_policy
#: model:ir.model.fields.selection,name:sale_invoice_policy.selection__sale_order__invoice_policy__order
msgid "Ordered quantities"
msgstr "Quantitats Demanades"

#. module: sale_invoice_policy
#: model_terms:ir.ui.view,arch_db:sale_invoice_policy.view_sales_config
msgid "Sale Invoice Policy"
msgstr ""

#. module: sale_invoice_policy
#: model:ir.model.fields,field_description:sale_invoice_policy.field_res_config_settings__sale_invoice_policy_required
msgid "Sale Invoice Policy Required"
msgstr "Política de Facturació"

#. module: sale_invoice_policy
#: model:ir.model,name:sale_invoice_policy.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_invoice_policy
#: model:ir.model,name:sale_invoice_policy.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línia de comanda de venda"

#. module: sale_invoice_policy
#: model:ir.model.fields,help:sale_invoice_policy.field_res_config_settings__sale_invoice_policy_required
msgid "This makes Invoice Policy required on Sale Orders"
msgstr "La política de facturació és necessària a les comandes de venda"

#~ msgid "Default Invoicing Policy"
#~ msgstr "Política de Facturació"

#~ msgid "Default Sale Invoice Policy"
#~ msgstr "Política de Facturació"

#~ msgid "Default Sale Order Invoice Policy"
#~ msgstr "Política de Facturació"

#~ msgid "Invoicing Policy"
#~ msgstr "Política de Facturació"

#~ msgid ""
#~ "Ordered Quantity: Invoice quantities ordered by the customer.\n"
#~ "Delivered Quantity: Invoice quantities delivered to the customer."
#~ msgstr ""
#~ "Quantitat demanada: Factura basada en la quantitat demanada pel client.\n"
#~ "Quantitat entregada: Facturada en funció de la quantitat entregada pel "
#~ "proveïdor ( temps o entregues)."

#~ msgid "Product Template"
#~ msgstr "Plantilla del Producte"

#~ msgid "Sale Order"
#~ msgstr "Comanda de Venda"
Loading
Loading