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

[FW][FIX] point_of_sale: fix memory error #124375

Commits on Jun 9, 2023

  1. [FIX] point_of_sale: fix memory error

    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
    aj-fuentes committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    52e30f1 View commit details
    Browse the repository at this point in the history