[XML][PYTHON][TRANS] +partner county_code field
authorLudovic CHEVALIER <ludovic@beurresarrasin.net>
Tue, 22 Feb 2022 16:48:50 +0000 (17:48 +0100)
committerLudovic CHEVALIER <ludovic@beurresarrasin.net>
Tue, 22 Feb 2022 16:48:50 +0000 (17:48 +0100)
i18n/fr.po
i18n/lhc.pot
lhc.py
view/res_partner.xml

index 2381163..e194b98 100644 (file)
@@ -6,15 +6,20 @@ msgid ""
 msgstr ""
 "Project-Id-Version: OpenERP Server 6.0.4\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-05-25 14:02+0000\n"
-"PO-Revision-Date: 2020-05-25 16:04+0200\n"
+"POT-Creation-Date: 2022-02-22 16:38+0000\n"
+"PO-Revision-Date: 2022-02-22 17:40+0100\n"
 "Last-Translator: Ludovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>\n"
 "Language-Team: \n"
 "Language: fr\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.3.1\n"
+"X-Generator: Poedit 3.0.1\n"
+
+#. module: lhc
+#: field:res.partner,county_code:0
+msgid "County code"
+msgstr "Code du département"
 
 #. module: lhc
 #: view:account.invoice:0
@@ -31,15 +36,6 @@ msgstr "Toutes les structures membres"
 msgid "Welcome kit sent"
 msgstr "Kit de bienvenue envoyé"
 
-#. module: lhc
-#: help:res.partner,usual_contact:0
-msgid ""
-"This contact is a usual contact for L'Heureux Cyclage employees. This field "
-"can be used to discriminated contacts for differents usages."
-msgstr ""
-"Ce contact est un contact fréquent pour les employé·e·s de L'Heureux "
-"Cyclage. Ce champ permet de discriminer des contacts pour différents usages."
-
 #. module: lhc
 #: model:ir.model,name:lhc.model_res_users
 msgid "res.users"
@@ -95,12 +91,6 @@ msgstr "Source de financement principale"
 msgid "Event Registration"
 msgstr "Inscriptions"
 
-#. module: lhc
-#: selection:event.registration,position:0
-#: model:res.groups,name:lhc.group_volunteer
-msgid "Volunteer"
-msgstr "Bénévole"
-
 #. module: lhc
 #: model:ir.module.category,description:lhc.module_category_lhc
 msgid "Customize OpenERP for L'Heureux Cyclage usages."
@@ -173,6 +163,21 @@ msgstr "Statut"
 msgid "Male"
 msgstr "Homme"
 
+#. module: lhc
+#: help:res.partner,usual_contact:0
+#, fuzzy
+#| msgid ""
+#| "This contact is a usual contact for L'Heureux Cyclage employees. This "
+#| "field can be used to discriminated contacts for differents usages."
+msgid ""
+"This contact is a usual contact for L'Heureux Cyclage\n"
+"            employees. This field can be used to discriminated contacts "
+"for\n"
+"            differents usages."
+msgstr ""
+"Ce contact est un contact fréquent pour les employé·e·s de L'Heureux "
+"Cyclage. Ce champ permet de discriminer des contacts pour différents usages."
+
 #. module: lhc
 #: field:event.registration,fundings_others:0
 msgid "Others fundings origins"
@@ -198,6 +203,11 @@ msgstr "Individuel·le"
 msgid "Event"
 msgstr "Événement"
 
+#. module: lhc
+#: view:res.partner:0
+msgid "County"
+msgstr "Département"
+
 #. module: lhc
 #: model:ir.ui.menu,name:lhc.menu_rencontres_2016
 msgid "Rencontres 2016"
@@ -234,25 +244,27 @@ msgid "Move number"
 msgstr "Numéro de pièce comptable"
 
 #. module: lhc
-#: model:ir.model,name:lhc.model_sale_order
-msgid "Sales Order"
-msgstr "Devis"
+#: selection:event.registration,position:0
+#: model:res.groups,name:lhc.group_volunteer
+msgid "Volunteer"
+msgstr "Bénévole"
 
 #. module: lhc
 #: view:res.partner:0
 msgid "All Individual Members"
 msgstr "Tou·tes les membres individuel·les"
 
-#. module: lhc
-#: model:ir.model,name:lhc.model_sale_order_line
-msgid "Sales Order Line"
-msgstr "Ligne de devis"
-
 #. module: lhc
 #: view:res.partner:0
 msgid "Invoiced/Paid/Free and Companies"
 msgstr "Structures facturé·es/payé·es/libres"
 
+#~ msgid "Sales Order"
+#~ msgstr "Devis"
+
+#~ msgid "Sales Order Line"
+#~ msgstr "Ligne de devis"
+
 #~ msgid "Ateliers anciens membres ou non membres"
 #~ msgstr "Ateliers anciens membres ou non membres"
 
index fd16e2a..d2d6bb6 100644 (file)
@@ -6,8 +6,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: OpenERP Server 7.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2020-05-25 14:02+0000\n"
-"PO-Revision-Date: 2020-05-25 14:02+0000\n"
+"POT-Creation-Date: 2022-02-22 16:38+0000\n"
+"PO-Revision-Date: 2022-02-22 16:38+0000\n"
 "Last-Translator: <>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -15,6 +15,11 @@ msgstr ""
 "Content-Transfer-Encoding: \n"
 "Plural-Forms: \n"
 
