Skip to content
Extraits de code Groupes Projets
Valider a684912d rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[update] add registration wizard & cancel membership process

parent 0b230631
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
"wizard/scop_membership_liasse_wizard.xml", "wizard/scop_membership_liasse_wizard.xml",
"wizard/scop_membership_staff_wizard.xml", "wizard/scop_membership_staff_wizard.xml",
"wizard/scop_membership_submit_wizard.xml", "wizard/scop_membership_submit_wizard.xml",
"wizard/scop_registration_wizard.xml",
# views # views
"views/assets.xml", "views/assets.xml",
"views/res_config_settings.xml", "views/res_config_settings.xml",
......
...@@ -161,6 +161,10 @@ class ScopPartner(models.Model): ...@@ -161,6 +161,10 @@ class ScopPartner(models.Model):
"target": "new", "target": "new",
} }
def scop_cancel_membership(self):
for partner in self:
partner.update({"member_status": "not_member"})
# ------------------------------------------------------ # ------------------------------------------------------
# Business methods # Business methods
# ------------------------------------------------------ # ------------------------------------------------------
......
...@@ -57,6 +57,19 @@ ...@@ -57,6 +57,19 @@
attrs="{'invisible': [('membership_status', '!=', 'soumis_cg')]}" attrs="{'invisible': [('membership_status', '!=', 'soumis_cg')]}"
groups="cgscop_partner.group_cg_administrator" groups="cgscop_partner.group_cg_administrator"
/> />
<button
string="Projet d'adhésion abandonné"
type="object"
name="scop_cancel_membership"
attrs="{'invisible': [('membership_status', '!=', 'adhesion')]}"
confirm="Valider l'abandon du projet d'adhésion ?"
/>
<button
string="Immatriculation"
type="object"
name="scop_cancel_membership"
attrs="{'invisible': [('is_registration_in_progress', '!=', True)]}"
/>
</xpath> </xpath>
<!-- Alert pour les données du process d'adhésion --> <!-- Alert pour les données du process d'adhésion -->
......
...@@ -5,3 +5,4 @@ from . import scop_compulsory_fields_suivi_wizard ...@@ -5,3 +5,4 @@ from . import scop_compulsory_fields_suivi_wizard
from . import scop_membership_liasse_wizard from . import scop_membership_liasse_wizard
from . import scop_membership_staff_wizard from . import scop_membership_staff_wizard
from . import scop_membership_submit_wizard from . import scop_membership_submit_wizard
from . import scop_registration_wizard
# © 2021 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, fields, models
from odoo.exceptions import UserError
class ScopCompulsoryFieldsSuiviWizard(models.TransientModel):
_name = "scop.compulsory.fields.suivi.wizard"
_description = "Wizard: Confirmer les champs obligatoires pour passage en suivi "
partner_id = fields.Many2one(
comodel_name="res.partner", string="Coop", required=True
)
naf_id = fields.Many2one(related="partner_id.naf_id", readonly=False)
registration_date = fields.Date(
related="partner_id.registration_date", readonly=False
)
siret = fields.Char(related="partner_id.siret", readonly=False)
# ------------------------------------------------------
# Actions / Buttons
# ------------------------------------------------------
def confirm_registration(self):
"""
Passe la coop en statut "4_suivi"
"""
self.partner_id.sudo()._create_period(self.partner_id)
return {"type": "ir.actions.act_window_close"}
<?xml version="1.0" ?>
<!-- Copyright 2021 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<record
model="ir.ui.view"
id="scop_registration_wizard_form"
>
<field name="name">scop.registration.wizard.form</field>
<field name="model">scop.registration.wizard</field>
<field name="arch" type="xml">
<form string="Immatriculation">
<group>
<field
name="partner_id"
readonly="1"
options="{'no_create': True, 'no_edit': True}"
/>
<field name="registration_date" required="1" />
<field name="siret" required="1" />
<field name="naf_id" required="1" />
</group>
<footer>
<button
name="confirm_registration"
type="object"
string="Valider"
class="oe_highlight"
/>
<button special="cancel" string="Annuler" />
</footer>
</form>
</field>
</record>
</data>
</odoo>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter