[FIX]GOLEM Registration Payment : bad domains

Were made from onchange and not using is_default anymore.
这个提交包含在:
Fabien BOURGEOIS 2019-07-29 18:19:21 +02:00
父节点 481ca0994d
当前提交 9f36b0a365
共有 2 个文件被更改,包括 4 次插入4 次删除

查看文件

@ -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',

查看文件

@ -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}}