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"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<!-- <data noupdate="1"> -->
<data>
<data noupdate="1">
<!-- <data> -->
<!-- Result lines --> <!-- Result lines -->

6
l10n_fr_tax_return/models/account_tax_return.py

@ -45,8 +45,8 @@ class AccountTaxReturn(models.Model):
self.ensure_one() self.ensure_one()
if not self.is_sum_line: if not self.is_sum_line:
if self.line_type == "credit": 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: 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: 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( line_type = fields.Selection(
related="line_id.line_type", related="line_id.line_type",
) )
amount = fields.Float(
amount = fields.Integer(
string="Amount", 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." "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): def execute(self):
self._check_year() self._check_year()
@ -81,7 +70,7 @@ class TaxReturnWizard(models.TransientModel):
lambda atry: atry.line_id.id in line.sum_line_ids.ids lambda atry: atry.line_id.id in line.sum_line_ids.ids
).mapped("amount") ).mapped("amount")
) )
or 0.0
or 0
) )
- ( - (
sum( sum(
@ -89,7 +78,7 @@ class TaxReturnWizard(models.TransientModel):
lambda atry: atry.line_id.id in line.ded_line_ids.ids lambda atry: atry.line_id.id in line.ded_line_ids.ids
).mapped("amount") ).mapped("amount")
) )
or 0.0
or 0
), ),
} }
year_atry |= ATRY.create([new_vals]) year_atry |= ATRY.create([new_vals])

Loading…
Cancel
Save