[MIG] partner_geolocalize_usability: Migration to 16.0

This commit is contained in:
Boris Gallet
2024-03-06 09:58:04 +01:00
committed by Stéphan Sainléger
parent faf5507f26
commit e8e08c466e
10 changed files with 225 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
*.*~
*pyc

View File

@@ -0,0 +1,56 @@
=============================
partner_geolocalize_usability
=============================
Brings several enhancements on geolocalize functionnalities
Installation
============
Use Odoo normal module installation procedure to install
``partner_geolocalize_usability``.
Description
===========
This module allows:
- to block or not the edition of partner_latitude and partner_longitude fields in partner form view.
- to massively trigger the geolocalize function
It also modify the partner form vieww for a better understanding of the geolocation data.
Configuration
=============
No configuration needed.
Known issues / Roadmap
======================
None yet.
Bug Tracker
===========
Bugs are tracked on `our issues website <https://github.com/elabore-coop/partner-tools/issues>`_. In case of
trouble, please check there if your issue has already been
reported. If you spotted it first, help us smashing it by providing a
detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Stéphan Sainléger
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
Maintainer
----------
This module is maintained by Elabore.

View File

@@ -0,0 +1,4 @@
from . import models
# from . import controllers
# from . import wizard

View File

@@ -0,0 +1,35 @@
# Copyright 2023 Stéphan Sainléger (Elabore)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "partner_geolocalize_usability",
"version": "16.0.1.0.0",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger",
"license": "AGPL-3",
"category": "Tools",
"summary": "Brings several enhancements on geolocalize functionnalities",
# any module necessary for this one to work correctly
"depends": [
"base",
"base_geolocalize"
],
"qweb": [],
"external_dependencies": {
"python": [],
},
# always loaded
"data": [
"views/res_partner.xml",
],
# only loaded in demonstration mode
"demo": [],
"js": [],
"css": [],
"installable": True,
# Install this module automatically if all dependency have been previously
# and independently installed. Used for synergetic or glue modules.
"auto_install": False,
"application": False,
}

View File

@@ -0,0 +1 @@
This directory should contain the *.po for Odoo translation.

View File

@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_geolocalize_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-12 13:48+0000\n"
"PO-Revision-Date: 2023-09-12 13:48+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_geolocalize_usability
#: model:ir.model,name:partner_geolocalize_usability.model_res_partner
msgid "Contact"
msgstr ""
#. module: partner_geolocalize_usability
#: model:ir.actions.server,name:partner_geolocalize_usability.geolocata_partner_action_server
#: model_terms:ir.ui.view,arch_db:partner_geolocalize_usability.partner_geolocalize_form_view
msgid "Geolocate"
msgstr "Géolocaliser"
#. module: partner_geolocalize_usability
#: model:ir.model.fields,field_description:partner_geolocalize_usability.field_res_partner__manual_geolocate
#: model:ir.model.fields,field_description:partner_geolocalize_usability.field_res_users__manual_geolocate
msgid "Geolocate yourself"
msgstr "Géolocaliser manuellement"
#. module: partner_geolocalize_usability
#: model_terms:ir.ui.view,arch_db:partner_geolocalize_usability.partner_geolocalize_form_view
msgid "Geolocation"
msgstr "Géolocalisation"

View File

@@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_geolocalize_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-12 13:50+0000\n"
"PO-Revision-Date: 2023-09-12 13:50+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: partner_geolocalize_usability
#: model:ir.model,name:partner_geolocalize_usability.model_res_partner
msgid "Contact"
msgstr ""
#. module: partner_geolocalize_usability
#: model:ir.actions.server,name:partner_geolocalize_usability.geolocata_partner_action_server
#: model_terms:ir.ui.view,arch_db:partner_geolocalize_usability.partner_geolocalize_form_view
msgid "Geolocate"
msgstr ""
#. module: partner_geolocalize_usability
#: model:ir.model.fields,field_description:partner_geolocalize_usability.field_res_partner__manual_geolocate
#: model:ir.model.fields,field_description:partner_geolocalize_usability.field_res_users__manual_geolocate
msgid "Geolocate yourself"
msgstr ""
#. module: partner_geolocalize_usability
#: model_terms:ir.ui.view,arch_db:partner_geolocalize_usability.partner_geolocalize_form_view
msgid "Geolocation"
msgstr ""

View File

@@ -0,0 +1,2 @@
from . import res_partner

View File

@@ -0,0 +1,11 @@
from odoo import models, fields, api
class ResPartner(models.Model):
_inherit = 'res.partner'
manual_geolocate = fields.Boolean('Geolocate yourself')
def geo_localize(self):
partners = self.filtered(lambda a: a.manual_geolocate == False)
return super(ResPartner, partners).geo_localize()

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="geolocata_partner_action_server" model="ir.actions.server">
<field name="name">Geolocate</field>
<field name="model_id" ref="model_res_partner" />
<field
name="binding_model_id" ref="model_res_partner" />
<field name="state">code</field>
<field name="code">records.geo_localize() </field>
</record>
<record model="ir.ui.view" id="partner_geolocalize_form_view">
<field name="name">partner.geolocalize.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name='priority'>99</field>
<field name="arch" type="xml">
<xpath expr="//page[@name='geo_location']" position="replace">
<page name="geolocalize" string="Geolocation">
<group colspan="2" col="2">
<separator string="Geolocation" colspan="2" />
<field name="manual_geolocate" />
<button
string="Geolocate"
name="geo_localize"
colspan="2"
icon="fa-check"
type="object" attrs="{'invisible':[('manual_geolocate', '=', True)]}" />
<field name="partner_latitude" attrs="{'readonly':[('manual_geolocate', '=', False)]}" />
<field name="partner_longitude" attrs="{'readonly':[('manual_geolocate', '=', False)]}" />
</group>
</page>
</xpath>
</field>
</record>
</odoo>