Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ivantodorovich
Copy link

@ivantodorovich ivantodorovich commented Apr 4, 2023

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.


Easier to review commit by commit

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.
@ivantodorovich ivantodorovich added this to the 15.0 milestone Apr 4, 2023
@ivantodorovich ivantodorovich force-pushed the 15.0-imp-pos-event-sale-change-qty-blocked branch from 99f0ca3 to e59deae Compare April 4, 2023 21:10
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.
@ivantodorovich ivantodorovich force-pushed the 15.0-imp-pos-event-sale-change-qty-blocked branch from e59deae to 8723b3f Compare April 5, 2023 17:24
@ivantodorovich ivantodorovich marked this pull request as ready for review April 5, 2023 20:18
Moved some ORM tests to `tests_backend`, that will execute faster than tours.
Added unit tests to cover more backend scenarios.
@ivantodorovich ivantodorovich force-pushed the 15.0-imp-pos-event-sale-change-qty-blocked branch from e04ab31 to 097acf2 Compare April 5, 2023 20:27
@yankinmax
Copy link
Contributor

@ivantodorovich thanks for the great and necessary improvement 👍

Copy link
Contributor

@Camille0907 Camille0907 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@ivantodorovich
Copy link
Author

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-962-by-ivantodorovich-bump-major, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 82d85ae. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot deleted the 15.0-imp-pos-event-sale-change-qty-blocked branch April 6, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants