Skip to content

[IMP] l10n_tr_nilvera_einvoice: add tests#228010

Closed
fw-bot wants to merge 1 commit intoodoo:18.0from
odoo-dev:18.0-17.0-nilvera_einvoice_tests-sana-445833-fw
Closed

[IMP] l10n_tr_nilvera_einvoice: add tests#228010
fw-bot wants to merge 1 commit intoodoo:18.0from
odoo-dev:18.0-17.0-nilvera_einvoice_tests-sana-445833-fw

Conversation

@fw-bot
Copy link
Copy Markdown
Contributor

@fw-bot fw-bot commented Sep 22, 2025

Currently we're lacking tests for the Nilvera API integration. This
commit adds a test suite that primarily focuses on testing that.

Task ID: 4655864

Forward-Port-Of: #216179

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Sep 22, 2025

Pull request status dashboard

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Sep 22, 2025
@fw-bot
Copy link
Copy Markdown
Contributor Author

fw-bot commented Sep 22, 2025

@SaddemAmine @alialfie cherrypicking of pull request #216179 failed.

stdout:

Auto-merging addons/l10n_tr_nilvera_einvoice/models/account_move.py
CONFLICT (content): Merge conflict in addons/l10n_tr_nilvera_einvoice/models/account_move.py
Auto-merging addons/l10n_tr_nilvera_einvoice/tests/__init__.py
CONFLICT (add/add): Merge conflict in addons/l10n_tr_nilvera_einvoice/tests/__init__.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch 2 times, most recently from b7be7da to 7114b49 Compare September 26, 2025 08:14
Comment on lines -47 to -48
if modules.module.current_test:
return
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous impl we disregarded the compute method verifying the partners' statuses. I think it's better to revert this to prevent regression. It's unfortunately not a "test" since we check this during the setUpClass but I think it's good enough.

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch from 7114b49 to 238070d Compare September 26, 2025 08:20
@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch 6 times, most recently from f47f8c1 to 5e33ae7 Compare September 29, 2025 15:17
@fw-bot
Copy link
Copy Markdown
Contributor Author

fw-bot commented Sep 30, 2025

@SaddemAmine @alialfie this forward port of #216179 is awaiting action (not merged or closed).

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch 2 times, most recently from 3324864 to 41336c5 Compare September 30, 2025 13:56
@SaddemAmine
Copy link
Copy Markdown
Contributor

In this FW we adapt the changes in original PR to work with l10n_tr_nilvera_einvoice_extended since both modules utilize the same common file. We also integrate already existing tests from the previous implementation that test multicurrency scenarios and earchive exports. The aforementioned will not be backported to 17.0 following the stable policy currently only allowing critical changes to be committed in unsupported versions.

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch from 41336c5 to a4108aa Compare October 1, 2025 09:55
@alialfie alialfie removed their request for review October 1, 2025 10:35
@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch 4 times, most recently from 7dbc962 to 8c35921 Compare October 1, 2025 11:45
@SaddemAmine
Copy link
Copy Markdown
Contributor

The test partners VAT change is needed to comply with the base_vat TR format even though, AFAIK, we noticed that Nilvera itself (which communicates straight with the Turkish government) can have VAT numbers that follow other formats.

@alialfie
Copy link
Copy Markdown
Contributor

alialfie commented Oct 2, 2025

As discussed, a new PR #229724 has been created to remove the file for the skipped tests that were conflicting with this FW port. This FW port will now only be concerned with the mocking part for testing which should be in a new file specifically for mocking API calls.

@SaddemAmine Please update the PR and the commit message accordingly :D

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch from 8c35921 to ddd3686 Compare October 3, 2025 07:37
@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch 4 times, most recently from f6f44cb to 1ef717d Compare October 3, 2025 09:20
@SaddemAmine
Copy link
Copy Markdown
Contributor

To clarify how this FW is being handled: first, we decided to keep the check in _compute_nilvera_customer_status_and_alias_id within l10n_tr_nilvera_einvoice and add an additional safeguard to make sure the compute still runs when mocking Nilvera endpoints and executing the TestTRNilveraEInvoice suite.

Second, as Ali mentioned, the tests introduced here are strictly about ensuring proper interaction with Nilvera. All XML generation tests are now handled in l10n_tr_nilvera_einvoice_extended and should be merged back into l10n_tr_nilvera_einvoice as of saas~18.4.

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch from 1ef717d to 0320c71 Compare October 3, 2025 10:49
Copy link
Copy Markdown
Contributor

@FlorianGilbert FlorianGilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we r+ now? @alialfie @SaddemAmine

@SaddemAmine
Copy link
Copy Markdown
Contributor

@FlorianGilbert Yup
Should be good to go

@SaddemAmine
Copy link
Copy Markdown
Contributor

robodoo r+

@alialfie
Copy link
Copy Markdown
Contributor

alialfie commented Oct 3, 2025

robodoo r-

@SaddemAmine You forgot to change the file name, no?

@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch from 0320c71 to a47d6b4 Compare October 3, 2025 14:06
@SaddemAmine
Copy link
Copy Markdown
Contributor

Yuup, completely slipped my mind
IIRC we should be good now
What do you think ? @alialfie

Currently we're lacking tests for the Nilvera API integration. This
commit adds a test suite that primarily focuses on testing that.

Task ID: 4655864

X-original-commit: 2dfcbe5
@SaddemAmine SaddemAmine force-pushed the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch from a47d6b4 to 86f5603 Compare October 3, 2025 14:19
Copy link
Copy Markdown
Contributor

@alialfie alialfie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanksss
robodoo r+

robodoo pushed a commit that referenced this pull request Oct 3, 2025
Currently we're lacking tests for the Nilvera API integration. This
commit adds a test suite that primarily focuses on testing that.

Task ID: 4655864

closes #228010

X-original-commit: 2dfcbe5
Signed-off-by: Ali Alfie (alal) <alal@odoo.com>
@robodoo robodoo closed this Oct 3, 2025
@fw-bot fw-bot deleted the 18.0-17.0-nilvera_einvoice_tests-sana-445833-fw branch October 10, 2025 18:46
gamarino pushed a commit to numaes/numa-public-odoo that referenced this pull request Oct 31, 2025
Currently we're lacking tests for the Nilvera API integration. This
commit adds a test suite that primarily focuses on testing that.

Task ID: 4655864

closes odoo/odoo#228010

X-original-commit: 2dfcbe53c80d2d8fe5b6d9828eea90a1d214c2e4
Signed-off-by: Ali Alfie (alal) <alal@odoo.com>
sbejaoui pushed a commit to acsone/odoo that referenced this pull request Feb 16, 2026
Currently we're lacking tests for the Nilvera API integration. This
commit adds a test suite that primarily focuses on testing that.

Task ID: 4655864

closes odoo#228010

X-original-commit: 2dfcbe5
Signed-off-by: Ali Alfie (alal) <alal@odoo.com>
carlosdauden pushed a commit to Tecnativa/odoo that referenced this pull request Mar 10, 2026
Currently we're lacking tests for the Nilvera API integration. This
commit adds a test suite that primarily focuses on testing that.

Task ID: 4655864

closes odoo#228010

X-original-commit: 2dfcbe5
Signed-off-by: Ali Alfie (alal) <alal@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants