[IMP]GOLEM Member : analysis with choice between service users and members

This commit is contained in:
Fabien BOURGEOIS 2020-01-16 16:53:23 +01:00
parent 165830363a
commit a73eafbc02
5 changed files with 48 additions and 45 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2019 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2016-2020 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2018 Michel Dessenne <michel@yaltik.com>
# Copyright 2018 Youssef El Ouahby <youssef@yaltik.com>
@ -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.8.0',
'version': '10.0.2.8.1',
'category': 'GOLEM',
'author': 'Fabien Bourgeois, Michel Dessenne',
'license': 'AGPL-3',

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-21 16:01+0000\n"
"PO-Revision-Date: 2019-01-21 17:05+0100\n"
"POT-Creation-Date: 2020-01-16 15:46+0000\n"
"PO-Revision-Date: 2020-01-16 16:52+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -230,11 +230,6 @@ msgstr "Par ville"
msgid "By family quotient and area"
msgstr "Par quotient familial et territoire"
#. module: golem_member
#: selection:golem.member.analysis.wizard,analyse_type:0
msgid "By family quotient slice and area"
msgstr "Par tranche de quotient familial et territoire"
#. module: golem_member
#: selection:golem.member.analysis.wizard,analyse_type:0
#: model:ir.ui.view,arch_db:golem_member.golem_member_search
@ -621,7 +616,7 @@ msgid "GOLEM Members Tags"
msgstr "Catégories d'adhérents"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:465
#: code:addons/golem_member/models/golem_member.py:452
#, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging."
msgstr "La fusion d'adhérents n'a pas encore été implémentée. Merci de ne fusionner que des contacts non adhérents, ou bien de supprimer les adhérents manuellement en premier lieu."
@ -923,12 +918,13 @@ msgid "Medium-sized image of this contact. It is automatically resized as a 128x
msgstr "Image de taille moyenne de ce contact. Elle est automatiquement redimensionnée en 128x128px, avec un ratio d'aspect préservé. Utiliser ce champ dans les vues formulaires ou dans certaines vues kanban."
#. module: golem_member
#: selection:golem.member.analysis.wizard,service_user:0
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_member_id
msgid "Member"
msgstr "Usager"
#. module: golem_member
#: code:addons/golem_member/wizard/golem_member_analysis_wizard.py:110
#: code:addons/golem_member/wizard/golem_member_analysis_wizard.py:120
#, python-format
msgid "Member Analysis"
msgstr "Analyse des usagers"
@ -1002,7 +998,7 @@ msgstr "NIC"
#: model:ir.model.fields,field_description:golem_member.field_golem_member_age_range_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_analysis_wizard_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4682
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4229
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_name
msgid "Name"
@ -1016,8 +1012,8 @@ msgid "Nationality"
msgstr "Nationalité"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:405
#: code:addons/golem_member/models/golem_member.py:408
#: code:addons/golem_member/models/golem_member.py:392
#: code:addons/golem_member/models/golem_member.py:395
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format
@ -1282,6 +1278,7 @@ msgid "Service Users"
msgstr "Usagers"
#. module: golem_member
#: selection:golem.member.analysis.wizard,service_user:0
#: model:ir.model.fields,field_description:golem_member.field_golem_member_analysis_member_id
#: model:ir.model.fields,field_description:golem_member.field_golem_member_member_id
#: model:ir.model.fields,field_description:golem_member.field_res_partner_member_id
@ -1307,6 +1304,11 @@ msgstr "Analyse des usagers"
msgid "Service users"
msgstr "Usagers"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_analysis_wizard_service_user
msgid "Service users or members"
msgstr "Usagers ou adhérents"
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_partner_share
msgid "Share Partner"
@ -1569,12 +1571,6 @@ msgstr "Montant total à payer au fournisseur."
msgid "Unsupported operator for age search"
msgstr "Opérateur de recherche non supporté pour l'âge"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:266
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr "Opérateur de recherche non supporté pour le filtre de saison par défaut"
#. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_type
msgid "Used to select automatically the right address according to the context in sales and purchases documents."
@ -1606,8 +1602,8 @@ msgid "Website of Partner or Company"
msgstr "Site Web pour les Partenaires ou les Sociétés"
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:405
#: code:addons/golem_member/models/golem_member.py:408
#: code:addons/golem_member/models/golem_member.py:392
#: code:addons/golem_member/models/golem_member.py:395
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format

View File

@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-21 16:01+0000\n"
"PO-Revision-Date: 2019-01-21 16:01+0000\n"
"POT-Creation-Date: 2020-01-16 15:46+0000\n"
"PO-Revision-Date: 2020-01-16 15:46+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -230,11 +230,6 @@ msgstr ""
msgid "By family quotient and area"
msgstr ""
#. module: golem_member
#: selection:golem.member.analysis.wizard,analyse_type:0
msgid "By family quotient slice and area"
msgstr ""
#. module: golem_member
#: selection:golem.member.analysis.wizard,analyse_type:0
#: model:ir.ui.view,arch_db:golem_member.golem_member_search
@ -621,7 +616,7 @@ msgid "GOLEM Members Tags"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:465
#: code:addons/golem_member/models/golem_member.py:452
#, python-format
msgid "GOLEM Members merge has not been implemented yet. Please only merge partners, not members, or delete GOLEM Members manually before merging."
msgstr ""
@ -917,12 +912,13 @@ msgid "Medium-sized image of this contact. It is automatically resized as a 128x
msgstr ""
#. module: golem_member
#: selection:golem.member.analysis.wizard,service_user:0
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_member_id
msgid "Member"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/wizard/golem_member_analysis_wizard.py:110
#: code:addons/golem_member/wizard/golem_member_analysis_wizard.py:120
#, python-format
msgid "Member Analysis"
msgstr ""
@ -996,7 +992,7 @@ msgstr ""
#: model:ir.model.fields,field_description:golem_member.field_golem_member_age_range_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_analysis_wizard_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_name
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4682
#: model:ir.model.fields,field_description:golem_member.field_golem_member_number_name_4229
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_name
#: model:ir.model.fields,field_description:golem_member.field_golem_partner_area_street_name
msgid "Name"
@ -1010,8 +1006,8 @@ msgid "Nationality"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:405
#: code:addons/golem_member/models/golem_member.py:408
#: code:addons/golem_member/models/golem_member.py:392
#: code:addons/golem_member/models/golem_member.py:395
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format
@ -1274,6 +1270,7 @@ msgid "Service Users"
msgstr ""
#. module: golem_member
#: selection:golem.member.analysis.wizard,service_user:0
#: model:ir.model.fields,field_description:golem_member.field_golem_member_analysis_member_id
#: model:ir.model.fields,field_description:golem_member.field_golem_member_member_id
#: model:ir.model.fields,field_description:golem_member.field_res_partner_member_id
@ -1299,6 +1296,11 @@ msgstr ""
msgid "Service users"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_analysis_wizard_service_user
msgid "Service users or members"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,field_description:golem_member.field_golem_member_partner_share
msgid "Share Partner"
@ -1561,12 +1563,6 @@ msgstr ""
msgid "Unsupported operator for age search"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:266
#, python-format
msgid "Unsupported operator for defautl season search"
msgstr ""
#. module: golem_member
#: model:ir.model.fields,help:golem_member.field_golem_member_type
msgid "Used to select automatically the right address according to the context in sales and purchases documents."
@ -1598,8 +1594,8 @@ msgid "Website of Partner or Company"
msgstr ""
#. module: golem_member
#: code:addons/golem_member/models/golem_member.py:405
#: code:addons/golem_member/models/golem_member.py:408
#: code:addons/golem_member/models/golem_member.py:392
#: code:addons/golem_member/models/golem_member.py:395
#: selection:golem.member.numberconfig,is_automatic:0
#: selection:golem.member.numberconfig,is_per_season:0
#, python-format

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2019-2020 Fabien Bourgeois <fabien@yaltik.com>
# Copyright 2019 Youssef El Ouahby <youssef@yaltik.com>
#
# This program is free software: you can redistribute it and/or modify
@ -46,6 +46,9 @@ class GolemMemberAnalysis(models.TransientModel):
('now', 'Now')], required=True,
default='season_start', string='Age')
category_id = fields.Many2one('res.partner.category', ondelete='cascade')
service_user = fields.Selection([('user', 'Service user'),
('member', 'Member')], default='user',
string='Service users or members')
@api.multi
@ -82,8 +85,15 @@ class GolemMemberAnalysis(models.TransientModel):
def get_members(self):
""" Returns members """
self.ensure_one()
if self[0].service_user == 'user':
return self.env['golem.member'].search([]).filtered(
lambda m: self[0].season_id.id in m.season_ids.ids)
membership_ids = self[0].season_id.membership_ids.mapped('product_variant_id')
membership_set = set(membership_ids.ids)
return self.env['golem.member'].search([]).filtered(
lambda m: self[0].season_id.id in m.season_ids.ids)
lambda m: (self[0].season_id.id in m.season_ids.ids and
set(m.member_lines.mapped('membership_id.id')) & membership_set)
)
@api.multi

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2019-2020 Fabien Bourgeois <fabien@yaltik.com>
Copyright 2019 Youssef El Ouahby <youssef@yaltik.com>
This program is free software: you can redistribute it and/or modify
@ -40,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="season_end" readonly="1"/>
</group>
<group>
<field name="service_user" widget="radio" />
<field name="analyse_type" widget="radio"/>
<field name="age_computing" widget="radio"/>
</group>