-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[FW][FIX] point_of_sale: keeping failed to sync orders as an attachment #157119
Conversation
@pedrambiria @caburj cherrypicking of pull request #147130 failed. stdout:
stderr:
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. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
7e80000
to
db9a792
Compare
@xmo-odoo security override due to conflict (once once once again) please 🙏 @pedrambiria I propose to r+ the PR later when you will more available as 17.0 is used a lot |
https://docs.python.org/3/library/traceback.html#traceback.format_exception
As far as I can see from 3.5 onwards if there are 3 arguments the first one is just ignored, so you can pas |
db9a792
to
c802a13
Compare
Indeed nice catch!
On which we can just give the exception as a parameter |
c802a13
to
443512f
Compare
@xmo-odoo is there still some security check that you would like to check ? |
443512f
to
582ff0a
Compare
TODO: see how we handle the order remove from the front end after failed to sync (as no call to the backend is done). Probably garbage collect them |
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.
@robodoo override=ci/security
TODO 2: may be able to use: #161250 to distinguish for TODO1 |
TODO-main: discussed with JCB: only orders that are NOT converted to draft interest us to keep. Others can be not stored (so just ignored like restaurant draft orders) as they are considered not fully validated. Depends on PEBR previous PR, so wait for it to be merged |
f44c94f
to
76da46a
Compare
@pedrambiria would you mind reviewing the PR please ? :) I used the option that you introduced on this part of the code to forward the information to the backend: |
@xmo-odoo would you mind giving me your opinion on this part of the code: I'm pretty sure there is a cleaner/better way to do so. Would it be better to make the whole message a Markup maybe ? |
d37de6d
to
bdf3e59
Compare
You can use |
@lse-odoo you can add it to the context in |
931a1a6
to
5d93052
Compare
I was not able to find a good way to use |
d67e59c
to
df0dc1b
Compare
Before this commit: If an error happened when trying to process a PoS order nothing is saved on the backend to inform the user regarding the error. Note: Odoo logs would contain the information, but it is out of reach for certain clients (on odoo online for instance). In theory, we can't lose any information as, if the sync process raise an exception, the order is still on the PoS browser cache that will then try to be resync when another order sync happen. But, in practice, the support received some cases of "missing PoS orders". Which can happen as we fully rely on the client browser cache that can be cleared or use another computer/browser/session. After this commit: If an order can not be processed in the backend: - the PoS order data is saved in the PoS session attachments - a scheduled activity is created in the PoS session As an un-synced keep being tried to be sync (and will likely fail each time), we compare it with the already attached one to avoid having the content repeated multiple times. If the order was modified in between, a new attachment with the same name is created. Note: draft orders that will fail to validate are NOT stored The attachment and activity are automatically removed when the order of same reference is validated We also add logs when a PoS order start/finish to synchronise opw-3650239 X-original-commit: 44fff0a
df0dc1b
to
8868f47
Compare
I might have misread the order of operation in the original, sorry. Looks good to me. |
@pedrambiria could you forward bot r+ this PR if you agree with the changes ? :) |
robodoo r+ |
Before this commit: If an error happened when trying to process a PoS order nothing is saved on the backend to inform the user regarding the error. Note: Odoo logs would contain the information, but it is out of reach for certain clients (on odoo online for instance). In theory, we can't lose any information as, if the sync process raise an exception, the order is still on the PoS browser cache that will then try to be resync when another order sync happen. But, in practice, the support received some cases of "missing PoS orders". Which can happen as we fully rely on the client browser cache that can be cleared or use another computer/browser/session. After this commit: If an order can not be processed in the backend: - the PoS order data is saved in the PoS session attachments - a scheduled activity is created in the PoS session As an un-synced keep being tried to be sync (and will likely fail each time), we compare it with the already attached one to avoid having the content repeated multiple times. If the order was modified in between, a new attachment with the same name is created. Note: draft orders that will fail to validate are NOT stored The attachment and activity are automatically removed when the order of same reference is validated We also add logs when a PoS order start/finish to synchronise opw-3650239 closes odoo#157119 X-original-commit: 44fff0a Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
(wrote by LSE)
Before this commit:
If an error happened when trying to synchronise a PoS order nothing is saved on the backend to inform the user regarding the error.
Note: Odoo logs would contain the information, but it is out of reach for certain clients (on odoo online for instance).
In theory, we can't lose any information as, if the sync process raise an exception, the order is still on the PoS browser cache that will then try to be resync when another order sync happen.
But, in practice, the support received some cases of "missing PoS orders". Which can happen as we fully rely on the client browser cache that can be cleared or use another computer/browser/session.
After this commit:
If an order can not be processed in the backend:
As an un-synced keep being tried to be sync (and will likely fail each time), we compare it with the already attached one to avoid having the content repeated multiple times.
If the order was modified in between, a new attachment with the same name is created.
Note: draft orders that will fail to validate are NOT stored
The attachment and activity are automatically removed when the order of same reference is validated
opw-3650239
Forward-Port-Of: #155401
Forward-Port-Of: #147130