Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/boleto usability #10

Merged
merged 3 commits into from
May 24, 2024
Merged
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
76 changes: 76 additions & 0 deletions l10n_br_boleto_usability/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
========================
L10n BR Boleto Usability
========================

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

.. |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-KMEE%2Fkmee--odoo--addons-lightgray.png?logo=github
:target: https://github.com/KMEE/kmee-odoo-addons/tree/14.0/l10n_br_boleto_usability
:alt: KMEE/kmee-odoo-addons

|badge1| |badge2| |badge3|

This module improve usability of boleto.

**Table of contents**

.. contents::
:local:

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

This module does not require any special configuration.

Usage
=====

To use this module, you need to:

::

1. This module raises an error when user try to print a boleto of invoice with fiscal documents that are not autorized.

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

Bugs are tracked on `GitHub Issues <https://github.com/KMEE/kmee-odoo-addons/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/KMEE/kmee-odoo-addons/issues/new?body=module:%20l10n_br_boleto_usability%0Aversion:%2014.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
-------

* KMEE

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

- ``KMEE <https://www.kmee.com.br>``\ \_\_:

- Luis Felipe Mileo [email protected]

Maintainers
-----------

This module is part of the `KMEE/kmee-odoo-addons <https://github.com/KMEE/kmee-odoo-addons/tree/14.0/l10n_br_boleto_usability>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions l10n_br_boleto_usability/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions l10n_br_boleto_usability/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "L10n BR Boleto Usability",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "KMEE,Odoo Community Association (OCA)",
"website": "https://github.com/KMEE/kmee-odoo-addons",
"depends": [
"l10n_br_account",
"l10n_br_account_payment_order",
],
}
1 change: 1 addition & 0 deletions l10n_br_boleto_usability/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move
21 changes: 21 additions & 0 deletions l10n_br_boleto_usability/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, models
from odoo.exceptions import UserError

from odoo.addons.l10n_br_fiscal.constants.fiscal import SITUACAO_EDOC_AUTORIZADA


class AccountMove(models.Model):

_inherit = "account.move"

def view_boleto_pdf(self):
for record in self:
for edoc in record.fiscal_document_ids:
if edoc.state_edoc != SITUACAO_EDOC_AUTORIZADA:
raise UserError(
_("Emita o documento fiscal antes de imprimir o boleto.")
)
return super().view_boleto_pdf()
1 change: 1 addition & 0 deletions l10n_br_boleto_usability/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module does not require any special configuration.
3 changes: 3 additions & 0 deletions l10n_br_boleto_usability/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `KMEE <https://www.kmee.com.br>`__:

* Luis Felipe Mileo <[email protected]>
1 change: 1 addition & 0 deletions l10n_br_boleto_usability/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module improve usability of boleto.
4 changes: 4 additions & 0 deletions l10n_br_boleto_usability/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module, you need to:

1. This module raises an error when user try to print a boleto of invoice with fiscal documents that are not autorized.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading