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

Merge branch '14-RV-Pappers' into '14.0'

Ajout d'un lien vers le site pappers

See merge request lefilament/cgscop/cgscop_partner!35
parents 8ccf3a66 fba7a42b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -276,6 +276,7 @@ class ScopPartner(models.Model):
string="SIRET formaté", compute="_compute_formatted_siret"
)
siren = fields.Char(string="SIREN", size=11, compute="_compute_siren")
pappers_url = fields.Char(string="URL Pappers", compute="_compute_siren", store=False)
capital = fields.Integer("Capital (en €)")
first_closeout = fields.Date("1er bilan en coop")
closeout_month = fields.Selection(
......@@ -593,6 +594,13 @@ class ScopPartner(models.Model):
"url": self.instagram,
}
def open_pappers(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.pappers_url,
}
def remove_director(self):
self.write({"mandate_id": False})
return {"type": "ir.actions.act_window_close"}
......@@ -856,8 +864,10 @@ class ScopPartner(models.Model):
+ " "
+ partner.siret[6:9]
)
partner.pappers_url = ("https://www.pappers.fr/entreprise/" + partner.siret[:9])
else:
partner.siren = None
partner.pappers_url = None
def _compute_formatted_siret(self):
for partner in self:
......
......@@ -642,6 +642,7 @@
>
<field name="is_cooperative" invisible="1" />
<field name="write_date" invisible="1" />
<field name="pappers_url" invisible="1" />
<h1>
<field
name="name"
......@@ -650,6 +651,14 @@
placeholder="Raison Sociale"
attrs="{'readonly': [('write_date', '!=', False), ('project_status', '=', '6_suivi'), ('is_cooperative', '=', True)]}"
/>
<button style="margin: -50px 0px 0px"
string=""
class="btn-cgscop oe_read_only"
name="open_pappers"
type="object"
icon="fa-info-circle"
attrs="{'invisible':[('pappers_url','=',False)]}"
/>
</h1>
<div class="oe_bloc_cgscop">
<div class="o_row d-flex">
......
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