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 Sep 9, 2024
1 parent cd3a82a commit d306f67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
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()
return record
return simplified_taxes
1 change: 1 addition & 0 deletions 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

0 comments on commit d306f67

Please sign in to comment.