-
-
Notifications
You must be signed in to change notification settings - Fork 660
[15.0] [FIX+IMP] pos_event_sale: compatibility with pos certification modules
#962
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
Conversation
When paying a `pos.order`, confirm only the `event.registration` that are in draft state. Don't attempt to confirm the ones that are already confirmed, nor the ones that might be cancelled.
If we cancel a `pos.order`, we should cancel the related `event.registration`(s) However, if the `event.registration` is already done, we should not cancel it as it would be already too late to do so.
Registrations created from the PoS are not to be confirmed automatically. We confirm them when the `pos.order` is paid, but they are to remain in `draft` until then.
99f0ca3 to
e59deae
Compare
In the PoS, if the order is not paid, then it's not confirmed. If it's not confirmed, then we might as well ignore it. We shouldn't cancel any existing registrations until then.
Negated lines are particularly useful with PoS modules that disable the removal of pos orderlines through the use of ``disallowLineQuantityChange``. This is the case of `l10n_fr_pos_cert` module, for example. But there are other core modules doing it, too. In this case, added order lines can't be removed. Instead, the cashier is encouraged to add a negative to 'cancel' the original one. e.g.: Adds a line with 10 tickets. Then, adds a line with -10 tickets. This should be almost the same as removing the first line: no actual registration should be confirmed in the end, as we're reverting this sale.
e59deae to
8723b3f
Compare
Moved some ORM tests to `tests_backend`, that will execute faster than tours. Added unit tests to cover more backend scenarios.
e04ab31 to
097acf2
Compare
|
@ivantodorovich thanks for the great and necessary improvement 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
|
/ocabot merge major |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 82d85ae. Thanks a lot for contributing to OCA. ❤️ |
Negated lines are particularly useful with PoS modules that disable the removal
of pos orderlines through the use of
disallowLineQuantityChange.This is the case of
l10n_fr_pos_certmodule, for example. But there are othercore modules doing it, too.
In this case, added order lines can't be removed. Instead, the cashier is
encouraged to add a negative to 'cancel' the original one.
e.g.:
Adds a line with 10 tickets.
Then, adds a line with -10 tickets.
This should be almost the same as removing the first line: no actual
registration should be confirmed in the end, as we're reverting this sale.
Easier to review commit by commit