Skip to content
Snippets Groups Projects
  1. Dec 16, 2022
  2. Dec 15, 2022
  3. Dec 14, 2022
    • roen-odoo's avatar
      [FIX] pos_coupon: correctly filter out global discount · db459b33
      roen-odoo authored
      
      Current behavior:
      When a global discount is applied, it is considered as a regular
      orderline when computing the order discounts. Because of this if you
      applied a coupon and a global discount, the pos would add a discount of
      infinity value.
      
      Steps to reproduce:
      - Create a promotion with a discount of 10%
      - Create a product with no taxes
      - Enable the global discount feature, and make sure the Discount product
        has a tax set on it.
      - Create a new order, add the product, apply the promotion, and apply
        the global discount.
      - The order will have a discount of infinity value.
      
      opw-3094784
      
      closes odoo/odoo#107833
      
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      db459b33
    • Merel Geens (mege)'s avatar
      [FIX] point_of_sale: prevent closing a POS session multiple times in a · 6b12c64e
      Merel Geens (mege) authored
      
      row
      
      When it comes to closing POS sessions, both the frontend and the backend
      currently have some way to prevent the same operations from executing
      simultaneously because of repeated clicks. `closeSession` in the
      frontend has a `closeSessionClicked` boolean that prevents the operation
       from triggering multiple times at once. `close_session_from_ui`
      in the backend checks if the session state isn't already `closed`.
      
      A flaw in the current logic is that
      `update_closing_control_state_session`, which is called by the frontend
      before `close_session_from_ui`, doesn't check the session state before
      writing it to be `closing_control`. This means that if you time things
      in such a way that the `closeSession` logic in the frontend triggers
      again right after it finishes, it will call
      `update_closing_control_state_session` and `close_session_from_ui`
      again, which will happily close the session again, duplicating stock
      moves and account moves resulting from it.
      
      This fix has `update_closing_control_state_session` check if the session
      is already closed and raises a UserError if so. This prevents the
      duplicate closings and records from happening.
      
      There were two variants in the UI I observed when the issue occurred:
      the first is when the repeated execution of
      `update_closing_control_state_session` and `close_session_from_ui`
      successfully finished. In that case the session would be closed with
      duplicate stock moves and journal entries.
      
      In the second variant, from the repeated calls only
      `update_closing_control_state_session` executed but not
      `close_session_from_ui`. This could happen if the timing of the
      frontend was such that it redirected to the POS dashboard before it was
      able to call `close_session_from_ui`. In that case, the session would
      be in the `closing_control` state, which is visible in the POS dashboard
      . If the user then closed the session, it would be closed twice and the
      duplicate records would again be created.
      
      opw-2988701
      
      closes odoo/odoo#107873
      
      Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
      6b12c64e
  4. Dec 13, 2022
  5. Dec 12, 2022
Loading