Skip to content

Commit

Permalink
Merge dd139f1 into a9c79fc
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Jan 22, 2020
2 parents a9c79fc + dd139f1 commit bc747dc
Show file tree
Hide file tree
Showing 16 changed files with 796 additions and 0 deletions.
98 changes: 98 additions & 0 deletions account_invoice_tier_validation/README.rst
@@ -0,0 +1,98 @@
=======================
Invoice Tier Validation
=======================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/LGPL-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/account_invoice_tier_validation
: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-account_invoice_tier_validation
: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 extends the functionality of Invoices to support a tier
validation process.

**Table of contents**

.. contents::
:local:

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

To configure this module, you need to:

#. Go to *Settings > Technical > Tier Validations > Tier Definition*.
#. Create as many tiers as you want for Invoice model.

Usage
=====

#. Create a Invoice triggering at least one "Tier Definition".
#. Click on *Request Validation* button.
#. Under the tab *Reviews* have a look to pending reviews and their statuses.
#. Once all reviews are validated click on *Confirm Order*.

Additional features:

* You can filter the Invoices requesting your review through the filter *Needs my
Review*.
* User with rights to confirm the PO (validate all tiers that would
be generated) can directly do the operation, this is, there is no need for
her/him to request a validation.

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:%20account_invoice_tier_validation%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
~~~~~~~

* ForgeFlow

Contributors
~~~~~~~~~~~~

* Aaron Henriquez <ahenriquez@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/account-invoicing <https://github.com/OCA/account-invoicing/tree/11.0/account_invoice_tier_validation>`_ 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 account_invoice_tier_validation/__init__.py
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions account_invoice_tier_validation/__manifest__.py
@@ -0,0 +1,18 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
{
"name": "Invoice Tier Validation",
"summary": "Extends the functionality of Invoice to "
"support a tier validation process.",
"version": "11.0.1.0.0",
"category": "Invoices",
"website": "https://github.com/OCA/account-invoicing",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": True,
"depends": ["account", "base_tier_validation",],
"data": [
"data/account_invoice_tier_definition.xml",
"views/account_invoice_view.xml",
],
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2020 ForgeFlow S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). -->
<odoo noupdate="1">
<record id="account_invoice_default_tier_definition" model="tier.definition">
<field name="model_id" ref="model_account_invoice"/>
<field name="definition_type">domain</field>
<field name="definition_domain"/>
<field name="review_type">group</field>
<field name="reviewer_group_id" ref='account.group_account_manager'/>
</record>
</odoo>
2 changes: 2 additions & 0 deletions account_invoice_tier_validation/models/__init__.py
@@ -0,0 +1,2 @@
from . import account_invoice
from . import tier_definition
17 changes: 17 additions & 0 deletions account_invoice_tier_validation/models/account_invoice.py
@@ -0,0 +1,17 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import api, models


class AccountInvoice(models.Model):
_name = "account.invoice"
_inherit = ["account.invoice", "tier.validation"]
_state_from = ["draft"]
_state_to = ["open", "paid"]

@api.model
def _get_under_validation_exceptions(self):
res = super(AccountInvoice, self)._get_under_validation_exceptions()
res.append("route_id")
return res
14 changes: 14 additions & 0 deletions account_invoice_tier_validation/models/tier_definition.py
@@ -0,0 +1,14 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from odoo import api, models


class TierDefinition(models.Model):
_inherit = "tier.definition"

@api.model
def _get_tier_validation_model_names(self):
res = super(TierDefinition, self)._get_tier_validation_model_names()
res.append("account.invoice")
return res
4 changes: 4 additions & 0 deletions account_invoice_tier_validation/readme/CONFIGURE.rst
@@ -0,0 +1,4 @@
To configure this module, you need to:

#. Go to *Settings > Technical > Tier Validations > Tier Definition*.
#. Create as many tiers as you want for Invoice model.
1 change: 1 addition & 0 deletions account_invoice_tier_validation/readme/CONTRIBUTORS.rst
@@ -0,0 +1 @@
* Aaron Henriquez <ahenriquez@ForgeFlow.com>
2 changes: 2 additions & 0 deletions account_invoice_tier_validation/readme/DESCRIPTION.rst
@@ -0,0 +1,2 @@
This module extends the functionality of Invoices to support a tier
validation process.
12 changes: 12 additions & 0 deletions account_invoice_tier_validation/readme/USAGE.rst
@@ -0,0 +1,12 @@
#. Create a Invoice triggering at least one "Tier Definition".
#. Click on *Request Validation* button.
#. Under the tab *Reviews* have a look to pending reviews and their statuses.
#. Once all reviews are validated click on *Confirm Order*.

Additional features:

* You can filter the Invoices requesting your review through the filter *Needs my
Review*.
* User with rights to confirm the PO (validate all tiers that would
be generated) can directly do the operation, this is, there is no need for
her/him to request a validation.
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 bc747dc

Please sign in to comment.