Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0] l10n_fr_das2: move declaration threshold to pyfrdas2 #554

Merged
merged 1 commit into from
Jun 14, 2024
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
1 change: 0 additions & 1 deletion l10n_fr_das2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import models
from . import wizards
3 changes: 1 addition & 2 deletions l10n_fr_das2/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"l10n_fr_cog",
],
"external_dependencies": {
"python": ["stdnum", "pyfrdas2"],
"python": ["stdnum", "pyfrdas2>=0.4"],
},
"data": [
"security/das2_security.xml",
"security/ir.model.access.csv",
"views/l10n_fr_das2.xml",
"views/res_partner.xml",
"views/res_config_settings.xml",
],
"demo": ["demo/demo.xml"],
"installable": True,
Expand Down
1 change: 0 additions & 1 deletion l10n_fr_das2/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from . import l10n_fr_das2
from . import res_partner
from . import res_company
18 changes: 8 additions & 10 deletions l10n_fr_das2/models/l10n_fr_das2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from datetime import datetime

from markupsafe import Markup
from pyfrdas2 import format_street_block, generate_file
from pyfrdas2 import (
format_street_block,
generate_file,
get_partner_declaration_threshold,
)
from stdnum.fr.siret import is_valid

from odoo import _, api, fields, models, tools
Expand Down Expand Up @@ -240,15 +244,9 @@
currency=company.currency_id.name,
)
)
if company.fr_das2_partner_declare_threshold <= 0:
raise UserError(
_(
"The DAS2 partner declaration threshold is not set on "
"company '%s'."
)
% company.display_name
)
self.partner_declare_threshold = company.fr_das2_partner_declare_threshold
self.write(

Check warning on line 247 in l10n_fr_das2/models/l10n_fr_das2.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_das2/models/l10n_fr_das2.py#L247

Added line #L247 was not covered by tests
{"partner_declare_threshold": get_partner_declaration_threshold(self.year)}
)
das2_partners = self.env["res.partner"].search(
[("parent_id", "=", False), ("fr_das2_type", "!=", False)]
)
Expand Down
21 changes: 0 additions & 21 deletions l10n_fr_das2/models/res_company.py

This file was deleted.

29 changes: 0 additions & 29 deletions l10n_fr_das2/views/res_config_settings.xml

This file was deleted.

1 change: 0 additions & 1 deletion l10n_fr_das2/wizards/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions l10n_fr_das2/wizards/res_config_settings.py

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated from manifests external_dependencies
pyfrdas2
pyfrdas2>=0.4
python-stdnum
python-stdnum>=1.18
requests_oauthlib
Expand Down
Loading