-
-
Notifications
You must be signed in to change notification settings - Fork 815
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
24 changed files
with
1,088 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
======================= | ||
Purchase Force Invoiced | ||
======================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:6efc88a50363d26fb21cbe44d58275b68d434d3d4373c0e57ed77d9f4cf4de85 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/licence-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%2Fpurchase--workflow-lightgray.png?logo=github | ||
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced | ||
:alt: OCA/purchase-workflow | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_force_invoiced | ||
: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/purchase-workflow&target_branch=18.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module adds the possibility for users to force the invoice status | ||
of the purchase orders to 'Fully Billed', even when not all the | ||
quantities, ordered or delivered, have been invoiced. | ||
|
||
This feature is useful in the following scenario: | ||
|
||
- The supplier disputes the quantities to be billed for, after the | ||
products have been delivered to her/him, and you agree to reduce the | ||
quantity to invoice (without expecting a refund). | ||
- When migrating from a previous Odoo version, in some cases there is | ||
less quantity billed to what was delivered, and you don't want these | ||
old purchase orders to appear in your 'Waiting Bills' list. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
1. Create a purchase order and confirm it. | ||
2. Receive the products/services. | ||
3. Create a vendor bill and reduce the invoiced quantity. The purchase | ||
order invoicing status is 'Waiting Bills'. | ||
4. Lock the Purchase Order and change its status to 'Done'. | ||
5. Check the field 'Force Invoiced'. | ||
|
||
The field is only visible for users that have the technical setting 'Set | ||
purchase orders to Force Invoiced'. By default, all purchase managers | ||
have this setting. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-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/purchase-workflow/issues/new?body=module:%20purchase_force_invoiced%0Aversion:%2018.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 | ||
------- | ||
|
||
* Forgeflow | ||
|
||
Contributors | ||
------------ | ||
|
||
- Jordi Ballester <[email protected]> | ||
- Rattapong Chokmasermkul <[email protected]> | ||
- Bert Van Groenendael <[email protected]> | ||
- Stefan Rijnhart <[email protected]> | ||
|
||
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/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_force_invoiced>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
||
from . import model | ||
from . import reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2019 ForgeFlow S.L. | ||
# Copyright 2019 Aleph Objects, Inc. | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
||
{ | ||
"name": "Purchase Force Invoiced", | ||
"summary": "Allows to force the billing status of the purchase order to " | ||
'"Invoiced"', | ||
"version": "18.0.1.0.0", | ||
"author": "Forgeflow, Odoo Community Association (OCA)", | ||
"category": "Purchase Management", | ||
"license": "AGPL-3", | ||
"website": "https://github.com/OCA/purchase-workflow", | ||
"depends": ["purchase"], | ||
"data": [ | ||
"security/res_groups_data.xml", | ||
"view/purchase_order.xml", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_force_invoiced | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-04-17 17:34+0000\n" | ||
"Last-Translator: gelo joga Rodríguez <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: es\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 4.14.1\n" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "Force Invoiced" | ||
msgstr "Forzar estado a Facturado" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "Pedido de Compra" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_report | ||
msgid "Purchase Report" | ||
msgstr "Informe de compras" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "" | ||
"When you set this field, the purchase order will be considered as fully " | ||
"billed, even when there may be ordered or delivered quantities pending to " | ||
"bill. To use this field, the order must be in 'Locked' state" | ||
msgstr "" | ||
"Cuando se marca este campo, el pedido de compra se considera como totalmente " | ||
"facturado, aunque haya cantidades pedidas o entregadas pendientes de " | ||
"facturar. Para usar este campo, el pedido debe estar en estado \"Bloqueado\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_force_invoiced | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-11-02 12:36+0000\n" | ||
"Last-Translator: Alexis de Lattre <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: fr\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 4.17\n" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "Force Invoiced" | ||
msgstr "Forcer le statut à 'Entièrement facturé'" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "Commande fournisseur" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_report | ||
msgid "Purchase Report" | ||
msgstr "Rapport d'achat" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "" | ||
"When you set this field, the purchase order will be considered as fully " | ||
"billed, even when there may be ordered or delivered quantities pending to " | ||
"bill. To use this field, the order must be in 'Locked' state" | ||
msgstr "" | ||
"Lorsque cette option est activée, le statut de la commande fournisseur " | ||
"basculera à 'Entièrement facturé' même s'il reste des quantités commandées " | ||
"ou livrées à facturer. Pour utiliser cette option, la commande doit être à " | ||
"l'état \"Verrouillé\"." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_force_invoiced | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-02-04 23:46+0000\n" | ||
"Last-Translator: mymage <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: it\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 4.17\n" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "Force Invoiced" | ||
msgstr "Forza a fatturato" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "Ordine di acquisto" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_report | ||
msgid "Purchase Report" | ||
msgstr "Resoconto di acquisto" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "" | ||
"When you set this field, the purchase order will be considered as fully " | ||
"billed, even when there may be ordered or delivered quantities pending to " | ||
"bill. To use this field, the order must be in 'Locked' state" | ||
msgstr "" | ||
"Quando si imposta questo campo, l'ordine di acquisto verrà considerato come " | ||
"completamente pagato, anche se ci sono quantità ordinate o consegnate in " | ||
"attesa di pagamento. Per usare questo campo, l'ordine deve essere in stato " | ||
"'Bloccato'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_force_invoiced | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "Force Invoiced" | ||
msgstr "" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_report | ||
msgid "Purchase Report" | ||
msgstr "" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "" | ||
"When you set this field, the purchase order will be considered as fully " | ||
"billed, even when there may be ordered or delivered quantities pending to " | ||
"bill. To use this field, the order must be in 'Locked' state" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * purchase_force_invoiced | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2019-09-02 14:40+0000\n" | ||
"Last-Translator: 黎伟杰 <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: zh_CN\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=1; plural=0;\n" | ||
"X-Generator: Weblate 3.8\n" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,field_description:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "Force Invoiced" | ||
msgstr "" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_order | ||
msgid "Purchase Order" | ||
msgstr "采购订单" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model,name:purchase_force_invoiced.model_purchase_report | ||
msgid "Purchase Report" | ||
msgstr "" | ||
|
||
#. module: purchase_force_invoiced | ||
#: model:ir.model.fields,help:purchase_force_invoiced.field_purchase_order__force_invoiced | ||
msgid "" | ||
"When you set this field, the purchase order will be considered as fully " | ||
"billed, even when there may be ordered or delivered quantities pending to " | ||
"bill. To use this field, the order must be in 'Locked' state" | ||
msgstr "" | ||
|
||
#~ msgid "Force invoiced" | ||
#~ msgstr "强制开具发票" | ||
|
||
#~ msgid "" | ||
#~ "When you set this field, the purchase order will be considered as fully " | ||
#~ "billed, even when there may be ordered or delivered quantities pending to " | ||
#~ "bill." | ||
#~ msgstr "" | ||
#~ "设置此字段时,即使订单或已交付的数量待处理,也会将采购订单视为已完成开票。" | ||
|
||
#~ msgid "Invoice" | ||
#~ msgstr "发票" |
9 changes: 9 additions & 0 deletions
9
purchase_force_invoiced/migrations/16.0.1.0.0/post-migrate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from odoo import SUPERUSER_ID, api | ||
|
||
|
||
def migrate(cr, version): | ||
"""Allow all purchase managers to set orders to force invoiced""" | ||
env = api.Environment(cr, SUPERUSER_ID, {}) | ||
env.ref("purchase.group_purchase_manager").implied_ids += env.ref( | ||
"purchase_force_invoiced.group_force_invoiced" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
||
from . import purchase_order | ||
from . import purchase_order_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class PurchaseOrder(models.Model): | ||
_inherit = "purchase.order" | ||
|
||
force_invoiced = fields.Boolean( | ||
copy=False, | ||
tracking=True, | ||
help="When you set this field, the purchase order will be " | ||
"considered as fully billed, even when there may be ordered " | ||
"or delivered quantities pending to bill. To use this field, " | ||
"the order must be in 'Locked' state", | ||
) | ||
|
||
@api.depends("force_invoiced") | ||
def _get_invoiced(self): | ||
res = super()._get_invoiced() | ||
for order in self.filtered( | ||
lambda po: po.force_invoiced and po.invoice_status == "to invoice" | ||
): | ||
order.invoice_status = "invoiced" | ||
return res |
Oops, something went wrong.