Skip to content
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
54 changes: 54 additions & 0 deletions clog_l10n_br_fiscal_custom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
================================
CLOG - Brazilian Fiscal - Custom
================================

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

.. |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-Escodoo%2Fclog--addons-lightgray.png?logo=github
:target: https://github.com/Escodoo/clog-addons/tree/14.0/clog_l10n_br_fiscal_custom
:alt: Escodoo/clog-addons

|badge1| |badge2| |badge3|


**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/Escodoo/clog-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/Escodoo/clog-addons/issues/new?body=module:%20clog_l10n_br_fiscal_custom%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
~~~~~~~

* Escodoo

Maintainers
~~~~~~~~~~~

This module is part of the `Escodoo/clog-addons <https://github.com/Escodoo/clog-addons/tree/14.0/clog_l10n_br_fiscal_custom>`_ project on GitHub.

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

{
"name": "CLOG - Brazilian Fiscal - Custom",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Escodoo",
"website": "https://github.com/Escodoo/clog-addons",
"depends": ["l10n_br_fiscal"],
}
1 change: 1 addition & 0 deletions clog_l10n_br_fiscal_custom/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import document_line_mixin_methods
23 changes: 23 additions & 0 deletions clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2025 - TODAY, Kaynnan Lemes <kaynnan.lemes@escodoo.com.br>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class FiscalDocumentLineMixinMethods(models.AbstractModel):
_inherit = "l10n_br_fiscal.document.line.mixin.methods"

def _get_fiscal_partner(self):
"""
Returns the fiscal partner by searching all many2one fields for a related document
with partner_shipping_id or partner_id.
"""
self.ensure_one()

Check warning on line 15 in clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py

View check run for this annotation

Codecov / codecov/patch

clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py#L15

Added line #L15 was not covered by tests
for field in self._fields.values():
if field.type == "many2one":
doc = getattr(self, field.name, False)

Check warning on line 18 in clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py

View check run for this annotation

Codecov / codecov/patch

clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py#L18

Added line #L18 was not covered by tests
if doc:
partner = getattr(doc, "partner_shipping_id", False)

Check warning on line 20 in clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py

View check run for this annotation

Codecov / codecov/patch

clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py#L20

Added line #L20 was not covered by tests
if partner:
return partner
return super()._get_fiscal_partner()

Check warning on line 23 in clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py

View check run for this annotation

Codecov / codecov/patch

clog_l10n_br_fiscal_custom/models/document_line_mixin_methods.py#L22-L23

Added lines #L22 - L23 were not covered by tests
Empty file.
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.
Loading