Browse Source

[IMP] data noupade + round amounts

16.0
RemiFr82 2 months ago
parent
commit
e1245cb1e3
  1. 4
      l10n_fr_tax_return/data/account_tax_return.xml
  2. 6
      l10n_fr_tax_return/models/account_tax_return.py
  3. 3
      l10n_fr_tax_return/models/account_tax_return_year.py
  4. 15
      l10n_fr_tax_return/wizards/tax_return_wizard.py

4
l10n_fr_tax_return/data/account_tax_return.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- <data noupdate="1"> -->
<data>
<data noupdate="1">
<!-- <data> -->
<!-- Result lines -->

6
l10n_fr_tax_return/models/account_tax_return.py

@ -45,8 +45,8 @@ class AccountTaxReturn(models.Model):
self.ensure_one()
if not self.is_sum_line:
if self.line_type == "credit":
return sum(move_lines.mapped(lambda aml: aml.credit - aml.debit))
return round(sum(move_lines.mapped(lambda aml: aml.credit - aml.debit)))
else:
return sum(move_lines.mapped(lambda aml: aml.debit - aml.credit))
return round(sum(move_lines.mapped(lambda aml: aml.debit - aml.credit)))
else:
return 0.0
return 0

3
l10n_fr_tax_return/models/account_tax_return_year.py

@ -16,7 +16,6 @@ class AccountTaxReturnYear(models.Model):
line_type = fields.Selection(
related="line_id.line_type",
)
amount = fields.Float(
amount = fields.Integer(
string="Amount",
digits="Product Price",
)

15
l10n_fr_tax_return/wizards/tax_return_wizard.py

@ -20,17 +20,6 @@ class TaxReturnWizard(models.TransientModel):
"Please set a year in the past and after you started your odoo accounting."
)
)
# return {
# "value": {
# "name": "",
# },
# "warning": {
# "title": _("Wrong year !"),
# "massage": _(
# "Please set a year in the past and after you started your odoo accounting."
# ),
# },
# }
def execute(self):
self._check_year()
@ -81,7 +70,7 @@ class TaxReturnWizard(models.TransientModel):
lambda atry: atry.line_id.id in line.sum_line_ids.ids
).mapped("amount")
)
or 0.0
or 0
)
- (
sum(
@ -89,7 +78,7 @@ class TaxReturnWizard(models.TransientModel):
lambda atry: atry.line_id.id in line.ded_line_ids.ids
).mapped("amount")
)
or 0.0
or 0
),
}
year_atry |= ATRY.create([new_vals])

Loading…
Cancel
Save