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
90 changes: 90 additions & 0 deletions sale_fully_invoiced/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

====================
Sales Fully Invoiced
====================

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

.. |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_fully_invoiced
: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_fully_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/sale-workflow&target_branch=19.0
:alt: Try me on Runboat

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

The standard invoice_status field shows information about the status
invoices related to a sales Order. However, it may happen that
invoice_status is "invoiced" while the invoices are still in draft.

This module introduces a field, Fully Invoiced, that considers the
status of the invoices.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Filter the list of Sale Orders by Fully Invoice Validated

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_fully_invoiced%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
-------

* Forgeflow

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

- Aaron Henriquez <aaron.henriquez@forgeflow.com>

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_fully_invoiced>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_fully_invoiced/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions sale_fully_invoiced/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2022 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

{
"name": "Sales Fully Invoiced",
"summary": "Useful filters in Sales to know the actual status of invoices.",
"author": "Forgeflow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/sale-workflow",
"category": "Sales",
"version": "19.0.1.0.0",
"depends": ["sale"],
"data": ["views/sale_views.xml"],
"maintainters": ["AaronHForgeFlow"],
"installable": True,
}
61 changes: 61 additions & 0 deletions sale_fully_invoiced/i18n/sale_fully_invoiced.pot
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_fully_invoiced
#
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: sale_fully_invoiced
#: model:ir.model.fields.selection,name:sale_fully_invoiced.selection__sale_order__invoice_status_validated__to_invoice
msgid "Can be Invoiced"
msgstr ""

#. module: sale_fully_invoiced
#: model:ir.model.fields.selection,name:sale_fully_invoiced.selection__sale_order__invoice_status_validated__invoiced
msgid "Fully Invoiced"
msgstr ""

#. module: sale_fully_invoiced
#: model_terms:ir.ui.view,arch_db:sale_fully_invoiced.fully_invoice_delivered_filters_view_fully_invoice_validated_search
msgid "Fully Invoiced and Not Validated"
msgstr ""

#. module: sale_fully_invoiced
#: model_terms:ir.ui.view,arch_db:sale_fully_invoiced.fully_invoice_delivered_filters_view_fully_invoice_validated_search
msgid "Fully Invoiced and Validated"
msgstr ""

#. module: sale_fully_invoiced
#: model:ir.model.fields.selection,name:sale_fully_invoiced.selection__sale_order__invoice_status_validated__no
msgid "Nothing to Invoice"
msgstr ""

#. module: sale_fully_invoiced
#: model:ir.model.fields,field_description:sale_fully_invoiced.field_sale_order__invoice_status_validated
msgid "Posted Invoice Status"
msgstr ""

#. module: sale_fully_invoiced
#: model_terms:ir.ui.view,arch_db:sale_fully_invoiced.fully_invoice_delivered_filters_view_fully_invoice_validated_search
msgid "Sale orders that are Fully Invoiced and with all invoices validated"
msgstr ""

#. module: sale_fully_invoiced
#: model_terms:ir.ui.view,arch_db:sale_fully_invoiced.fully_invoice_delivered_filters_view_fully_invoice_validated_search
msgid ""
"Sale orders that are Fully Invoiced but with some of their invoices not "
"validated"
msgstr ""

#. module: sale_fully_invoiced
#: model:ir.model,name:sale_fully_invoiced.model_sale_order
msgid "Sales Order"
msgstr ""
1 change: 1 addition & 0 deletions sale_fully_invoiced/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale
35 changes: 35 additions & 0 deletions sale_fully_invoiced/models/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from odoo import api, fields, models


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

# Same as invoice_status, but excluding invoices in draft
invoice_status_validated = fields.Selection(
[
("no", "Nothing to Invoice"),
("to invoice", "Can be Invoiced"),
("invoiced", "Fully Invoiced"),
],
string="Posted Invoice Status",
compute="_compute_invoice_status_validated",
store=True,
readonly=True,
copy=False,
default="no",
)

@api.depends("invoice_status", "invoice_ids.state")
def _compute_invoice_status_validated(self):
# Same as invoice status, except it is not invoiced unless there is no invoice
# in draft
for order in self:
if order.invoice_status in ("no", "to invoice"):
order.invoice_status_validated = order.invoice_status
elif order.invoice_status == "upselling":
order.invoice_status_validated = "no"
else:
if not any(inv.state == "draft" for inv in order.invoice_ids):
order.invoice_status_validated = order.invoice_status
else:
order.invoice_status_validated = "to invoice"
3 changes: 3 additions & 0 deletions sale_fully_invoiced/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions sale_fully_invoiced/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Aaron Henriquez \<aaron.henriquez@forgeflow.com\>
6 changes: 6 additions & 0 deletions sale_fully_invoiced/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The standard invoice_status field shows information about the status
invoices related to a sales Order. However, it may happen that
invoice_status is "invoiced" while the invoices are still in draft.

This module introduces a field, Fully Invoiced, that considers the
status of the invoices.
1 change: 1 addition & 0 deletions sale_fully_invoiced/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1. Filter the list of Sale Orders by Fully Invoice Validated
Binary file added sale_fully_invoiced/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading