Skip to content

Commit

Permalink
Merge ae33022 into 2d3461c
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobaeza committed Nov 5, 2019
2 parents 2d3461c + ae33022 commit 1249c0c
Show file tree
Hide file tree
Showing 23 changed files with 958 additions and 0 deletions.
1 change: 1 addition & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
queue
115 changes: 115 additions & 0 deletions sale_order_invoicing_queued/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
=============================
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/13.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-13-0/account-invoicing-13-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/13.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, which is 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
=============

Jobs are enqueued in the channel ``root.sale_order_invoicing_queued``,
so you must adjust your Odoo configuration according this.

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 use
``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:%2013.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/13.0/sale_order_invoicing_queued>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions sale_order_invoicing_queued/__init__.py
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
18 changes: 18 additions & 0 deletions sale_order_invoicing_queued/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Enqueue sales order invoicing",
"version": "13.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,
}
61 changes: 61 additions & 0 deletions sale_order_invoicing_queued/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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"
"Language: \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_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."

#~ msgid "Queue Job"
#~ msgstr "Trabajo en cola"
52 changes: 52 additions & 0 deletions sale_order_invoicing_queued/i18n/sale_order_invoicing_queued.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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"
"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_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 ""

3 changes: 3 additions & 0 deletions sale_order_invoicing_queued/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import sale_order
31 changes: 31 additions & 0 deletions sale_order_invoicing_queued/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models

try: # The try can be removed in v12 as not needed
from odoo.addons.queue_job.job import job
except ImportError:
import logging
import functools

logging.getLogger(__name__).debug("Can't `import queue_job`.")

def job(*argv, **kwargs):
return functools.partial


class SaleOrder(models.Model):
_inherit = "sale.order"

invoicing_job_ids = fields.Many2many(
comodel_name="queue.job",
column1="order_id",
column2="job_id",
string="Invoicing Jobs",
copy=False,
)

@job(default_channel="root.sale_order_invoicing_queued")
def create_invoices_job(self, final):
self._create_invoices(final=final)
5 changes: 5 additions & 0 deletions sale_order_invoicing_queued/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Jobs are enqueued in the channel ``root.sale_order_invoicing_queued``,
so you must adjust your Odoo configuration according this.

If you want to see queued jobs, you need "Job Queue / Job Queue Manager"
permission in your user.
3 changes: 3 additions & 0 deletions sale_order_invoicing_queued/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`__:

* Pedro M. Baeza
6 changes: 6 additions & 0 deletions sale_order_invoicing_queued/readme/DESCRIPTION.rst
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, which is normally done
serially and on foreground.

Jobs are split following the same criteria as standard Odoo: grouping by
order invoicing address and order currency.
2 changes: 2 additions & 0 deletions sale_order_invoicing_queued/readme/INSTALL.rst
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.
3 changes: 3 additions & 0 deletions sale_order_invoicing_queued/readme/ROADMAP.rst
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 use
``sale_order_action_invoice_create_hook``.
9 changes: 9 additions & 0 deletions sale_order_invoicing_queued/readme/USAGE.rst
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1249c0c

Please sign in to comment.