Skip to content

Commit

Permalink
Merge pull request #10 from kmee/feature/boleto-usability
Browse files Browse the repository at this point in the history
Feature/boleto usability
  • Loading branch information
mileo authored May 24, 2024
2 parents 82e8e43 + 6dd3394 commit 232503f
Show file tree
Hide file tree
Showing 21 changed files with 574 additions and 16 deletions.
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

0 comments on commit 232503f

Please sign in to comment.