Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
125 changes: 125 additions & 0 deletions stock_picking_batch_account/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
===========================
Stock batch picking account
===========================

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

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

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

This module adds support for the automatic creation of invoices when a
batch is set to the **Done** state and allows printing the invoices of
the sales orders linked to the batch pickings.

**Table of contents**

.. contents::
:local:

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

To configure this module, you need to check 'Batch picking auto invoice'
field of the partners for whom you want the invoice to be automatically
generated when any batch that has a 'Picking' to which they belong is
set to 'done' state.

1. Go to each of those partner, edit them, find 'Batch picking auto
invoice' field under 'Sales & Purchase' tab and check it.

Usage
=====

To use this module, you need to:

1. Go to *Inventory > Operations > Batch Transfers*.
2. Create a new batch and add some pickings such that their partners
have the option 'Batch picking auto invoice' checked (See
configuration section). Make sure the selected pickings are linked to
a sales order.
3. Confirm the batch.
4. Set the batch to 'done' state. After that, invoices will be generated
for all sales orders linked to the pickings of the batch.
5. Click on 'Print Invoices' button in the status bar and you will see a
PDF report for all the generated invoices.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-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/stock-logistics-workflow/issues/new?body=module:%20stock_picking_batch_account%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
-------

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__:

- Ernesto Tejeda
- Pedro M. Baeza
- Carlos Dauden
- Sergio Teruel

- `Moduon Team <https://www.moduon.team>`__:

- Eduardo de Miguel

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-ernestotejeda| image:: https://github.com/ernestotejeda.png?size=40px
:target: https://github.com/ernestotejeda
:alt: ernestotejeda
.. |maintainer-Andrii9090| image:: https://github.com/Andrii9090.png?size=40px
:target: https://github.com/Andrii9090
:alt: Andrii9090

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

|maintainer-ernestotejeda| |maintainer-Andrii9090|

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_picking_batch_account>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions stock_picking_batch_account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
18 changes: 18 additions & 0 deletions stock_picking_batch_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# Copyright 2023 Moduon Team - Eduardo de Miguel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock batch picking account",
"summary": "Generates invoices when batch is set to Done state",
"version": "18.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda", "Andrii9090"],
"development_status": "Beta",
"category": "Warehouse Management",
"depends": ["stock_picking_batch", "sale"],
"website": "https://github.com/OCA/stock-logistics-workflow",
"data": ["views/stock_batch_picking.xml", "views/res_partner_views.xml"],
"installable": True,
"license": "AGPL-3",
}
60 changes: 60 additions & 0 deletions stock_picking_batch_account/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_batch_extended_account
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-31 17:27+0000\n"
"PO-Revision-Date: 2022-07-31 19:28+0200\n"
"Last-Translator: Sergio Teruel <sergio.teruel@tecnativa.com>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 2.3\n"

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields,field_description:stock_picking_batch_extended_account.field_res_partner__batch_picking_auto_invoice
#: model:ir.model.fields,field_description:stock_picking_batch_extended_account.field_res_users__batch_picking_auto_invoice
msgid "Batch Picking Auto Invoice"
msgstr "Facturación automática en agrupación de albaranes"

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_stock_picking_batch
msgid "Batch Transfer"
msgstr "Agrupación de albaranes"

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_res_partner
msgid "Contact"
msgstr "Contacto"

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields.selection,name:stock_picking_batch_extended_account.selection__res_partner__batch_picking_auto_invoice__no
msgid "No"
msgstr "No"

#. module: stock_picking_batch_extended_account
#: code:addons/stock_picking_batch_extended_account/models/stock_batch_picking.py:0
#, python-format
msgid "Nothing to print."
msgstr "Nada para imprimir."

