Skip to content

Commit

Permalink
[REF] l10n_br_fiscal: create for simplified tax"
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniospneto committed Dec 14, 2023
1 parent bf72ad2 commit d2b285a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion l10n_br_fiscal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Módulo fiscal brasileiro
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2162ff50d1c1bc65f043951bd268244f0c24c785fd1e42747c04ab2253e86119
!! source digest: sha256:3cd7e7f009550ac27495c4d22aad9468ecf69edfbac98cedc0e16b48d8861219
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
12 changes: 7 additions & 5 deletions l10n_br_fiscal/models/simplified_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ class SimplifiedTax(models.Model):
readonly=True,
)

@api.model
def create(self, vals):
"""Override create for update effective tax lines in all companys"""
record = super().create(vals)
@api.model_create_multi
def create(self, vals_list):
"""
Override the create method to update the effective tax lines in all companies
"""
simplified_taxes = super().create(vals_list)
companies = self.env["res.company"].search(
[("tax_framework", "=", TAX_FRAMEWORK_SIMPLES)]
)
for company in companies:
company.update_effective_tax_lines()

Check warning on line 47 in l10n_br_fiscal/models/simplified_tax.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_fiscal/models/simplified_tax.py#L47

Added line #L47 was not covered by tests
return record
return simplified_taxes
3 changes: 2 additions & 1 deletion l10n_br_fiscal/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Módulo fiscal brasileiro</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2162ff50d1c1bc65f043951bd268244f0c24c785fd1e42747c04ab2253e86119
!! source digest: sha256:3cd7e7f009550ac27495c4d22aad9468ecf69edfbac98cedc0e16b48d8861219
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_fiscal"><img alt="OCA/l10n-brazil" src="https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_fiscal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<img alt="https://raw.githubusercontent.com/OCA/l10n-brazil/14.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" src="https://raw.githubusercontent.com/OCA/l10n-brazil/14.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" />
Expand Down

0 comments on commit d2b285a

Please sign in to comment.