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

[15.0][IMP] l10n_es_intrastat_report: Improve tests to test an invoice with delivery address in a country other than the country of contact #2890

Merged
Merged
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
15 changes: 13 additions & 2 deletions l10n_es_intrastat_report/tests/test_l10n_es_intrastat_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ def _create_invoice(cls, inv_type, partner, product=None):
)
move_form.ref = "ABCDE"
move_form.partner_id = partner
move_form.partner_shipping_id = partner
partner_shipping = partner.child_ids.filtered(lambda x: x.type == "delivery")
move_form.partner_shipping_id = (
partner_shipping if partner_shipping else partner
)
move_form.invoice_date = datetime.today()
with move_form.invoice_line_ids.new() as line_form:
line_form.name = "test"
Expand Down Expand Up @@ -59,7 +62,15 @@ def setUpClass(cls, chart_template_ref=None):
cls.env.user.company_id.incoterm_id = cls.env.ref("account.incoterm_FCA").id
# Create Intrastat partners
cls.partner_1 = cls.env["res.partner"].create(
{"name": "Test Partner FR", "country_id": cls.env.ref("base.fr").id}
{"name": "Test Partner FR", "country_id": cls.env.ref("base.es").id}
)
cls.env["res.partner"].create(
{
"name": "Test Partner FR",
"country_id": cls.env.ref("base.fr").id,
"parent_id": cls.partner_1.id,
"type": "delivery",
}
)
cls.partner_2 = cls.env["res.partner"].create(
{"name": "Test Partner PT", "country_id": cls.env.ref("base.pt").id}
Expand Down