diff --git a/i18n/fr.po b/i18n/fr.po index 73c4f2f88d427063ac8e3e9a7046c55661bfadab..df7929722de51137116923c4af8fdc2a9ba5910b 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -2,6 +2,7 @@ # This file contains the translation of the following modules: # * base_geolocalize # * contacts +# * web # msgid "" msgstr "" @@ -25,3 +26,10 @@ msgstr "Personnes" #: model_terms:ir.ui.view,arch_db:base_geolocalize.view_crm_partner_geo_form msgid "Partner Assignment" msgstr "Géolocalisation" + +#. module: web +#: code:addons/web/static/src/xml/base.xml:0 +#: code:addons/web/static/src/xml/base.xml:0 +#, python-format +msgid "Copy Text" +msgstr "Copier" \ No newline at end of file diff --git a/models/res_partner.py b/models/res_partner.py index 277693a49812a1b30d555d8c3fdbae72231549aa..903ff1b47a484529baf69a7d1f0fc77bea26f265 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -80,7 +80,8 @@ class ScopPartner(models.Model): string="Statut projet", index=True, ) - name = fields.Char(index=True, tracking=True) + name = fields.Char(index=True, tracking=True, string="Dénomination Sociale") + nickname = fields.Char(string="Dénomination interne") cooperative_form_id = fields.Many2one( "res.partner.cooperative.form", string="Cooperative form", @@ -150,6 +151,13 @@ class ScopPartner(models.Model): default=_default_country, tracking=True, ) + # Adresse postale + postal_street = fields.Char("Adresse postale - Rue", tracking=1) + postal_street2 = fields.Char("Adresse postale - Rue 2", tracking=1) + postal_street3 = fields.Char("Adresse postale - Rue 3", tracking=1) + postal_zip = fields.Char("Adresse postale - CP", tracking=1) + postal_city = fields.Char("Adresse postale - Ville", tracking=1) + postal_cedex = fields.Char("Adresse postale - Cedex", tracking=1) phone = fields.Char("Téléphone 1", tracking=True) mobile = fields.Char("Téléphone 2", tracking=True) email = fields.Char("eMail administratif", tracking=True) @@ -287,7 +295,7 @@ class ScopPartner(models.Model): ondelete="restrict", ) other_certification = fields.Char(string="Autre agrément", required=False) - siret = fields.Char(string="SIRET", size=14, index=True, tracking=True, copy=False) + siret = fields.Char(string="SIRET du siège", size=14, index=True, tracking=True, copy=False) formatted_siret = fields.Char( string="SIRET formaté", compute="_compute_formatted_siret" ) @@ -723,58 +731,23 @@ class ScopPartner(models.Model): % self.name ) - # ------------------------------------------------------ - # Actions - # ------------------------------------------------------ - def open_facebook(self): - self.ensure_one() - return { - "type": "ir.actions.act_url", - "url": self.facebook, - } - - def open_linkedin(self): - self.ensure_one() - return { - "type": "ir.actions.act_url", - "url": self.linkedin, - } - - def open_twitter(self): - self.ensure_one() - return { - "type": "ir.actions.act_url", - "url": self.twitter, - } - - def open_instagram(self): - self.ensure_one() - return { - "type": "ir.actions.act_url", - "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"} - # ------------------------------------------------------ # Onchange # ------------------------------------------------------ - # TODO: à vérifier # Hack pour la création de contacts depuis la fiche organisme @api.onchange("parent_id_onchange") def _onchange_parent_id_onchange(self): self.parent_id = self.parent_id_onchange + @api.onchange("nickname") + def onchange_nickname(self): + if ( + self.is_cooperative + and self.project_status in ["1_information", "2_pre-diagnostic", "3_accompagnement"] + ): + self.lastname = self.nickname + # TODO: à vérifier @api.onchange("parent_id") def _onchange_parent_id(self): @@ -909,9 +882,13 @@ class ScopPartner(models.Model): ): args = args or [] domain = [ + "|", + "|", "|", ("name", operator, name), ("member_number", "ilike", name), + ("nickname", operator, name), + ("nickname", operator, name), ] return self._search(domain + args, limit=limit, access_rights_uid=name_get_uid) @@ -1392,6 +1369,45 @@ class ScopPartner(models.Model): # ------------------------------------------------------ # Button & Action # ------------------------------------------------------ + def open_facebook(self): + self.ensure_one() + return { + "type": "ir.actions.act_url", + "url": self.facebook, + } + + def open_linkedin(self): + self.ensure_one() + return { + "type": "ir.actions.act_url", + "url": self.linkedin, + } + + def open_twitter(self): + self.ensure_one() + return { + "type": "ir.actions.act_url", + "url": self.twitter, + } + + def open_instagram(self): + self.ensure_one() + return { + "type": "ir.actions.act_url", + "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"} + def partner_archive(self): self.active = False @@ -1705,6 +1721,16 @@ class ScopPartner(models.Model): address = [f for f in address_fields if f] return "\n".join(address) if address else "" + def get_postal_address(self): + self.ensure_one() + street_address_fields = [self.postal_street, self.postal_street2, self.postal_street3] + street_address_list = list(filter(bool, street_address_fields)) + city_address_list = list(filter(bool, self.postal_zip, self.postal_city)) + street_address = "\n".join(street_address_list) if street_address_list else "" + city_address = " ".join(city_address_list) if city_address_list else "" + cedex = f" CEDEX {self.postal_cedex}" if self.postal_cedex else "" + return f"{street_address}\n{city_address}{cedex}" + # ------------------------------------------------------ # CRON function # ------------------------------------------------------ diff --git a/static/src/css/style.css b/static/src/css/style.css index 3498ac619c77ecbe1fb0d362ffb05b83e4010764..58b1ad726c96e0b94476154c2cfc8cc6d52bfa75 100644 --- a/static/src/css/style.css +++ b/static/src/css/style.css @@ -2,13 +2,30 @@ .o_form_view .oe_button_box + .oe_avatar + .oe_title.oe_title_cgscop { width: 60%; } - -.oe_bloc_cgscop { - width: 600px; +/* Titre */ +.oe_title_cgscop h1 { + margin-left: -16px; + margin-right: -16px; +} +.oe_title_cgscop_h1 { + padding-left: 16px; + padding-right: 16px; + padding-top: 5px; + background-color: #eee; + max-width: 50%; +} +.oe_title_cgscop_h1 > span.o_field_widget { + margin-bottom: 0px; +} +@media screen and (max-width: 768px) { + .oe_title_cgscop_h1 { + max-width: 100%; + } } +/* Sous-Titre */ .oe_bloc_cgscop .o_field_widget.o_field_many2one { - width: 278px !important; + min-width: 280px !important; } .btn.btn-cgscop { @@ -30,3 +47,11 @@ .o_activity_view .o_res_name_cell:hover { color: #008784 !important; } + +/* Separator de la fiche scop */ +.scop_general_infos .o_horizontal_separator { + text-transform: uppercase; + box-shadow: 0 1px 0 #e6e6e6; + font-size: 1.2rem; + margin-bottom: 16px; +} diff --git a/views/res_partner.xml b/views/res_partner.xml index a82f32fbb6d5fd07681a8d16006599f5c3805f9a..c6a6fd0231247e00e9c207d88aff8913ab904670 100644 --- a/views/res_partner.xml +++ b/views/res_partner.xml @@ -97,9 +97,6 @@ name="attrs" >{'invisible': [('is_company','=', True)]}</attribute> </field> - <xpath expr="//div[hasclass('oe_title')]" position="attributes"> - <attribute name="class">oe_title oe_title_cgscop</attribute> - </xpath> <field name="company_type" position="attributes"> <attribute name="readonly">True</attribute> <attribute name="class" /> @@ -601,13 +598,6 @@ attrs="{'invisible': [('project_status', '!=', '4_suivi')]}" groups="cgscop_partner.group_add_period" /> - <button - string="Changement d'adresse" - type="action" - name="%(cgscop_partner.scop_address_wizard_action)d" - class="oe_highlight" - attrs="{'invisible': [('project_status', '!=', '4_suivi')]}" - /> <button string="Nouvelle période d'adhésion" type="action" @@ -665,36 +655,24 @@ <!-- Titre, logo & status --> <!-- Partie statique avant Notebook --> <xpath expr="//form/sheet/group" position="before"> - <div attrs="{'invisible': [('is_cooperative', '!=', True)]}"> + <!-- Coop décédée --> + <div attrs="{'invisible': ['|', ('is_cooperative', '!=', True), ('dissolution_reason_id','=', False)]}"> <h3> - <span - class="o_field_header o_field_widget o_readonly_modifier" - attrs="{'invisible':[('dissolution_reason_id','=', False)]}" - >Décédée le</span> - <field - name="dissolution_date" - readonly="1" - attrs="{'invisible':[('dissolution_reason_id','=', False)]}" - /> + <span>Décédée le </span> + <field name="dissolution_date" readonly="1" /> </h3> <h3> - <span - class="o_field_header o_field_widget o_readonly_modifier" - attrs="{'invisible':[('dissolution_reason_id','=', False)]}" - >Raison :</span> - <field - options="{'no_open': True}" - name="dissolution_reason_id" - readonly="1" - attrs="{'invisible':[('dissolution_reason_id','=', False)]}" - /> + <span class="o_field_header o_field_widget o_readonly_modifier">Raison :</span> + <field options="{'no_open': True}" name="dissolution_reason_id" readonly="1"/> </h3> - <p attrs="{'invisible':[('membership_status','!=', 'out')]}"> - <span class="badge badge-danger"> - Radié - </span> - </p> </div> + <!-- Coop radiée --> + <p attrs="{'invisible':[('membership_status','!=', 'out')]}"> + <span class="badge badge-danger"> + Radié + </span> + </p> + <!-- Dénomination sociale --> <div class="oe_title oe_title_cgscop" attrs="{'invisible': [('is_cooperative', '!=', True)]}" @@ -702,38 +680,44 @@ <field name="is_cooperative" invisible="1" /> <field name="write_date" invisible="1" /> <field name="pappers_url" invisible="1" /> - <h1> - <field - name="name" - default_focus="1" - required="1" - placeholder="Raison Sociale" - attrs="{'readonly': [('project_status', '=', '4_suivi'), ('is_cooperative', '=', True)]}" - /> + <h1 class="mb-2"> + <div class="oe_title_cgscop_h1"> + <field + name="name" + placeholder="Dénomination Sociale" + attrs="{'readonly': [('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)]}" - /> + style="position: absolute;" + class="oe_read_only" + name="open_pappers" + type="object" + icon="fa-info-circle" + attrs="{'invisible':[('pappers_url','=',False)]}" + /> + </div> </h1> + <label for="nickname" /> + <h2 class="mb-1"> + <field + name="nickname" + placeholder="Dénomination Usuelle" + attrs="{'readonly': [('is_cooperative', '=', False)], 'required': [('is_cooperative', '=', True)], 'invisible': [('is_cooperative', '!=', True)]}" + /> + </h2> <div class="oe_bloc_cgscop"> - <div class="o_row d-flex"> + <div> <h3> <field - class="o_field_header" + class="oe_inline" name="cooperative_form_id" attrs="{'readonly': [('project_status', '=', '4_suivi')], 'required': [('project_status','in',('2_pre-diagnostic', '3_accompagnement', '4_suivi'))]}" options="{'no_open': True, 'no_create': True}" placeholder="Forme Coopérative" /> - </h3> - <span> </span> - <h3> + &nbsp; <field + class="oe_inline" options="{'no_open': True, 'no_create': True}" domain="[('is_coop', '=', True)]" name="partner_company_type_id" @@ -742,7 +726,7 @@ /> </h3> </div> - <div class="o_row d-flex "> + <div> <h3> <field name="member_number_int" @@ -752,12 +736,12 @@ /> </h3> </div> - <div class="o_row d-flex "> + <div> <h3> <span name="cae" - class="o_field_widget o_readonly_modifier o_field_header oe_read_only" - attrs="{'invisible':[('cae','=',False)]}" + class="oe_read_only" + attrs="{'invisible':[('cae','=', False)]}" >CAE</span> <label for="cae" @@ -767,6 +751,7 @@ <field name="cae" class="oe_edit_only" + widget="boolean_toggle" attrs="{'readonly': [('project_status', '=', '4_suivi')]}" /> </h3> @@ -780,10 +765,11 @@ <xpath expr="//form/sheet/group" position="after"> <group col="3" - string="Informations Générales" name="scop_general_infos" + class="scop_general_infos" attrs="{'invisible': [('is_cooperative','=', False)]}" > + <!-- Contact --> <group string="Contact"> <field name="sigle" @@ -856,6 +842,38 @@ modifiers="{'readonly':[['project_status', '=', '4_suivi']]}" /> </div> + <label for='postal_street' string="Adresse Postale" class="my-2" /> + <!-- Adresse postale --> + <div class="o_address_format mt-2"> + <field + name="postal_street" + class="o_address_street" + placeholder="Rue..." + /> + <field + name="postal_street2" + class="o_address_street" + placeholder="Rue 2..." + /> + <field + name="postal_street3" + class="o_address_street" + placeholder="Rue 3..." + /> + <field + name="postal_zip" + placeholder="Code postal" + class="o_address_city" + /> + <field + name="postal_city" + placeholder="Ville" + /> + <field + name="postal_cedex" + placeholder="Cedex" + /> + </div> <field name="zip_departement" string="N° de département" /> <field name="region" /> <field @@ -972,8 +990,8 @@ attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic'))]}" /> </div> - </group> + <!-- Suivi UR --> <group string="Suivi UR"> <field name="ur_id" @@ -1063,6 +1081,7 @@ widget="many2many_tags" /> </group> + <!-- Informations Activité --> <group string="Informations Activité"> <field name="is_administrative" invisible="1" /> <field @@ -1093,32 +1112,19 @@ /> <field name="registration_date" - attrs="{ - 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))], - 'readonly': [('project_status', '=', '4_suivi'), ('is_administrative', '!=', True)] - }" - /> - <field - name="social_object" - attrs="{'required': [('is_cooperative', '=', True), ('project_status','in',('2_pre-diagnostic', '3_accompagnement', '4_suivi'))],}" + attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))], 'readonly': [('project_status', '=', '4_suivi'), ('is_administrative', '!=', True)]}" /> <field name="naf_id" - attrs="{ - 'readonly': [('project_status', '=', '4_suivi')], - 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" + attrs="{'readonly': [('project_status', '=', '4_suivi')], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" options="{'no_open': True, 'no_create': True}" /> + <field name="secteur_id" /> <field - name="certification_ids" - widget="many2many_tags" - options="{'color_field': 'color', 'no_create': True}" - attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" - /> - <field - name="other_certification" - attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" + name="activity_desc" + help="L'activité renseignée ici apparaitra sur l'annuaire des coopératives." /> + <field name="activity_customers" /> <label for='siret' string="SIRET" @@ -1144,23 +1150,16 @@ <field name="formatted_siret" class="oe_read_only" + widget="CopyClipboardChar" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" /> </div> <field name="siren" readonly="1" + widget="CopyClipboardChar" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" /> - <field - name="vat" - attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" - /> - <field - name="capital" - attrs="{'required':[('project_status','in',('4_suivi'))], 'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))],}" - widget="monetary" - /> <field name="first_closeout" attrs="{ @@ -1180,23 +1179,10 @@ name="seed_end" attrs="{'invisible': [('is_seed_scop', '!=', True)], 'required':[('project_status','=','4_suivi'),('is_seed_scop', '=', True)]}" /> - <field - name="is_incubated" - attrs="{'invisible': [('project_status', '=', '1_information')]}" - /> - <field - name="incubator_id" - attrs="{'invisible': [('is_incubated', '!=', True)]}" - options="{'no_create': True}" - /> <field name="staff_last" attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}" /> - <field - name="staff_last_date" - attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}" - /> </group> </group> </xpath> @@ -1470,6 +1456,54 @@ </kanban> </field> </page> + <page + name='scop_other_infos' + string="Infos Coopérative" + attrs="{'invisible': [('is_cooperative', '!=', True)]}" + > + <group> + <group> + <field + name="capital" + attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))],}" + widget="monetary" + /> + <field + name="vat" + attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" + /> + <field + name="certification_ids" + widget="many2many_tags" + options="{'color_field': 'color', 'no_create': True}" + attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" + /> + <field + name="other_certification" + attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic',))]}" + /> + <field + name="staff_last_date" + attrs="{'invisible': [('project_status', 'in', ('1_information', '2_pre-diagnostic', '3_accompagnement'))]}" + /> + <field + name="is_incubated" + attrs="{'invisible': [('project_status', '=', '1_information')]}" + /> + <field + name="incubator_id" + attrs="{'invisible': [('is_incubated', '!=', True)]}" + options="{'no_create': True}" + /> + </group> + <group> + <field + name="social_object" + readonly="1" + /> + </group> + </group> + </page> <page name='scop_revision' string="Révisions" @@ -1739,13 +1773,9 @@ attrs="{'invisible': ['|', ('is_cooperative', '!=', True), ('project_status', 'not in', ['4_suivi', '6_decede'])]}" > <group string="Annuaire"> - <field name="secteur_id" /> - <field name="activity_desc" /> - <field name="activity_customers" /> </group> </page> </xpath> - </field> </record> diff --git a/views/res_partner_cooperative.xml b/views/res_partner_cooperative.xml index d7ea174e401bbf4056b844a34a7b93c0cda2b07a..bebbe4ebe5ed7bf181cfedf7ad0e34f513d6558f 100644 --- a/views/res_partner_cooperative.xml +++ b/views/res_partner_cooperative.xml @@ -10,7 +10,7 @@ <search string="Recherche Organisme"> <field name="name" - filter_domain="['|', '|', '|', ('display_name', 'ilike', self), ('ref', '=', self), ('email', 'ilike', self), ('member_number','=like',self)]" + filter_domain="['|', '|', '|', '|', ('display_name', 'ilike', self), ('ref', '=', self), ('email', 'ilike', self), ('member_number','=like',self), ('nickname', 'ilike', self)]" /> <field name="phone" @@ -190,7 +190,7 @@ <field name="model">res.partner</field> <field name="arch" type="xml"> <tree string="Prospects"> - <field name="display_name" string="Raison Sociale" /> + <field name="display_name" string="Dénomination Sociale" /> <field name="cooperative_form_id" /> <field name="project_status" /> <field name="zip" /> @@ -211,7 +211,7 @@ <field name="model">res.partner</field> <field name="arch" type="xml"> <tree string="Cooperatives"> - <field name="display_name" string="Raison Sociale" /> + <field name="display_name" string="Dénomination Sociale" /> <field name="member_number_int" /> <field name="cooperative_form_id" /> <field name="naf_id" /> @@ -247,7 +247,7 @@ <field name="model">res.partner</field> <field name="arch" type="xml"> <tree string="Organismes" create="0"> - <field name="display_name" string="Raison Sociale" /> + <field name="display_name" string="Dénomination Sociale" /> <field name="member_number_int" /> <field name="cooperative_form_id" /> <field name="naf_id" />