Skip to content
Snippets Groups Projects
Commit e8061518 authored by Goffin Simon's avatar Goffin Simon
Browse files

[FIX] point_of_sale: product not available in POS if not salable

When the box "Can be sold" on product.template is unticked, the
product must be unavailable in the point of sale.

Closes #22061
opw:1844188
parent 871387ca
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,11 @@ class ProductTemplate(models.Model):
raise UserError(_('You cannot delete a product saleable in point of sale while a session is still opened.'))
return super(ProductTemplate, self).unlink()
@api.onchange('sale_ok')
def _onchange_sale_ok(self):
if not self.sale_ok:
self.available_in_pos = False
class ProductUomCateg(models.Model):
_inherit = 'product.uom.categ'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment