[tryton-debian-vcs] tryton-modules-party branch upstream updated. upstream/3.4.1-1-g52850b8
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Thu Apr 23 16:04:14 UTC 2015
The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-party.git;a=commitdiff;h=upstream/3.4.1-1-g52850b8
commit 52850b8ea8f3022fe3d68c4abcb1f1247872af29
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Thu Apr 23 16:59:59 2015 +0200
Adding upstream version 3.6.0.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index 7725676..d481089 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,8 @@
-Version 3.4.1 - 2015-02-25
+Version 3.6.0 - 2015-04-20
* Bug fixes (see mercurial logs for details)
+* Add support for PyPy
+* compact vat number
+* value Function fields don't set the value anymore
Version 3.4.0 - 2014-10-20
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index cb5bbd7..33d9580 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond_party
-Version: 3.4.1
+Version: 3.6.0
Summary: Tryton module with parties and addresses
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
Description: trytond_party
=============
@@ -65,4 +65,6 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
diff --git a/__init__.py b/__init__.py
index 5f25c2a..f9f797c 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 .category import *
diff --git a/address.py b/address.py
index daf1b90..f1c54a8 100644
--- a/address.py
+++ b/address.py
@@ -1,6 +1,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.
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
'Address'
+from sql import Null
+
from trytond.model import ModelView, ModelSQL, fields
from trytond.pyson import Eval, If
from trytond.transaction import Transaction
@@ -61,7 +63,7 @@ class Address(ModelSQL, ModelView):
@staticmethod
def order_sequence(tables):
table, _ = tables[None]
- return [table.sequence == None, table.sequence]
+ return [table.sequence == Null, table.sequence]
@staticmethod
def default_active():
@@ -141,7 +143,11 @@ class Address(ModelSQL, ModelView):
@classmethod
def search_rec_name(cls, name, clause):
- return ['OR',
+ if clause[1].startswith('!') or clause[1].startswith('not '):
+ bool_op = 'AND'
+ else:
+ bool_op = 'OR'
+ return [bool_op,
('zip',) + tuple(clause[1:]),
('city',) + tuple(clause[1:]),
('name',) + tuple(clause[1:]),
@@ -155,12 +161,12 @@ class Address(ModelSQL, ModelView):
if 'party' in values:
for address in addresses:
if address.party.id != values['party']:
- cls.raise_user_error('write_party', (address.rec_name,))
+ cls.raise_user_error(
+ 'write_party', (address.rec_name,))
super(Address, cls).write(*args)
@fields.depends('subdivision', 'country')
def on_change_country(self):
if (self.subdivision
and self.subdivision.country != self.country):
- return {'subdivision': None}
- return {}
+ self.subdivision = None
diff --git a/category.py b/category.py
index bf6b3e3..c6f89d8 100644
--- a/category.py
+++ b/category.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 ModelView, ModelSQL, fields
from trytond.pyson import Eval
@@ -35,7 +35,7 @@ class Category(ModelSQL, ModelView):
'wrong_name': ('Invalid category name "%%s": You can not use '
'"%s" in name field.' % SEPARATOR),
})
- cls._order.insert(1, ('name', 'ASC'))
+ cls._order.insert(0, ('name', 'ASC'))
@staticmethod
def default_active():
@@ -67,7 +67,6 @@ class Category(ModelSQL, ModelView):
for name in values:
domain.append((field, clause[1], name))
field = 'parent.' + field
- categories = cls.search(domain, order=[])
- return [('id', 'in', [category.id for category in categories])]
- #TODO Handle list
+ return domain
+ # TODO Handle list
return [('name',) + tuple(clause[1:])]
diff --git a/category.xml b/category.xml
index d1b88ed..82880a9 100644
--- a/category.xml
+++ b/category.xml
@@ -23,7 +23,7 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_category_tree">
<field name="name">Categories</field>
<field name="res_model">party.category</field>
- <field name="domain">[('parent', '=', None)]</field>
+ <field name="domain" eval="[('parent', '=', None)]" pyson="1"/>
</record>
<record model="ir.action.act_window.view" id="act_category_tree_view1">
<field name="sequence" eval="10"/>
diff --git a/configuration.py b/configuration.py
index 50b7a4a..afa5d07 100644
--- a/configuration.py
+++ b/configuration.py
@@ -1,6 +1,7 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 ModelView, ModelSQL, ModelSingleton, fields
+from trytond.pyson import Eval
__all__ = ['Configuration']
@@ -12,6 +13,10 @@ class Configuration(ModelSingleton, ModelSQL, ModelView):
party_sequence = fields.Property(fields.Many2One('ir.sequence',
'Party Sequence', domain=[
('code', '=', 'party.party'),
+ ['OR',
+ ('company', '=', Eval('context', {}).get('company', -1)),
+ ('company', '=', None),
+ ],
]))
party_lang = fields.Property(fields.Many2One("ir.lang", 'Party Language',
help=('The value set on this field will preset the language on new '
diff --git a/configuration.xml b/configuration.xml
index 2d07c6d..b8dc888 100644
--- a/configuration.xml
+++ b/configuration.xml
@@ -22,6 +22,11 @@ this repository contains the full copyright notices and license terms. -->
action="act_party_configuration_form"
id="menu_party_configuration"
sequence="0" icon="tryton-list"/>
+ <record model="ir.ui.menu-res.group"
+ id="menu_party_configuration_group_party_admin">
+ <field name="menu" ref="menu_party_configuration"/>
+ <field name="group" ref="group_party_admin"/>
+ </record>
<record model="ir.property" id="property_party_sequence">
<field name="field"
diff --git a/contact_mechanism.py b/contact_mechanism.py
index b7bed09..38c91f9 100644
--- a/contact_mechanism.py
+++ b/contact_mechanism.py
@@ -1,5 +1,7 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 Null
+
from trytond.model import ModelView, ModelSQL, fields
from trytond.pyson import Eval
from trytond.transaction import Transaction
@@ -102,7 +104,7 @@ class ContactMechanism(ModelSQL, ModelView):
@staticmethod
def order_sequence(tables):
table, _ = tables[None]
- return [table.sequence == None, table.sequence]
+ return [table.sequence == Null, table.sequence]
@staticmethod
def default_type():
@@ -132,26 +134,21 @@ class ContactMechanism(ModelSQL, ModelView):
@classmethod
def set_value(cls, mechanisms, name, value):
- cls.write(mechanisms, {
- 'value': value,
- })
+ # Setting value is done by on_changes
+ pass
def _change_value(self, value):
- return {
- 'value': value,
- 'website': value,
- 'email': value,
- 'skype': value,
- 'sip': value,
- 'other_value': value,
- 'url': self.get_url(value=value)
- }
+ self.value = value
+ self.website = value
+ self.email = value
+ self.skype = value
+ self.sip = value
+ self.other_value = value
+ self.url = self.get_url(value=value)
@fields.depends('value', 'type')
def on_change_type(self):
- return {
- 'url': self.get_url(value=self.value),
- }
+ self.url = self.get_url(value=self.value)
@fields.depends('value', 'type')
def on_change_value(self):
@@ -184,5 +181,6 @@ class ContactMechanism(ModelSQL, ModelView):
if 'party' in values:
for mechanism in mechanisms:
if mechanism.party.id != values['party']:
- cls.raise_user_error('write_party', (mechanism.rec_name,))
+ cls.raise_user_error(
+ 'write_party', (mechanism.rec_name,))
super(ContactMechanism, cls).write(*args)
diff --git a/contact_mechanism.xml b/contact_mechanism.xml
index be4f507..c1dfb5f 100644
--- a/contact_mechanism.xml
+++ b/contact_mechanism.xml
@@ -24,5 +24,24 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">contact_mechanism_form</field>
</record>
+ <record model="ir.action.act_window" id="act_contact_mechanism_form">
+ <field name="name">Contact Mechanisms</field>
+ <field name="res_model">party.contact_mechanism</field>
+ </record>
+ <record model="ir.action.act_window.view"
+ id="act_contact_mechanism_form_view1">
+ <field name="sequence" eval="10"/>
+ <field name="view" ref="contact_mechanism_view_tree"/>
+ <field name="act_window" ref="act_contact_mechanism_form"/>
+ </record>
+ <record model="ir.action.act_window.view"
+ id="act_contact_mechanism_form_view2">
+ <field name="sequence" eval="20"/>
+ <field name="view" ref="contact_mechanism_view_form"/>
+ <field name="act_window" ref="act_contact_mechanism_form"/>
+ </record>
+ <menuitem parent="menu_party"
+ sequence="3" action="act_contact_mechanism_form"
+ id="menu_contact_mechanism_form"/>
</data>
</tryton>
diff --git a/label.odt b/label.odt
index 154c9e6..4683c4c 100644
Binary files a/label.odt and b/label.odt differ
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index e76ed02..9404e7c 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -407,6 +407,11 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Категории"
+#, fuzzy
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Начини на контакт"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Патньори по категория"
@@ -451,6 +456,11 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Конфигурация"
+#, fuzzy
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Начини на контакт"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Управление на партньор"
@@ -596,9 +606,9 @@ msgid "VAT"
msgstr "ДДС"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Добре"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Добре"
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index cd04216..b3c7502 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -154,7 +154,7 @@ msgstr "Tercer erroni"
msgctxt "field:party.check_vies.result,parties_succeed:"
msgid "Parties Succeed"
-msgstr "Tercer correcte"
+msgstr "Tercers correctes"
msgctxt "field:party.configuration,create_date:"
msgid "Create Date"
@@ -409,6 +409,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Categories"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Mitjans de contacte"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Tercers per categoria"
@@ -453,6 +457,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuració"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Mitjans de contacte"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Tercers"
@@ -598,9 +606,9 @@ msgid "VAT"
msgstr "CIF/NIF"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Accepta"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Accepta"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index baa7561..127ed51 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -407,6 +407,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr ""
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr ""
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr ""
@@ -451,6 +455,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr ""
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr ""
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr ""
@@ -596,9 +604,9 @@ msgid "VAT"
msgstr ""
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr ""
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index f1fd4f6..cbab8a7 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -411,6 +411,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Parteikategorien"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Kontaktmöglichkeiten"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Parteien nach Kategorien"
@@ -455,6 +459,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Einstellungen"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Kontaktmöglichkeiten"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Parteien"
@@ -602,9 +610,9 @@ msgid "VAT"
msgstr "USt"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "OK"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "OK"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 9032c7b..49f7d3a 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -413,6 +413,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Categorías"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de contacto"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Entidades por categoría"
@@ -457,6 +461,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuración"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de contacto"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Entidades"
@@ -602,9 +610,9 @@ msgid "VAT"
msgstr "CUIT"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 03bb469..ee362ff 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -174,7 +174,7 @@ msgstr "Idioma del Tercero"
msgctxt "field:party.configuration,party_sequence:"
msgid "Party Sequence"
-msgstr "Secuencia de Terceros"
+msgstr "Secuencia de Tercero"
msgctxt "field:party.configuration,rec_name:"
msgid "Name"
@@ -411,6 +411,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Categorías"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de Contacto"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Terceros por Categoría"
@@ -455,6 +459,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuración"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de Contacto"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Gestión de Terceros"
@@ -600,9 +608,9 @@ msgid "VAT"
msgstr "NIT"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
diff --git a/locale/es_EC.po b/locale/es_EC.po
index 67ccabd..4f3d8fe 100644
--- a/locale/es_EC.po
+++ b/locale/es_EC.po
@@ -14,7 +14,7 @@ msgstr ""
msgctxt "error:party.category:"
msgid "The name of a party category must be unique by parent."
-msgstr "El nombre de una categoría de tercero debe ser único por cada padre."
+msgstr "El nombre de la categoría del tercero debe ser único según el padre."
msgctxt "error:party.check_vies:"
msgid "The VIES service is unavailable, try again later."
@@ -46,15 +46,15 @@ msgstr "País"
msgctxt "field:party.address,create_date:"
msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
msgctxt "field:party.address,create_uid:"
msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
msgctxt "field:party.address,full_address:"
msgid "Full Address"
-msgstr "Dirección Completa"
+msgstr "Dirección completa"
msgctxt "field:party.address,id:"
msgid "ID"
@@ -90,15 +90,15 @@ msgstr "Provincia"
msgctxt "field:party.address,write_date:"
msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
msgctxt "field:party.address,write_uid:"
msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
msgctxt "field:party.address,zip:"
msgid "Zip"
-msgstr "Código Postal"
+msgstr "Código postal"
msgctxt "field:party.category,active:"
msgid "Active"
@@ -110,11 +110,11 @@ msgstr "Hijos"
msgctxt "field:party.category,create_date:"
msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
msgctxt "field:party.category,create_uid:"
msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
msgctxt "field:party.category,id:"
msgid "ID"
@@ -134,11 +134,11 @@ msgstr "Nombre"
msgctxt "field:party.category,write_date:"
msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
msgctxt "field:party.category,write_uid:"
msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
msgctxt "field:party.check_vies.no_result,id:"
msgid "ID"
@@ -150,19 +150,19 @@ msgstr "ID"
msgctxt "field:party.check_vies.result,parties_failed:"
msgid "Parties Failed"
-msgstr "Terceros Erróneos"
+msgstr "Terceros erróneos"
msgctxt "field:party.check_vies.result,parties_succeed:"
msgid "Parties Succeed"
-msgstr "Terceros Corrrectos"
+msgstr "Terceros corrrectos"
msgctxt "field:party.configuration,create_date:"
msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
msgctxt "field:party.configuration,create_uid:"
msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
msgctxt "field:party.configuration,id:"
msgid "ID"
@@ -170,7 +170,7 @@ msgstr "ID"
msgctxt "field:party.configuration,party_lang:"
msgid "Party Language"
-msgstr "Idioma del Tercero"
+msgstr "Idioma del tercero"
msgctxt "field:party.configuration,party_sequence:"
msgid "Party Sequence"
@@ -182,11 +182,11 @@ msgstr "Nombre"
msgctxt "field:party.configuration,write_date:"
msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
msgctxt "field:party.configuration,write_uid:"
msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
msgctxt "field:party.contact_mechanism,active:"
msgid "Active"
@@ -198,11 +198,11 @@ msgstr "Comentario"
msgctxt "field:party.contact_mechanism,create_date:"
msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
msgctxt "field:party.contact_mechanism,create_uid:"
msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
msgctxt "field:party.contact_mechanism,email:"
msgid "E-Mail"
@@ -254,11 +254,11 @@ msgstr "Sitio Web"
msgctxt "field:party.contact_mechanism,write_date:"
msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
msgctxt "field:party.contact_mechanism,write_uid:"
msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
msgctxt "field:party.party,active:"
msgid "Active"
@@ -278,19 +278,19 @@ msgstr "Código"
msgctxt "field:party.party,code_readonly:"
msgid "Code Readonly"
-msgstr "Código de Sólo Lectura"
+msgstr "Código de sólo lectura"
msgctxt "field:party.party,contact_mechanisms:"
msgid "Contact Mechanisms"
-msgstr "Medios de Contacto"
+msgstr "Medios de contacto"
msgctxt "field:party.party,create_date:"
msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
msgctxt "field:party.party,create_uid:"
msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
msgctxt "field:party.party,email:"
msgid "E-Mail"
@@ -302,7 +302,7 @@ msgstr "Fax"
msgctxt "field:party.party,full_name:"
msgid "Full Name"
-msgstr "Nombre Completo"
+msgstr "Nombre completo"
msgctxt "field:party.party,id:"
msgid "ID"
@@ -346,11 +346,11 @@ msgstr "Sitio Web"
msgctxt "field:party.party,write_date:"
msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
msgctxt "field:party.party,write_uid:"
msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
msgctxt "field:party.party-party.category,category:"
msgid "Category"
@@ -358,11 +358,11 @@ msgstr "Categoría"
msgctxt "field:party.party-party.category,create_date:"
msgid "Create Date"
-msgstr "Fecha de Creación"
+msgstr "Fecha de creación"
msgctxt "field:party.party-party.category,create_uid:"
msgid "Create User"
-msgstr "Creado por Usuario"
+msgstr "Creado por usuario"
msgctxt "field:party.party-party.category,id:"
msgid "ID"
@@ -378,16 +378,17 @@ msgstr "Nombre"
msgctxt "field:party.party-party.category,write_date:"
msgid "Write Date"
-msgstr "Fecha de Modificación"
+msgstr "Fecha de modificación"
msgctxt "field:party.party-party.category,write_uid:"
msgid "Write User"
-msgstr "Modificado por Usuario"
+msgstr "Modificado por usuario"
msgctxt "help:party.configuration,party_lang:"
msgid "The value set on this field will preset the language on new parties"
msgstr ""
-"El valor de este campo será el idioma por defecto de los nuevos terceros."
+"El valor de este campo será el valor por defecto del idioma de los nuevos "
+"terceros."
msgctxt "help:party.party,vat_country:"
msgid "Setting VAT country will enable validation of the VAT number."
@@ -411,13 +412,17 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Categorías"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de contacto"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
-msgstr "Terceros por Categoría"
+msgstr "Terceros por categoría"
msgctxt "model:ir.action,name:act_party_configuration_form"
msgid "Party Configuration"
-msgstr "Configuración de Terceros"
+msgstr "Configuración de terceros"
msgctxt "model:ir.action,name:act_party_form"
msgid "Parties"
@@ -455,6 +460,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuración"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de Contacto"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Terceros"
@@ -489,7 +498,7 @@ msgstr "Configuración de Terceros"
msgctxt "model:party.contact_mechanism,name:"
msgid "Contact Mechanism"
-msgstr "Medio de Contacto"
+msgstr "Medio de contacto"
msgctxt "model:party.party,name:"
msgid "Party"
@@ -561,7 +570,7 @@ msgstr "Sistema de Intercambio de Información RUC "
msgctxt "view:party.check_vies.no_result:"
msgid "You must have a recent version of \"vatnumber\" installed!"
-msgstr "¡Debe tener una versión reciente de \"vatnumber\" instalada!"
+msgstr "¡Debe tener instalada una versión reciente de \"vatnumber\"!"
msgctxt "view:party.check_vies.result:"
msgid "VAT Information Exchange System Results"
@@ -573,11 +582,11 @@ msgstr "Configuración de Terceros"
msgctxt "view:party.contact_mechanism:"
msgid "Contact Mechanism"
-msgstr "Medio de Contacto"
+msgstr "Medio de contacto"
msgctxt "view:party.contact_mechanism:"
msgid "Contact Mechanisms"
-msgstr "Medios de Contacto"
+msgstr "Medios de contacto"
msgctxt "view:party.party:"
msgid "Accounting"
@@ -600,9 +609,9 @@ msgid "VAT"
msgstr "RUC"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
-msgstr "Aceptar"
+msgid "OK"
+msgstr "OK"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
-msgstr "Aceptar"
+msgid "OK"
+msgstr "OK"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 2811102..3585514 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -154,7 +154,7 @@ msgstr "Tercero erróneo"
msgctxt "field:party.check_vies.result,parties_succeed:"
msgid "Parties Succeed"
-msgstr "Tercero correcto"
+msgstr "Terceros correctos"
msgctxt "field:party.configuration,create_date:"
msgid "Create Date"
@@ -410,6 +410,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Categorías"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de contacto"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Terceros por categoría"
@@ -454,6 +458,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuración"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Medios de contacto"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Terceros"
@@ -599,9 +607,9 @@ msgid "VAT"
msgstr "CIF/NIF"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Aceptar"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index cbb4280..b06ddb9 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -410,6 +410,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Catégories"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Moyens de contact"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Tiers par catégorie"
@@ -454,6 +458,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuration"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Moyens de contact"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Tiers"
@@ -599,9 +607,9 @@ msgid "VAT"
msgstr "TVA"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
-msgstr "Ok"
+msgid "OK"
+msgstr "OK"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
-msgstr "Ok"
+msgid "OK"
+msgstr "OK"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index 555f6b2..1f7feab 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -409,6 +409,11 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Categorieën"
+#, fuzzy
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Contactmogelijkheden"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Relaties per categorie"
@@ -455,6 +460,11 @@ msgid "Configuration"
msgstr "Instellingen"
#, fuzzy
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Contactmogelijkheden"
+
+#, fuzzy
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Relatiebeheer"
@@ -603,10 +613,10 @@ msgstr "Omzetbelasting"
#, fuzzy
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Oké"
#, fuzzy
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Oké"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index c751e5a..533196b 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -410,6 +410,11 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Категории"
+#, fuzzy
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Контактные способы"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Контрагенты по категориям"
@@ -454,6 +459,11 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Конфигурация"
+#, fuzzy
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Контактные способы"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Контрагенты"
@@ -599,9 +609,9 @@ msgid "VAT"
msgstr "ИНН"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Ок"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "Ок"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index 6b3f01f..9bd366d 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -192,7 +192,7 @@ msgstr "Aktivno"
msgctxt "field:party.contact_mechanism,comment:"
msgid "Comment"
-msgstr "Komentar"
+msgstr "Opomba"
msgctxt "field:party.contact_mechanism,create_date:"
msgid "Create Date"
@@ -406,6 +406,10 @@ msgctxt "model:ir.action,name:act_category_tree"
msgid "Categories"
msgstr "Kategorije"
+msgctxt "model:ir.action,name:act_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Kontakti"
+
msgctxt "model:ir.action,name:act_party_by_category"
msgid "Parties by Category"
msgstr "Partnerji po kategorijah"
@@ -450,6 +454,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Nastavitve"
+msgctxt "model:ir.ui.menu,name:menu_contact_mechanism_form"
+msgid "Contact Mechanisms"
+msgstr "Kontakti"
+
msgctxt "model:ir.ui.menu,name:menu_party"
msgid "Party"
msgstr "Partner"
@@ -595,9 +603,9 @@ msgid "VAT"
msgstr "DDV"
msgctxt "wizard_button:party.check_vies,no_result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "V redu"
msgctxt "wizard_button:party.check_vies,result,end:"
-msgid "Ok"
+msgid "OK"
msgstr "V redu"
diff --git a/party.py b/party.py
index e2e5f17..313bbfd 100644
--- a/party.py
+++ b/party.py
@@ -1,6 +1,7 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 logging
+from importlib import import_module
from sql.functions import CharLength
@@ -13,6 +14,8 @@ from trytond.pool import Pool
__all__ = ['Party', 'PartyCategory', 'CheckVIESNoResult', 'CheckVIESResult',
'CheckVIES']
+logger = logging.getLogger(__name__)
+
HAS_VATNUMBER = False
VAT_COUNTRIES = [('', '')]
try:
@@ -21,8 +24,9 @@ try:
for country in vatnumber.countries():
VAT_COUNTRIES.append((country, country))
except ImportError:
- logging.getLogger('party').warning(
- 'Unable to import vatnumber. VAT number validation disabled.')
+ logger.warning(
+ 'Unable to import vatnumber. VAT number validation disabled.',
+ exc_info=True)
STATES = {
'readonly': ~Eval('active', True),
@@ -127,6 +131,23 @@ class Party(ModelSQL, ModelView):
def on_change_with_vat_code(self, name=None):
return (self.vat_country or '') + (self.vat_number or '')
+ @fields.depends('vat_country', 'vat_number')
+ def on_change_with_vat_number(self):
+ if not self.vat_country:
+ return self.vat_number
+ code = self.vat_country.lower()
+ vat_module = None
+ try:
+ module = import_module('stdnum.%s' % code)
+ vat_module = getattr(module, 'vat', None)
+ if not vat_module:
+ vat_module = import_module('stdnum.%s.vat' % code)
+ except ImportError:
+ pass
+ if vat_module:
+ return vat_module.compact(self.vat_number)
+ return self.vat_number
+
@classmethod
def search_vat_code(cls, name, clause):
res = []
@@ -173,13 +194,17 @@ class Party(ModelSQL, ModelView):
@classmethod
def search_global(cls, text):
- for id_, rec_name, icon in super(Party, cls).search_global(text):
+ for record, rec_name, icon in super(Party, cls).search_global(text):
icon = icon or 'tryton-party'
- yield id_, rec_name, icon
+ yield record, rec_name, icon
@classmethod
def search_rec_name(cls, name, clause):
- return ['OR',
+ if clause[1].startswith('!') or clause[1].startswith('not '):
+ bool_op = 'AND'
+ else:
+ bool_op = 'OR'
+ return [bool_op,
('code',) + tuple(clause[1:]),
('name',) + tuple(clause[1:]),
]
@@ -216,25 +241,21 @@ class Party(ModelSQL, ModelView):
'''
if not HAS_VATNUMBER:
return
- vat_number = self.vat_number
if not self.vat_country:
return
+ vat_number = self.on_change_with_vat_number()
+ if vat_number != self.vat_number:
+ self.vat_number = vat_number
+ self.save()
+
if not getattr(vatnumber, 'check_vat_' +
self.vat_country.lower())(vat_number):
-
- #Check if user doesn't have put country code in number
- if vat_number.startswith(self.vat_country):
- vat_number = vat_number[len(self.vat_country):]
- Party.write([self], {
- 'vat_number': vat_number,
+ self.raise_user_error('invalid_vat', {
+ 'vat': vat_number,
+ 'party': self.rec_name,
})
- else:
- self.raise_user_error('invalid_vat', {
- 'vat': vat_number,
- 'party': self.rec_name,
- })
class PartyCategory(ModelSQL):
@@ -273,11 +294,11 @@ class CheckVIES(Wizard):
check = StateTransition()
result = StateView('party.check_vies.result',
'party.check_vies_result', [
- Button('Ok', 'end', 'tryton-ok', True),
+ Button('OK', 'end', 'tryton-ok', True),
])
no_result = StateView('party.check_vies.no_result',
'party.check_vies_no_result', [
- Button('Ok', 'end', 'tryton-ok', True),
+ Button('OK', 'end', 'tryton-ok', True),
])
@classmethod
diff --git a/party.xml b/party.xml
index 006d73e..1fa7a6b 100644
--- a/party.xml
+++ b/party.xml
@@ -62,8 +62,11 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.action.act_window" id="act_party_by_category">
<field name="name">Parties by Category</field>
<field name="res_model">party.party</field>
- <field name="context">{'categories': [Eval('active_id')]}</field>
- <field name="domain">[('categories', 'child_of', [Eval('active_id')], 'parent')]</field>
+ <field name="context"
+ eval="{'categories': [Eval('active_id')]}" pyson="1"/>
+ <field name="domain"
+ eval="[('categories', 'child_of', [Eval('active_id')], 'parent')]"
+ pyson="1"/>
</record>
<record model="ir.action.keyword" id="act_party_by_category_keyword1">
<field name="keyword">tree_open</field>
diff --git a/setup.py b/setup.py
index 3582e9b..2f19b9f 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 setuptools import setup
import re
@@ -41,7 +41,7 @@ if minor_version % 2:
'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
name[8:], name, version))
-requires = ['python-sql']
+requires = ['python-sql >= 0.4']
for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
requires.append(get_require_version('trytond_%s' % dep))
@@ -87,12 +87,14 @@ setup(name=name,
'Natural Language :: Spanish',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Office/Business',
],
license='GPL-3',
install_requires=requires,
extras_require={
- 'VAT': ['vatnumber'],
+ 'VAT': ['vatnumber', 'python-stdnum'],
},
zip_safe=False,
entry_points="""
diff --git a/tests/__init__.py b/tests/__init__.py
index ac2796d..b42e89b 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,5 +1,5 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 .test_party import suite
diff --git a/tests/test_party.py b/tests/test_party.py
index 3d5f04b..ef88cfb 100644
--- a/tests/test_party.py
+++ b/tests/test_party.py
@@ -1,29 +1,22 @@
-#This file is part of Tryton. The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+# 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 unittest
import trytond.tests.test_tryton
-from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
- test_depends
+from trytond.tests.test_tryton import ModuleTestCase
+from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
from trytond.transaction import Transaction
-class PartyTestCase(unittest.TestCase):
+class PartyTestCase(ModuleTestCase):
'Test Party module'
+ module = 'party'
def setUp(self):
- trytond.tests.test_tryton.install_module('party')
+ super(PartyTestCase, self).setUp()
self.category = POOL.get('party.category')
self.party = POOL.get('party.party')
self.address = POOL.get('party.address')
- def test0005views(self):
- 'Test views'
- test_view('party')
-
- def test0006depends(self):
- 'Test depends'
- test_depends()
-
def test0010category(self):
'Create category'
with Transaction().start(DB_NAME, USER,
@@ -90,6 +83,15 @@ class PartyTestCase(unittest.TestCase):
}])
self.assert_(address.id)
+ def test0060party_label_report(self):
+ 'Test party label report'
+ with Transaction().start(DB_NAME, USER, context=CONTEXT):
+ party1, = self.party.search([], limit=1)
+ report = POOL.get('party.label', type='report')
+ oext, content, _, _ = report.execute([party1.id], {})
+ self.assertEqual(oext, 'odt')
+ self.assertTrue(content)
+
def suite():
suite = trytond.tests.test_tryton.suite()
diff --git a/tryton.cfg b/tryton.cfg
index d2877c7..ee350ba 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
[tryton]
-version=3.4.1
+version=3.6.0
depends:
country
ir
diff --git a/trytond_party.egg-info/PKG-INFO b/trytond_party.egg-info/PKG-INFO
index 0246dda..0c287fd 100644
--- a/trytond_party.egg-info/PKG-INFO
+++ b/trytond_party.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: trytond-party
-Version: 3.4.1
+Version: 3.6.0
Summary: Tryton module with parties and addresses
Home-page: http://www.tryton.org/
Author: Tryton
Author-email: issue_tracker at tryton.org
License: GPL-3
-Download-URL: http://downloads.tryton.org/3.4/
+Download-URL: http://downloads.tryton.org/3.6/
Description: trytond_party
=============
@@ -65,4 +65,6 @@ Classifier: Natural Language :: Slovenian
Classifier: Natural Language :: Spanish
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Office/Business
diff --git a/trytond_party.egg-info/requires.txt b/trytond_party.egg-info/requires.txt
index 72fe966..e6516c1 100644
--- a/trytond_party.egg-info/requires.txt
+++ b/trytond_party.egg-info/requires.txt
@@ -1,6 +1,7 @@
-python-sql
-trytond_country >= 3.4, < 3.5
-trytond >= 3.4, < 3.5
+python-sql >= 0.4
+trytond_country >= 3.6, < 3.7
+trytond >= 3.6, < 3.7
[VAT]
-vatnumber
\ No newline at end of file
+vatnumber
+python-stdnum
\ No newline at end of file
--
tryton-modules-party
More information about the tryton-debian-vcs
mailing list