first commit
This commit is contained in:
2
modules/party_siret/__init__.py
Normal file
2
modules/party_siret/__init__.py
Normal 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.
|
||||
BIN
modules/party_siret/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
modules/party_siret/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
modules/party_siret/__pycache__/address.cpython-311.pyc
Normal file
BIN
modules/party_siret/__pycache__/address.cpython-311.pyc
Normal file
Binary file not shown.
BIN
modules/party_siret/__pycache__/company.cpython-311.pyc
Normal file
BIN
modules/party_siret/__pycache__/company.cpython-311.pyc
Normal file
Binary file not shown.
BIN
modules/party_siret/__pycache__/party.cpython-311.pyc
Normal file
BIN
modules/party_siret/__pycache__/party.cpython-311.pyc
Normal file
Binary file not shown.
88
modules/party_siret/address.py
Normal file
88
modules/party_siret/address.py
Normal file
@@ -0,0 +1,88 @@
|
||||
# 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 sql import Literal, Null
|
||||
from sql.operators import Concat
|
||||
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
class Address(metaclass=PoolMeta):
|
||||
__name__ = 'party.address'
|
||||
|
||||
siret = fields.Function(fields.Many2One(
|
||||
'party.identifier', "SIRET"),
|
||||
'get_siret', searcher='search_siret')
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module):
|
||||
pool = Pool()
|
||||
Party = pool.get('party.party')
|
||||
Identifier = pool.get('party.identifier')
|
||||
cursor = Transaction().connection.cursor()
|
||||
party = Party.__table__()
|
||||
address = cls.__table__()
|
||||
identifier = Identifier.__table__()
|
||||
|
||||
super().__register__(module)
|
||||
|
||||
table_h = cls.__table_handler__(module)
|
||||
party_h = Party.__table_handler__(module)
|
||||
|
||||
# Migrate from 6.2: replace siren and siret by identifier
|
||||
if party_h.column_exist('siren'):
|
||||
cursor.execute(*identifier.insert(
|
||||
[identifier.party,
|
||||
identifier.type, identifier.code,
|
||||
identifier.active],
|
||||
party.select(
|
||||
party.id, Literal('fr_siren'),
|
||||
party.siren, party.active,
|
||||
where=(party.siren != Null)
|
||||
& (party.siren != ''))))
|
||||
if table_h.column_exist('siret_nic'):
|
||||
cursor.execute(*identifier.insert(
|
||||
[identifier.party, identifier.address,
|
||||
identifier.type, identifier.code,
|
||||
identifier.active],
|
||||
address.join(
|
||||
party, condition=address.party == party.id
|
||||
).select(
|
||||
address.party, address.id,
|
||||
Literal('fr_siret'),
|
||||
Concat(party.siren, address.siret_nic),
|
||||
address.active,
|
||||
where=(address.siret_nic != Null)
|
||||
& (address.siret_nic != '')
|
||||
& (party.siren != Null)
|
||||
& (party.siren != ''))))
|
||||
table_h.drop_column('siret_nic')
|
||||
party_h.drop_column('siren')
|
||||
|
||||
def get_siret(self, name):
|
||||
for identifier in self.identifiers:
|
||||
if identifier.type == 'fr_siret':
|
||||
return identifier.id
|
||||
|
||||
@classmethod
|
||||
def search_siret(cls, name, clause):
|
||||
_, operator, value = clause
|
||||
nested = clause[0][len(name) + 1:]
|
||||
domain = [
|
||||
('identifiers', 'where', [
|
||||
(nested or 'rec_name', operator, value),
|
||||
('type', '=', 'fr_siren'),
|
||||
]),
|
||||
]
|
||||
# Add party without tax identifier
|
||||
if ((operator == '=' and value is None)
|
||||
or (operator == 'in' and None in value)):
|
||||
domain = ['OR',
|
||||
domain, [
|
||||
('identifiers', 'not where', [
|
||||
('type', '=', 'fr_siren'),
|
||||
]),
|
||||
],
|
||||
]
|
||||
return domain
|
||||
12
modules/party_siret/address.xml
Normal file
12
modules/party_siret/address.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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_tree">
|
||||
<field name="model">party.address</field>
|
||||
<field name="inherit" ref="party.address_view_tree"/>
|
||||
<field name="name">address_tree</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
21
modules/party_siret/company.py
Normal file
21
modules/party_siret/company.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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 PoolMeta
|
||||
|
||||
|
||||
class Company(metaclass=PoolMeta):
|
||||
__name__ = 'company.company'
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
cls.header.help += "- ${siren}\n"
|
||||
cls.footer.help += "- ${siren}\n"
|
||||
|
||||
@property
|
||||
def _substitutions(self):
|
||||
substitutions = super()._substitutions
|
||||
siren = self.party.siren
|
||||
substitutions['siren'] = siren.code if siren else ''
|
||||
return substitutions
|
||||
19
modules/party_siret/locale/bg.po
Normal file
19
modules/party_siret/locale/bg.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/ca.po
Normal file
19
modules/party_siret/locale/ca.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
19
modules/party_siret/locale/cs.po
Normal file
19
modules/party_siret/locale/cs.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/de.po
Normal file
19
modules/party_siret/locale/de.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
19
modules/party_siret/locale/es.po
Normal file
19
modules/party_siret/locale/es.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
19
modules/party_siret/locale/es_419.po
Normal file
19
modules/party_siret/locale/es_419.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/et.po
Normal file
19
modules/party_siret/locale/et.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/fa.po
Normal file
19
modules/party_siret/locale/fa.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/fi.po
Normal file
19
modules/party_siret/locale/fi.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/fr.po
Normal file
19
modules/party_siret/locale/fr.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
19
modules/party_siret/locale/hu.po
Normal file
19
modules/party_siret/locale/hu.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/id.po
Normal file
19
modules/party_siret/locale/id.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/it.po
Normal file
19
modules/party_siret/locale/it.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/lo.po
Normal file
19
modules/party_siret/locale/lo.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/lt.po
Normal file
19
modules/party_siret/locale/lt.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/nl.po
Normal file
19
modules/party_siret/locale/nl.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${sirene}\n"
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${sirene}\n"
|
||||
19
modules/party_siret/locale/pl.po
Normal file
19
modules/party_siret/locale/pl.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/pt.po
Normal file
19
modules/party_siret/locale/pt.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/ro.po
Normal file
19
modules/party_siret/locale/ro.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr "- ${siren}\n"
|
||||
19
modules/party_siret/locale/ru.po
Normal file
19
modules/party_siret/locale/ru.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/sl.po
Normal file
19
modules/party_siret/locale/sl.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr "SIRET"
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr "SIREN"
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/tr.po
Normal file
19
modules/party_siret/locale/tr.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/uk.po
Normal file
19
modules/party_siret/locale/uk.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/locale/zh_CN.po
Normal file
19
modules/party_siret/locale/zh_CN.po
Normal file
@@ -0,0 +1,19 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:party.address,siret:"
|
||||
msgid "SIRET"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "field:party.party,siren:"
|
||||
msgid "SIREN"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,footer:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "help:company.company,header:"
|
||||
msgid "- ${siren}\n"
|
||||
msgstr ""
|
||||
19
modules/party_siret/party.py
Normal file
19
modules/party_siret/party.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# 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.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
|
||||
class Party(metaclass=PoolMeta):
|
||||
__name__ = 'party.party'
|
||||
|
||||
siren = fields.Function(fields.Many2One(
|
||||
'party.identifier', "SIREN"),
|
||||
'get_siren', searcher='search_siren')
|
||||
|
||||
def get_siren(self, name):
|
||||
return self._get_identifier(name, {'fr_siren'})
|
||||
|
||||
@classmethod
|
||||
def search_siren(cls, name, clause):
|
||||
return cls._search_identifier(name, clause, {'fr_siren'})
|
||||
12
modules/party_siret/party.xml
Normal file
12
modules/party_siret/party.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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="party_view_tree">
|
||||
<field name="model">party.party</field>
|
||||
<field name="inherit" ref="party.party_view_tree"/>
|
||||
<field name="name">party_tree</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
2
modules/party_siret/tests/__init__.py
Normal file
2
modules/party_siret/tests/__init__.py
Normal 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.
|
||||
BIN
modules/party_siret/tests/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
modules/party_siret/tests/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
12
modules/party_siret/tests/test_module.py
Normal file
12
modules/party_siret/tests/test_module.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# 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.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class PartySiretTestCase(ModuleTestCase):
|
||||
'Test PartySiret module'
|
||||
module = 'party_siret'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
19
modules/party_siret/tryton.cfg
Normal file
19
modules/party_siret/tryton.cfg
Normal file
@@ -0,0 +1,19 @@
|
||||
[tryton]
|
||||
version=7.8.1
|
||||
depends:
|
||||
ir
|
||||
party
|
||||
extras_depend:
|
||||
company
|
||||
xml:
|
||||
party.xml
|
||||
address.xml
|
||||
|
||||
[register]
|
||||
model:
|
||||
party.Party
|
||||
address.Address
|
||||
|
||||
[register company]
|
||||
model:
|
||||
company.Company
|
||||
8
modules/party_siret/view/address_tree.xml
Normal file
8
modules/party_siret/view/address_tree.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?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="/tree/field[@name='party']" position="after">
|
||||
<field name="siret" optional="1"/>
|
||||
</xpath>
|
||||
</data>
|
||||
8
modules/party_siret/view/party_tree.xml
Normal file
8
modules/party_siret/view/party_tree.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?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="/tree/field[@name='tax_identifier']" position="after">
|
||||
<field name="siren" optional="1"/>
|
||||
</xpath>
|
||||
</data>
|
||||
Reference in New Issue
Block a user