Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] pos_sale: remove redundant try-catch block
Issue --> In `_onClickSaleOrder`, we load in the partner on the sale order using `load_new_partners()`. However, the search on the `res.partner` model made in this method has the potential to return every single `res.partner` record because of the domain that it uses --> https://github.com/odoo/odoo/blob/6c2dd5fbd9898f0efecdc35593af69bfd7d4eb50/addons/point_of_sale/static/src/js/models.js#L783-L785 After doing so, we check if the parter has been loaded and we grab the id using `get_partner_by_id`. If the partner is not loaded, we use `_loadPartners` to load them. Since we are already checking and reloading the partner on the sale order using `_loadPartners`, using `load_new_partners()` earlier is redundant. Solution --> Remove the try-catch block that loads multiple `res.partner` records during the process of clicking a sale order via POS. opw-3619941 closes odoo#156836 Signed-off-by: Vlad Stroia (vlst) <[email protected]>
- Loading branch information