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

[16.0][ADD] event_sale_seat_reserve #395

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from

Conversation

imlopes
Copy link

@imlopes imlopes commented Jul 31, 2024

Depends on #394

@imlopes imlopes force-pushed the 16.0-new-event_sale_seat_reserve branch from 4a3a521 to 29897f2 Compare July 31, 2024 13:29
@imlopes imlopes force-pushed the 16.0-new-event_sale_seat_reserve branch 3 times, most recently from 10db0da to c2c53f7 Compare July 31, 2024 15:31
event_sale_seat_reserve/__manifest__.py Outdated Show resolved Hide resolved
@imlopes imlopes force-pushed the 16.0-new-event_sale_seat_reserve branch 2 times, most recently from 19336eb to 83ddd9a Compare August 1, 2024 11:58
@imlopes imlopes force-pushed the 16.0-new-event_sale_seat_reserve branch from 83ddd9a to 8bc9aea Compare August 1, 2024 11:59
Comment on lines +31 to +35
if config["test_enable"] and not self.env.context.get(
"test_event_seat_reserve"
):
_logger.info("Test mode is enabled, skipping the reservation of the seats")
return res

Choose a reason for hiding this comment

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

If you need to skip tests then your code is not properly testable. This is a big quality warning IMO

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeap, I agree..

Copy link
Author

Choose a reason for hiding this comment

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

I'm skipping test because in some standard tests, we're checking if a registration is on draft state.
But, with this module, a registration with a sale will be automatically on "reserved" state.

https://github.com/odoo/odoo/blob/4d9611924d753e314efdcc571c2bbe875b69e602/addons/event_sale/tests/test_event_sale.py#L286

Copy link
Member

Choose a reason for hiding this comment

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

This technique is totally legit to keep compatibility with old/other flows for the rest of the modules. It's not for this module. It's for not making the other tests (even standard ones) not to fail. I don't think there's other option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants