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: fix memory error #124375
[FW][FIX] point_of_sale: fix memory error #124375
Conversation
@aj-fuentes @KangOl cherrypicking of pull request #124119 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. |
When there are too many (millions) of POS order lines associated to opened POS sessions we get too many taxes, most are duplicated. This causes a MemorryError. Example queries from a real DB: ``` > select count(distinct r.account_tax_id) from pos_order_line l join pos_order o on o.id = l.order_id join pos_session s on s.id = o.session_id join account_tax_pos_order_line_rel r on r.pos_order_ line_id = l.id where s.state != 'closed' +-------+ | count | |-------| | 24 | +-------+ > select count(r.account_tax_id) from pos_order_line l join pos_order o on o.id = l.order_id join pos_session s on s.id = o.session_id join account_tax_pos_order_line_rel r on r.pos_order_line_id = l.id where s.state != 'closed' +---------+ | count | |---------| | 2504539 | +---------+ ``` opw-3295467 X-original-commit: 14ff7de
cf8dac7
to
52e30f1
Compare
@KangOl I fixed the conflict. Note that I'm not sure if one of the new methods would be better or not regarding the optimization of fetch. |
@robodoo r+ |
When there are too many (millions) of POS order lines associated to opened POS sessions we get too many taxes, most are duplicated. This causes a MemorryError. Example queries from a real DB: ``` > select count(distinct r.account_tax_id) from pos_order_line l join pos_order o on o.id = l.order_id join pos_session s on s.id = o.session_id join account_tax_pos_order_line_rel r on r.pos_order_ line_id = l.id where s.state != 'closed' +-------+ | count | |-------| | 24 | +-------+ > select count(r.account_tax_id) from pos_order_line l join pos_order o on o.id = l.order_id join pos_session s on s.id = o.session_id join account_tax_pos_order_line_rel r on r.pos_order_line_id = l.id where s.state != 'closed' +---------+ | count | |---------| | 2504539 | +---------+ ``` opw-3295467 closes #124375 X-original-commit: 14ff7de Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
When there are too many (millions) of POS order lines associated to opened POS sessions we get too many taxes, most are duplicated. This causes a MemoryError.
Example queries from a real DB:
opw-3295467
Forward-Port-Of: #124194
Forward-Port-Of: #124119