first commit

This commit is contained in:
root
2026-03-14 09:42:12 +00:00
commit 0adbd20c2c
10991 changed files with 1646955 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,23 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import urllib.parse
from trytond.model import fields
from trytond.pool import PoolMeta
from trytond.transaction import Transaction
class Address(metaclass=PoolMeta):
__name__ = 'party.address'
google_maps_url = fields.Function(fields.Char('Google Maps'),
'on_change_with_google_maps_url')
@fields.depends('full_address')
def on_change_with_google_maps_url(self, name=None):
lang = Transaction().language[:2]
url = ' '.join((self.full_address or '').splitlines())
if url.strip():
return 'http://maps.google.com/maps?hl=%s&q=%s' % \
(lang, urllib.parse.quote(url))
return ''

View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="address_view_form">
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_form"/>
<field name="name">address_form</field>
</record>
<record model="ir.ui.view" id="address_view_form_simple">
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_form_simple"/>
<field name="name">address_form</field>
</record>
</data>
</tryton>

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google карти"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Mapes de Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr ""

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google Maps"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Mapas de Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Mapas de Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google kaardid"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "نقشه های گوگل"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr ""

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google Maps"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr ""

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Peta Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Mappe di Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "ແຜນທີ່ ຄູເກີນລ໌"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr ""

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google Maps"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Mapy Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google Maps"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Hărți Google"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Карта Google Maps"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google zemljevid"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "Google Haritalar"

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr ""

View File

@@ -0,0 +1,7 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:party.address,google_maps_url:"
msgid "Google Maps"
msgstr "谷歌地图"

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
class GoogleMapsTestCase(ModuleTestCase):
'Test GoogleMaps module'
module = 'google_maps'
@with_transaction()
def test_google_maps_url(self):
"Test Google Maps URL"
pool = Pool()
Address = pool.get('party.address')
Party = pool.get('party.party')
party = Party()
party.save()
address = Address()
address.party = party
address.street = "300 Cliff Street"
address.postal_code = "18503"
address.city = "Scranton"
address.save()
self.assertEqual(
address.on_change_with_google_maps_url(),
'http://maps.google.com/maps?hl=en&'
'q=300%20Cliff%20Street%2018503%20Scranton')
address = Address()
address.party = party
address.street = "Dépôt Street"
address.postal_code = "18503"
address.city = "Scranton"
address.save()
self.assertEqual(
address.on_change_with_google_maps_url(),
'http://maps.google.com/maps?hl=en&'
'q=D%C3%A9p%C3%B4t%20Street%2018503%20Scranton')
del ModuleTestCase

View File

@@ -0,0 +1,11 @@
[tryton]
version=7.8.1
depends:
ir
party
xml:
address.xml
[register]
model:
address.Address

View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//group[@id='checkboxes']/field[@name='sequence']" position="after">
<label name="google_maps_url"/>
<field name="google_maps_url" widget="url"/>
</xpath>
</data>