+#. module: lhc
+#: field:res.partner,county_code:0
+msgid "County code"
+msgstr ""
+
 #. module: lhc
 #: view:account.invoice:0
 msgid "Unsent"
@@ -30,11 +35,6 @@ msgstr ""
 msgid "Welcome kit sent"
 msgstr ""
 
-#. module: lhc
-#: help:res.partner,usual_contact:0
-msgid "This contact is a usual contact for L'Heureux Cyclage employees. This field can be used to discriminated contacts for differents usages."
-msgstr ""
-
 #. module: lhc
 #: model:ir.model,name:lhc.model_res_users
 msgid "res.users"
@@ -90,12 +90,6 @@ msgstr ""
 msgid "Event Registration"
 msgstr ""
 
-#. module: lhc
-#: selection:event.registration,position:0
-#: model:res.groups,name:lhc.group_volunteer
-msgid "Volunteer"
-msgstr ""
-
 #. module: lhc
 #: model:ir.module.category,description:lhc.module_category_lhc
 msgid "Customize OpenERP for L'Heureux Cyclage usages."
@@ -168,6 +162,13 @@ msgstr ""
 msgid "Male"
 msgstr ""
 
+#. module: lhc
+#: help:res.partner,usual_contact:0
+msgid "This contact is a usual contact for L'Heureux Cyclage\n"
+"            employees. This field can be used to discriminated contacts for\n"
+"            differents usages."
+msgstr ""
+
 #. module: lhc
 #: field:event.registration,fundings_others:0
 msgid "Others fundings origins"
@@ -193,6 +194,11 @@ msgstr ""
 msgid "Event"
 msgstr ""
 
+#. module: lhc
+#: view:res.partner:0
+msgid "County"
+msgstr ""
+
 #. module: lhc
 #: model:ir.ui.menu,name:lhc.menu_rencontres_2016
 msgid "Rencontres 2016"
@@ -229,8 +235,9 @@ msgid "Move number"
 msgstr ""
 
 #. module: lhc
-#: model:ir.model,name:lhc.model_sale_order
-msgid "Sales Order"
+#: selection:event.registration,position:0
+#: model:res.groups,name:lhc.group_volunteer
+msgid "Volunteer"
 msgstr ""
 
 #. module: lhc
@@ -238,11 +245,6 @@ msgstr ""
 msgid "All Individual Members"
 msgstr ""
 
-#. module: lhc
-#: model:ir.model,name:lhc.model_sale_order_line
-msgid "Sales Order Line"
-msgstr ""
-
 #. module: lhc
 #: view:res.partner:0
 msgid "Invoiced/Paid/Free and Companies"
diff --git a/lhc.py b/lhc.py
index 528034f..de5776a 100644 (file)
--- a/lhc.py
+++ b/lhc.py
@@ -30,6 +30,16 @@ import openerp.addons.decimal_precision as dp
 class res_partner(orm.Model):
     _inherit = 'res.partner'
 
+    def _get_county(self, cr, uid, ids, name, args, context=None):
+        """docstring for _county_get_fnc"""
+        res = {}
+        for obj in self.browse(cr, uid, ids, context=context):
+            if obj.zip:
+                res[obj.id] = obj.zip[0:2]
+            else:
+                res[obj.id] = ''
+        return res
+
     _columns = {
         'usual_contact': fields.boolean(
             'Usual contact',
@@ -38,6 +48,17 @@ class res_partner(orm.Model):
             differents usages."""
         ),
         'kit_sent': fields.boolean('Welcome kit sent'),
+        'county_code': fields.function(
+            _get_county,
+            method=True,
+            string='County code',
+            type='char',
+            size=2,
+            store={
+                'res.partner': (
+                    lambda self, cr, uid, ids, c={}: ids,
+                    ['zip'], 10)},
+        ),
     }
 
     _defaults = {
index 1fb6310..fe46144 100644 (file)
             <field name="model">res.partner</field>
             <field name="inherit_id" ref="base.view_res_partner_filter"/>
             <field name="arch" type="xml">
-            <xpath expr="//field[@name='category_id']" position="before">
-                <field name="city"/>
-            </xpath>
+                <xpath expr="//field[@name='category_id']" position="before">
+                    <field name="city"/>
+                </xpath>
+            </field>
+        </record>
+        <record id="view_res_partner_filter_form" model="ir.ui.view">
+            <field name="name">res.partner.filter</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_res_partner_filter"/>
+            <field name="arch" type="xml">
+                <xpath expr="//group[@string='Group By...']" position="inside">
+                    <filter string="County" context="{'group_by': 'county_code'}" groups="lhc.group_employee_lhc,base.group_no_one"/>
+                </xpath>
+            </field>
+        </record>
+        <record id="view_res_partner_member_filter" model="ir.ui.view">
+            <field name="name">res.partner.filter</field>
+            <field name="model">res.partner</field>
+            <field name="type">search</field>
+            <field name="inherit_id" ref="membership.view_res_partner_member_filter"/>
+            <field name="arch" type="xml">
+                <xpath expr="//group[@string='Group By...']" position="inside">
+                    <filter string="County" context="{'group_by': 'county_code'}" groups="lhc.group_employee_lhc,base.group_no_one"/>
+                </xpath>
             </field>
         </record>
     </data>