Commit da9f2673 by François

Facilitation accès boutique : pas de contrainte stock et accès contact

parent 76e3127d
Pipeline #825 failed with stage
in 10 seconds
...@@ -5,4 +5,5 @@ lint:js: ...@@ -5,4 +5,5 @@ lint:js:
paths: paths:
- node_modules/ - node_modules/
script: script:
- source ~/.profile
- make lint-js - make lint-js
...@@ -93,7 +93,9 @@ class CagetteMember(models.Model): ...@@ -93,7 +93,9 @@ class CagetteMember(models.Model):
fp = request.POST.get('fp') # fingerprint (prevent using stolen cookies) fp = request.POST.get('fp') # fingerprint (prevent using stolen cookies)
if login and password: if login and password:
api = OdooAPI() api = OdooAPI()
cond = [['email', '=', login], ['is_member', '=', True]] cond = [['email', '=', login]]
if getattr(settings, 'ALLOW_NON_MEMBER_TO_CONNECT', False) is False:
cond.append(['is_member', '=', True])
fields = ['name', 'email', 'birthdate', 'create_date', 'cooperative_state'] fields = ['name', 'email', 'birthdate', 'create_date', 'cooperative_state']
res = api.search_read('res.partner', cond, fields) res = api.search_read('res.partner', cond, fields)
if (res and len(res) >= 1): if (res and len(res) >= 1):
......
...@@ -62,7 +62,7 @@ class CagetteShop(models.Model): ...@@ -62,7 +62,7 @@ class CagetteShop(models.Model):
def filter_products_according_settings(pdts): def filter_products_according_settings(pdts):
res = pdts res = pdts
try: try:
conditions = settings.SHOP_LIMIT_PRODUCTS conditions = gettattr(settings, 'SHOP_LIMIT_PRODUCTS', [])
filtered = [] filtered = []
for p in pdts: for p in pdts:
keep_it = True keep_it = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment