Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
983 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
purchase-workflow | ||
queue |
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,112 @@ | ||
============================= | ||
Enqueue sales order invoicing | ||
============================= | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Faccount--invoicing-lightgray.png?logo=github | ||
:target: https://github.com/OCA/account-invoicing/tree/11.0/sale_order_invoicing_queued | ||
:alt: OCA/account-invoicing | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/account-invoicing-11-0/account-invoicing-11-0-sale_order_invoicing_queued | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/95/11.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to enqueue in several jobs the sales orders invoicing | ||
process to be executed in paralell on background, that's it's normally done | ||
serially and on foreground. | ||
|
||
Jobs are split following the same criteria as standard Odoo: grouping by | ||
order invoicing address and order currency. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Installation | ||
============ | ||
|
||
This module depends on *queue_job* module that is hosted on | ||
https://github.com/OCA/queue. | ||
|
||
Configuration | ||
============= | ||
|
||
If you want to see queued jobs, you need "Job Queue / Job Queue Manager" | ||
permission in your user. | ||
|
||
Usage | ||
===== | ||
|
||
#. Go to *Sales > Invoicing > Orders to Invoice*. | ||
#. Select sales orders whose invoicing you want to enqueue. | ||
#. Click on *Action > Invoice Order*. | ||
#. Click on "Enqueue Invoicing" button. | ||
#. On that moment, jobs will be enqueued on foreground, but the control will | ||
be returned to you after that. | ||
#. Having the "Job Queue Manager" permissions, you can go to the sales order, | ||
and see the tab "Invoicing Jobs". There a list with all the jobs related | ||
to that sales order can be found. | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
* This module doesn't take into account any possible modification on grouping | ||
criteria, like all the modules that uses | ||
`sale_order_action_invoice_create_hook`. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20sale_order_invoicing_queued%0Aversion:%2011.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 | ||
~~~~~~~ | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
* Pedro M. Baeza | ||
|
||
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/account-invoicing <https://github.com/OCA/account-invoicing/tree/11.0/sale_order_invoicing_queued>`_ 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 (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models | ||
from . import wizards |
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,22 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
'name': 'Enqueue sales order invoicing', | ||
'version': '11.0.1.0.0', | ||
'category': 'Sales Management', | ||
'license': 'AGPL-3', | ||
'author': 'Tecnativa, ' | ||
'Odoo Community Association (OCA)', | ||
'website': 'https://github.com/OCA/account-invoicing', | ||
'depends': [ | ||
'sale', | ||
'queue_job', | ||
], | ||
'data': [ | ||
'views/queue_job_views.xml', | ||
'views/sale_order_views.xml', | ||
'wizards/sale_advance_payment_inv_views.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,58 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_invoicing_queued | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 11.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-08-29 16:09+0000\n" | ||
"PO-Revision-Date: 2019-08-29 16:09+0000\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: sale_order_invoicing_queued | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_queue_job_sale_order_invoicing | ||
msgid "Cancel" | ||
msgstr "Cancelar" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_sale_advance_payment_inv | ||
msgid "Enqueue Invoicing" | ||
msgstr "Encolar facturación" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model.fields,field_description:sale_order_invoicing_queued.field_sale_order_invoicing_job_ids | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_order_form | ||
msgid "Invoicing Jobs" | ||
msgstr "Trabajos de facturación" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model,name:sale_order_invoicing_queued.model_queue_job | ||
msgid "Queue Job" | ||
msgstr "Trabajo en cola" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model,name:sale_order_invoicing_queued.model_sale_order | ||
msgid "Quotation" | ||
msgstr "Presupuesto" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_queue_job_sale_order_invoicing | ||
msgid "Requeue" | ||
msgstr "Volver a poner en cola" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model,name:sale_order_invoicing_queued.model_sale_advance_payment_inv | ||
msgid "Sales Advance Payment Invoice" | ||
msgstr "Ventas. Anticipo pago factura" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: code:addons/sale_order_invoicing_queued/wizards/sale_advance_payment_inv.py:26 | ||
#, python-format | ||
msgid "There's already an enqueued job for invoicing the sales order %s. Please wait until it's finished or remove it from the selection." | ||
msgstr "Ya existe un trabajo encolado para facturar el pedido de venta %s. Por favor espera hasta que haya terminado o elimine el pedido de la selección." |
59 changes: 59 additions & 0 deletions
59
sale_order_invoicing_queued/i18n/sale_order_invoicing_queued.pot
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,59 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_order_invoicing_queued | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 11.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-08-29 16:17+0000\n" | ||
"PO-Revision-Date: 2019-08-29 16:17+0000\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: sale_order_invoicing_queued | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_queue_job_sale_order_invoicing | ||
msgid "Cancel" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_sale_advance_payment_inv | ||
msgid "Enqueue Invoicing" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model.fields,field_description:sale_order_invoicing_queued.field_sale_order_invoicing_job_ids | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_order_form | ||
msgid "Invoicing Jobs" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model,name:sale_order_invoicing_queued.model_queue_job | ||
msgid "Queue Job" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model,name:sale_order_invoicing_queued.model_sale_order | ||
msgid "Quotation" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.ui.view,arch_db:sale_order_invoicing_queued.view_queue_job_sale_order_invoicing | ||
msgid "Requeue" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: model:ir.model,name:sale_order_invoicing_queued.model_sale_advance_payment_inv | ||
msgid "Sales Advance Payment Invoice" | ||
msgstr "" | ||
|
||
#. module: sale_order_invoicing_queued | ||
#: code:addons/sale_order_invoicing_queued/wizards/sale_advance_payment_inv.py:26 | ||
#, python-format | ||
msgid "There's already an enqueued job for invoicing the sales order %s. Please wait until it's finished or remove it from the selection." | ||
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,4 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import queue_job | ||
from . import sale_order |
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,17 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import models | ||
|
||
|
||
class QueueJob(models.Model): | ||
_inherit = 'queue.job' | ||
|
||
def cancel_sudo(self): | ||
self.sudo().filtered( | ||
lambda x: x.state in ['pending', 'enqueued'] | ||
).unlink() | ||
|
||
def requeue_sudo(self): | ||
self.sudo().requeue() |
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,32 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
try: | ||
from odoo.addons.queue_job.job import job | ||
except ImportError: | ||
import logging | ||
import functools | ||
|
||
logging.getLogger().debug("Can't `import queue_job`.") | ||
|
||
def empty_decorator_factory(*argv, **kwargs): | ||
return functools.partial | ||
job = empty_decorator_factory | ||
|
||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
invoicing_job_ids = fields.Many2many( | ||
comodel_name='queue.job', | ||
column1='invoice_id', | ||
column2='job_id', | ||
string="Invoicing Jobs", | ||
copy=False, | ||
) | ||
|
||
@job(default_channel='root.sale_order_invoicing_queued') | ||
def create_invoices_job(self, final): | ||
self.action_invoice_create(final=final) |
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,2 @@ | ||
If you want to see queued jobs, you need "Job Queue / Job Queue Manager" | ||
permission in your user. |
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,3 @@ | ||
* `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
* Pedro M. Baeza |
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,6 @@ | ||
This module allows to enqueue in several jobs the sales orders invoicing | ||
process to be executed in paralell on background, that's it's normally done | ||
serially and on foreground. | ||
|
||
Jobs are split following the same criteria as standard Odoo: grouping by | ||
order invoicing address and order currency. |
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,2 @@ | ||
This module depends on *queue_job* module that is hosted on | ||
https://github.com/OCA/queue. |
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,3 @@ | ||
* This module doesn't take into account any possible modification on grouping | ||
criteria, like all the modules that uses | ||
`sale_order_action_invoice_create_hook`. |
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 @@ | ||
#. Go to *Sales > Invoicing > Orders to Invoice*. | ||
#. Select sales orders whose invoicing you want to enqueue. | ||
#. Click on *Action > Invoice Order*. | ||
#. Click on "Enqueue Invoicing" button. | ||
#. On that moment, jobs will be enqueued on foreground, but the control will | ||
be returned to you after that. | ||
#. Having the "Job Queue Manager" permissions, you can go to the sales order, | ||
and see the tab "Invoicing Jobs". There a list with all the jobs related | ||
to that sales order can be found. |
Oops, something went wrong.