#. module: stock_picking_batch_extended_account
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended_account.stock_picking_batch_form
msgid "Print Invoices"
msgstr "Imprimir facturas"

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_stock_picking
msgid "Transfer"
msgstr "Albarán"

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields.selection,name:stock_picking_batch_extended_account.selection__res_partner__batch_picking_auto_invoice__yes
msgid "Yes"
msgstr "Si"
60 changes: 60 additions & 0 deletions stock_picking_batch_account/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_batch_extended_account
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-02 10:35+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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: stock_picking_batch_extended_account
#: model:ir.model.fields,field_description:stock_picking_batch_extended_account.field_res_partner__batch_picking_auto_invoice
#: model:ir.model.fields,field_description:stock_picking_batch_extended_account.field_res_users__batch_picking_auto_invoice
msgid "Batch Picking Auto Invoice"
msgstr "Auto fattura prelievo ragruppato"

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_stock_picking_batch
msgid "Batch Transfer"
msgstr "Trasferimento raggruppato"

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_res_partner
msgid "Contact"
msgstr "Contatto"

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields.selection,name:stock_picking_batch_extended_account.selection__res_partner__batch_picking_auto_invoice__no
msgid "No"
msgstr "No"

#. module: stock_picking_batch_extended_account
#. odoo-python
#: code:addons/stock_picking_batch_extended_account/models/stock_batch_picking.py:0
#, python-format
msgid "Nothing to print."
msgstr "Niente da stampare."

#. module: stock_picking_batch_extended_account
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended_account.stock_picking_batch_form
msgid "Print Invoices"
msgstr "Stampa fatture"

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_stock_picking
msgid "Transfer"
msgstr "Trasferimento"

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields.selection,name:stock_picking_batch_extended_account.selection__res_partner__batch_picking_auto_invoice__yes
msgid "Yes"
msgstr "Sì"
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_batch_extended_account
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: stock_picking_batch_extended_account
#: model:ir.model.fields,field_description:stock_picking_batch_extended_account.field_res_partner__batch_picking_auto_invoice
#: model:ir.model.fields,field_description:stock_picking_batch_extended_account.field_res_users__batch_picking_auto_invoice
msgid "Batch Picking Auto Invoice"
msgstr ""

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_stock_picking_batch
msgid "Batch Transfer"
msgstr ""

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_res_partner
msgid "Contact"
msgstr ""

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields.selection,name:stock_picking_batch_extended_account.selection__res_partner__batch_picking_auto_invoice__no
msgid "No"
msgstr ""

#. module: stock_picking_batch_extended_account
#. odoo-python
#: code:addons/stock_picking_batch_extended_account/models/stock_batch_picking.py:0
#, python-format
msgid "Nothing to print."
msgstr ""

#. module: stock_picking_batch_extended_account
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended_account.stock_picking_batch_form
msgid "Print Invoices"
msgstr ""

#. module: stock_picking_batch_extended_account
#: model:ir.model,name:stock_picking_batch_extended_account.model_stock_picking
msgid "Transfer"
msgstr ""

#. module: stock_picking_batch_extended_account
#: model:ir.model.fields.selection,name:stock_picking_batch_extended_account.selection__res_partner__batch_picking_auto_invoice__yes
msgid "Yes"
msgstr ""
5 changes: 5 additions & 0 deletions stock_picking_batch_account/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import res_partner
from . import stock_batch_picking
from . import stock_picking
17 changes: 17 additions & 0 deletions stock_picking_batch_account/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

batch_picking_auto_invoice = fields.Selection(
[("yes", "Yes"), ("no", "No")], default="no", company_dependent=True
)

@api.model
def _commercial_fields(self):
res = super()._commercial_fields()
return res + ["batch_picking_auto_invoice"]
28 changes: 28 additions & 0 deletions stock_picking_batch_account/models/stock_batch_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.exceptions import UserError


class StockBatchPicking(models.Model):
_inherit = "stock.picking.batch"

def action_print_invoices(self):
invoices = self.mapped("picking_ids.sale_id.invoice_ids")
if not invoices:
raise UserError(self.env._("Nothing to print."))
report = self.env.ref("account.account_invoices_without_payment")
return report.report_action(invoices)

def _get_domain_picking_to_invoice(self):
return [("partner_id.batch_picking_auto_invoice", "=", "yes")]

def _get_self_with_context_to_invoice(self):
to_invoice = self.mapped("picking_ids").filtered_domain(
self._get_domain_picking_to_invoice()
)
return self.with_context(picking_to_invoice_in_batch=to_invoice.ids)

def action_done(self):
self_with_ctx = self._get_self_with_context_to_invoice()
return super(StockBatchPicking, self_with_ctx).action_done()
Loading
Loading