Browse Source

[FIX]GOLEM Registration Payment : bad domains

Were made from onchange and not using is_default anymore.
master
Fabien BOURGEOIS 1 year ago
parent
commit
9f36b0a365
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      golem_activity_registration/__manifest__.py
  2. +3
    -3
      golem_activity_registration/models/golem_activity_registration.py

+ 1
- 1
golem_activity_registration/__manifest__.py View File

@@ -18,7 +18,7 @@
{
'name': 'GOLEM Activity Member Registrations',
'summary': 'GOLEM Activities Member Registrations management',
'version': '10.0.1.6.3',
'version': '10.0.1.6.4',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',


+ 3
- 3
golem_activity_registration/models/golem_activity_registration.py View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2017-2018 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2017-2019 Fabien Bourgeois <fabien@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -95,7 +95,7 @@ class GolemActivityRegistration(models.Model):
@api.onchange('activity_id', 'activity_id.only_for_subscriber')
def onchange_activity_subcrib(self):
""" If activity only for subscribers : do not allow non subscribers """
domain = []
domain = [('is_default', '=', True)]
if self.activity_id.only_for_subscriber:
domain.append(('membership_state', 'not in', ('none', 'canceled', 'old')))
return {'domain': {'member_id': domain}}
@@ -103,7 +103,7 @@ class GolemActivityRegistration(models.Model):
@api.onchange('member_id')
def onchange_member_subcrib(self):
""" If not subscriber : do not show subscribers only activities """
domain = []
domain = [('is_default', '=', True)]
if self.member_id and self.member_id.membership_state in ('none', 'canceled', 'old'):
domain.append(('only_for_subscriber', '=', False))
return {'domain': {'activity_id': domain}}


Loading…
Cancel
Save