forked from OCA/l10n-brazil
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c080cff
commit d66eaf2
Showing
12 changed files
with
593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
============================= | ||
L10n Br Account Invoice Merge | ||
============================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:880cd68b6230bbebd892e4fc0f3515a258c339313e38263d46314d0b7c2af063 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2F-lightgray.png?logo=github | ||
:target: https://github.com/OCA//tree//l10n_br_account_invoice_merge | ||
:alt: OCA/ | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/-/--l10n_br_account_invoice_merge | ||
: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/&target_branch= | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA//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//issues/new?body=module:%20l10n_br_account_invoice_merge%0Aversion:%20%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 | ||
~~~~~~~ | ||
|
||
* Escodoo | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Escodoo <https://www.escodoo.com.br>`_: | ||
|
||
* Marcel Savegnago <[email protected]> | ||
|
||
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/ <https://github.com/OCA//tree//l10n_br_account_invoice_merge>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 - TODAY, Escodoo | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "L10n Br Account Invoice Merge", | ||
"summary": """ | ||
L10n BR Account Invoice Merge""", | ||
"version": "14.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Escodoo,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/l10n-brazil", | ||
"depends": [ | ||
"account_invoice_merge", | ||
"l10n_br_account", | ||
], | ||
"data": [], | ||
"demo": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import account_move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright 2023 - TODAY, Marcel Savegnago <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
|
||
_inherit = "account.move" | ||
|
||
@api.model | ||
def _get_invoice_key_cols_out(self): | ||
result = super()._get_invoice_key_cols_out() | ||
result.append("document_type_id") | ||
result.append("fiscal_operation_id") | ||
return result | ||
|
||
@api.model | ||
def _get_invoice_key_cols_in(self): | ||
result = super()._get_invoice_key_cols_in() | ||
result.append("document_type_id") | ||
result.append("fiscal_operation_id") | ||
return result | ||
|
||
@api.model | ||
def _get_invoice_line_key_cols(self): | ||
result = super()._get_invoice_line_key_cols() | ||
result.append("document_type_id") | ||
result.append("fiscal_operation_id") | ||
result.append("fiscal_operation_line_id") | ||
result.append("fiscal_operation_type") | ||
result.append("fiscal_product_id") | ||
result.append("fiscal_tax_ids") | ||
result.append("fiscal_genre_id") | ||
result.append("cfop_id") | ||
result.append("ncm_id") | ||
return result | ||
|
||
@api.model | ||
def _get_first_invoice_fields(self, invoice): | ||
result = super()._get_first_invoice_fields(invoice) | ||
result["document_type_id"] = (invoice.document_type_id.id,) | ||
result["fiscal_operation_id"] = (invoice.fiscal_operation_id.id,) | ||
return result | ||
|
||
def do_merge( | ||
self, keep_references=True, date_invoice=False, remove_empty_invoice_lines=True | ||
): | ||
result = super().do_merge( | ||
keep_references=keep_references, | ||
date_invoice=date_invoice, | ||
remove_empty_invoice_lines=remove_empty_invoice_lines, | ||
) | ||
|
||
domain = [("id", "in", list(result.keys()))] | ||
invoices = self.search(domain) | ||
|
||
for invoice in invoices: | ||
move = invoice.with_context({"check_move_validity": False}) | ||
move.line_ids.filtered("exclude_from_invoice_tab").unlink() | ||
move._move_autocomplete_invoice_lines_values() | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* `Escodoo <https://www.escodoo.com.br>`_: | ||
|
||
* Marcel Savegnago <[email protected]> |
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.