shopinvader / odoo-shopinvader

Odoo Modules. Sorry Magento, Shopinvader is coming
GNU Affero General Public License v3.0
121 stars 104 forks source link

Protect cart from not bound records #455

Closed simahawk closed 5 years ago

simahawk commented 5 years ago

Goal

Make sure nobody can add a non bound product to the cart. Collateral goal: allow to control product availability for selling from different contexts.

Solution

Add a generic method to product to check it no matter where.

TODO

  1. add _add_to_cart_allowed method to product.product (gets backend and partner)
  2. add minimal check check if a binding for given backend is available
  3. use it in cart.add_item (partner and backend come from service context)

Aggregator issue: #452

simahawk commented 5 years ago

https://github.com/shopinvader/odoo-shopinvader/pull/511

simahawk commented 5 years ago

done