[FIX]GOLEM Member / Registration analysis fix on reusing current

Current analysis will add / double results with now truncate.
This commit is contained in:
Fabien BOURGEOIS 2019-01-21 17:03:36 +01:00
parent a533a6b7f8
commit 1561a47a83
4 changed files with 12 additions and 2 deletions

View File

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

View File

@ -79,6 +79,11 @@ class GolemActivityRegistrationAnalysisWizard(models.TransientModel):
""" registration analyse """
self.ensure_one()
analysis_rec = self[0]
# Remove existing analysis lines for current analysis
self.env['golem.member.analysis'].search(
[('resgistration_analysis_id', '=', analysis_rec.id)]
).unlink()
registrations = analysis_rec.get_registrations()
if registrations:
for registration in registrations:

View File

@ -21,7 +21,7 @@
'name': 'GOLEM non-profit members',
'summary': 'Extends Odoo contacts for MJC',
'description': 'Extends Odoo contacts for MJC',
'version': '10.0.2.7.1',
'version': '10.0.2.7.2',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',

View File

@ -91,6 +91,11 @@ class GolemMemberAnalysis(models.TransientModel):
""" members analyse """
self.ensure_one()
analysis_rec = self[0]
# Remove existing analysis lines for current analysis
self.env['golem.member.analysis'].search(
[('member_analysis_id', '=', analysis_rec.id)]
).unlink()
members = analysis_rec.get_members()
if members:
for member in members: