[tryton-debian-vcs] tryton-modules-party branch debian updated. debian/3.0.0-3-4-g9f1970e

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:08:06 UTC 2014


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-party.git;a=commitdiff;h=debian/3.0.0-3-4-g9f1970e

commit 9f1970eeeb54ce25bb4348e25054f055113425e3
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:59:58 2014 +0200

    Bumping minimal required Python version to 2.7.

diff --git a/debian/control b/debian/control
index 835f02a..57551fc 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=tryton/tryton-modules-party.git
 Vcs-Git: git://anonscm.debian.org/tryton/tryton-modules-party.git
-X-Python-Version: >= 2.6
+X-Python-Version: >= 2.7
 
 Package: tryton-modules-party
 Architecture: all
commit 20ccc15eb19d47ad2e10fbe5899158a791eaf65d
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:46:10 2014 +0200

    Updating copyright.

diff --git a/debian/copyright b/debian/copyright
index 0b65ad1..2a2076b 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,9 +1,9 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright: 2008-2013 Cédric Krier
+Copyright: 2008-2014 Cédric Krier
            2008-2013 Bertrand Chenal
-           2008-2013 B2CK SPRL
+           2008-2014 B2CK SPRL
            2008-2013 Udo Spallek
            2008-2011 Korbinian Preisler
            2008-2011 virtual things
commit 69d7a770808b9aa84a5f9f251510356bde415422
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:22:14 2014 +0200

    Merging upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index 31e5d55..8b4a6b9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.0 - 2014-04-21
+* Bug fixes (see mercurial logs for details)
+
 Version 3.0.0 - 2013-10-21
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 03c5206..06cd845 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2013 Cédric Krier.
+Copyright (C) 2008-2014 Cédric Krier.
 Copyright (C) 2008-2013 Bertrand Chenal.
-Copyright (C) 2008-2013 B2CK SPRL.
+Copyright (C) 2008-2014 B2CK SPRL.
 Copyright (C) 2008-2013 Udo Spallek.
 Copyright (C) 2008-2011 Korbinian Preisler.
 Copyright (C) 2008-2011 virtual things.
diff --git a/INSTALL b/INSTALL
index cdfd97c..4b77e36 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_party
 Prerequisites
 -------------
 
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
  * trytond (http://www.tryton.org/)
  * trytond_country (http://www.tryton.org/)
  * Optional: vatnumber (http://code.google.com/p/vatnumber/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 732a76e..8d5ff8a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
 include INSTALL
 include README
-include TODO
 include COPYRIGHT
 include CHANGELOG
 include LICENSE
diff --git a/PKG-INFO b/PKG-INFO
index 500150b..9dda96b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_party
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module with parties and addresses
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_party
         =============
         
@@ -43,6 +43,7 @@ Description: trytond_party
         
           http://www.tryton.org/
         
+Keywords: tryton party
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -63,6 +64,5 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/address.py b/address.py
index fef948c..7827e68 100644
--- a/address.py
+++ b/address.py
@@ -28,7 +28,7 @@ class Address(ModelSQL, ModelView):
     zip = fields.Char('Zip', states=STATES, depends=DEPENDS)
     city = fields.Char('City', states=STATES, depends=DEPENDS)
     country = fields.Many2One('country.country', 'Country',
-        on_change=['country', 'subdivision'], states=STATES, depends=DEPENDS)
+        states=STATES, depends=DEPENDS)
     subdivision = fields.Many2One("country.subdivision",
             'Subdivision', domain=[('country', '=', Eval('country'))],
             states=STATES, depends=['active', 'country'])
@@ -104,23 +104,24 @@ class Address(ModelSQL, ModelView):
 
     @classmethod
     def search_rec_name(cls, name, clause):
-        addresses = cls.search(['OR',
-                ('zip',) + tuple(clause[1:]),
-                ('city',) + tuple(clause[1:]),
-                ('name',) + tuple(clause[1:]),
-                ], order=[])
-        if addresses:
-            return [('id', 'in', [address.id for address in addresses])]
-        return [('party',) + tuple(clause[1:])]
+        return ['OR',
+            ('zip',) + tuple(clause[1:]),
+            ('city',) + tuple(clause[1:]),
+            ('name',) + tuple(clause[1:]),
+            ('party',) + tuple(clause[1:]),
+            ]
 
     @classmethod
-    def write(cls, addresses, vals):
-        if 'party' in vals:
-            for address in addresses:
-                if address.party.id != vals['party']:
-                    cls.raise_user_error('write_party', (address.rec_name,))
-        super(Address, cls).write(addresses, vals)
+    def write(cls, *args):
+        actions = iter(args)
+        for addresses, values in zip(actions, actions):
+            if 'party' in values:
+                for address in addresses:
+                    if address.party.id != values['party']:
+                        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):
diff --git a/contact_mechanism.py b/contact_mechanism.py
index 9c979ab..211aef6 100644
--- a/contact_mechanism.py
+++ b/contact_mechanism.py
@@ -32,9 +32,8 @@ class ContactMechanism(ModelSQL, ModelView):
     _rec_name = 'value'
 
     type = fields.Selection(_TYPES, 'Type', required=True, states=STATES,
-        sort=False, on_change=['value', 'type'], depends=DEPENDS)
-    value = fields.Char('Value', select=True, states=STATES,
-        on_change=['value', 'type'], depends=DEPENDS)
+        sort=False, depends=DEPENDS)
+    value = fields.Char('Value', select=True, states=STATES, depends=DEPENDS)
     comment = fields.Text('Comment', states=STATES, depends=DEPENDS)
     party = fields.Many2One('party.party', 'Party', required=True,
         ondelete='CASCADE', states=STATES, select=True, depends=DEPENDS)
@@ -44,32 +43,31 @@ class ContactMechanism(ModelSQL, ModelView):
         'invisible': Eval('type') != 'email',
         'required': Eval('type') == 'email',
         'readonly': ~Eval('active', True),
-        }, on_change=['email', 'type'], depends=['value', 'type', 'active']),
+        }, depends=['value', 'type', 'active']),
         'get_value', setter='set_value')
     website = fields.Function(fields.Char('Website', states={
         'invisible': Eval('type') != 'website',
         'required': Eval('type') == 'website',
         'readonly': ~Eval('active', True),
-        }, on_change=['website', 'type'], depends=['value', 'type', 'active']),
+        }, depends=['value', 'type', 'active']),
         'get_value', setter='set_value')
     skype = fields.Function(fields.Char('Skype', states={
         'invisible': Eval('type') != 'skype',
         'required': Eval('type') == 'skype',
         'readonly': ~Eval('active', True),
-        }, on_change=['skype', 'type'], depends=['value', 'type', 'active']),
+        }, depends=['value', 'type', 'active']),
         'get_value', setter='set_value')
     sip = fields.Function(fields.Char('SIP', states={
         'invisible': Eval('type') != 'sip',
         'required': Eval('type') == 'sip',
         'readonly': ~Eval('active', True),
-        }, on_change=['sip', 'type'], depends=['value', 'type', 'active']),
+        }, depends=['value', 'type', 'active']),
         'get_value', setter='set_value')
     other_value = fields.Function(fields.Char('Value', states={
         'invisible': Eval('type').in_(['email', 'website', 'skype', 'sip']),
         'required': ~Eval('type').in_(['email', 'website']),
         'readonly': ~Eval('active', True),
-        }, on_change=['other_value', 'type'],
-            depends=['value', 'type', 'active']),
+        }, depends=['value', 'type', 'active']),
         'get_value', setter='set_value')
     url = fields.Function(fields.Char('URL', states={
                 'invisible': (~Eval('type').in_(['email', 'website', 'skype',
@@ -147,33 +145,42 @@ class ContactMechanism(ModelSQL, ModelView):
             'url': self.get_url(value=value)
             }
 
+    @fields.depends('value', 'type')
     def on_change_type(self):
         return {
             'url': self.get_url(value=self.value),
             }
 
+    @fields.depends('value', 'type')
     def on_change_value(self):
         return self._change_value(self.value)
 
+    @fields.depends('website', 'type')
     def on_change_website(self):
         return self._change_value(self.website)
 
+    @fields.depends('email', 'type')
     def on_change_email(self):
         return self._change_value(self.email)
 
+    @fields.depends('skype', 'type')
     def on_change_skype(self):
         return self._change_value(self.skype)
 
+    @fields.depends('sip', 'type')
     def on_change_sip(self):
         return self._change_value(self.sip)
 
+    @fields.depends('other_value', 'type')
     def on_change_other_value(self):
         return self._change_value(self.other_value)
 
     @classmethod
-    def write(cls, mechanisms, vals):
-        if 'party' in vals:
-            for mechanism in mechanisms:
-                if mechanism.party.id != vals['party']:
-                    cls.raise_user_error('write_party', (mechanism.rec_name,))
-        super(ContactMechanism, cls).write(mechanisms, vals)
+    def write(cls, *args):
+        actions = iter(args)
+        for mechanisms, values in zip(actions, actions):
+            if 'party' in values:
+                for mechanism in mechanisms:
+                    if mechanism.party.id != values['party']:
+                        cls.raise_user_error('write_party', (mechanism.rec_name,))
+        super(ContactMechanism, cls).write(*args)
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index c1a2971..0e6ebb7 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -14,11 +14,11 @@ msgstr ""
 
 msgctxt "error:party.category:"
 msgid "The name of a party category must be unique by parent."
-msgstr "El nom de la categoría del tercer ha de ser únic segons el pare."
+msgstr "El nom de la categoria del tercer ha de ser únic segons el pare."
 
 msgctxt "error:party.check_vies:"
 msgid "The VIES service is unavailable, try again later."
-msgstr "El servei VIES no està disponible, intenti-ho de nou més tard."
+msgstr "El servei VIES no està disponible, intenteu de nou més tard."
 
 msgctxt "error:party.contact_mechanism:"
 msgid "You can not modify the party of contact mechanism \"%s\"."
@@ -400,7 +400,7 @@ msgstr ""
 
 msgctxt "help:party.party,vat_number:"
 msgid "Value Added Tax number"
-msgstr "Número d'identificació fiscal"
+msgstr "Número d'identificació fiscal."
 
 msgctxt "model:ir.action,name:act_address_form"
 msgid "Addresses"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index 6f11de8..8ebcb5c 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -82,9 +82,10 @@ msgctxt "field:party.address,streetbis:"
 msgid "Street (bis)"
 msgstr ""
 
+#, fuzzy
 msgctxt "field:party.address,subdivision:"
 msgid "Subdivision"
-msgstr ""
+msgstr "Ascension"
 
 msgctxt "field:party.address,write_date:"
 msgid "Write Date"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 0452038..421031a 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -179,7 +179,7 @@ msgstr "Secuencia de entidades"
 
 msgctxt "field:party.configuration,rec_name:"
 msgid "Name"
-msgstr "Nombre campo"
+msgstr "Nombre"
 
 msgctxt "field:party.configuration,write_date:"
 msgid "Write Date"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 142114f..31734ba 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:party.address:"
 msgid "You can not modify the party of address \"%s\"."
-msgstr "Usted no puede modificar la dirección del  tercero \"%s\" "
+msgstr "Usted no puede modificar la dirección del tercero \"%s\" "
 
 msgctxt "error:party.category:"
 msgid "Invalid category name \"%s\": You can not use \" / \" in name field."
@@ -22,7 +22,7 @@ msgstr "El servicio VIES no está disponible, inténtelo de nuevo más tarde"
 
 msgctxt "error:party.contact_mechanism:"
 msgid "You can not modify the party of contact mechanism \"%s\"."
-msgstr "Usted no puede modificar los medios de contacto del  tercero \"%s\" "
+msgstr "Usted no puede modificar los medios de contacto del tercero \"%s\" "
 
 msgctxt "error:party.party:"
 msgid "Invalid VAT number \"%(vat)s\" on party \"%(party)s\"."
@@ -334,7 +334,7 @@ msgstr "Nombre"
 
 msgctxt "field:party.party,vat_code:"
 msgid "VAT Code"
-msgstr "Cód. NIT"
+msgstr "Núm. Id."
 
 msgctxt "field:party.party,vat_country:"
 msgid "VAT Country"
@@ -342,7 +342,7 @@ msgstr "País del NIT"
 
 msgctxt "field:party.party,vat_number:"
 msgid "VAT Number"
-msgstr "Número NIT"
+msgstr "Número Identificación"
 
 msgctxt "field:party.party,website:"
 msgid "Website"
@@ -401,7 +401,7 @@ msgstr ""
 
 msgctxt "help:party.party,vat_number:"
 msgid "Value Added Tax number"
-msgstr "Número de Identificación Tributaria"
+msgstr "Número de Identificación"
 
 msgctxt "model:ir.action,name:act_address_form"
 msgid "Addresses"
@@ -417,7 +417,7 @@ msgstr "Categorías"
 
 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"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index b7a6a8c..7610cee 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:party.address:"
 msgid "You can not modify the party of address \"%s\"."
-msgstr "Strankin naslov \"%s\" ni možno popravljati."
+msgstr "Partnerjev naslov \"%s\" ni možno popravljati."
 
 msgctxt "error:party.category:"
 msgid "Invalid category name \"%s\": You can not use \" / \" in name field."
@@ -12,7 +12,7 @@ msgstr "Neveljavno ime kategorije \"%s\": V imenu uporaba znaka \" / \" ni možn
 
 msgctxt "error:party.category:"
 msgid "The name of a party category must be unique by parent."
-msgstr "Naziv kategorije stranke mora biti edinstven na matično kategorijo."
+msgstr "Naziv kategorije partnerja mora biti edinstven na matično kategorijo."
 
 msgctxt "error:party.check_vies:"
 msgid "The VIES service is unavailable, try again later."
@@ -20,15 +20,15 @@ msgstr "VIES storitev je nedostopna, poskusite kasneje."
 
 msgctxt "error:party.contact_mechanism:"
 msgid "You can not modify the party of contact mechanism \"%s\"."
-msgstr "Strankinega kontakta \"%s\" ni možno popravljati."
+msgstr "Partnerjevega kontakta \"%s\" ni možno popravljati."
 
 msgctxt "error:party.party:"
 msgid "Invalid VAT number \"%(vat)s\" on party \"%(party)s\"."
-msgstr "Neveljavna DDV številka \"%(vat)s\" pri stranki \"%(party)s\"."
+msgstr "Neveljavna DDV številka \"%(vat)s\" pri partnerju \"%(party)s\"."
 
 msgctxt "error:party.party:"
 msgid "The code of the party must be unique."
-msgstr "Šifra stranke mora biti edinstvena."
+msgstr "Šifra partnerja mora biti edinstvena."
 
 msgctxt "field:party.address,active:"
 msgid "Active"
@@ -64,7 +64,7 @@ msgstr "Naziv"
 
 msgctxt "field:party.address,party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "field:party.address,rec_name:"
 msgid "Name"
@@ -148,11 +148,11 @@ msgstr "ID"
 
 msgctxt "field:party.check_vies.result,parties_failed:"
 msgid "Parties Failed"
-msgstr "Stranke neuspešno preverjene"
+msgstr "Partnerji neuspešno preverjeni"
 
 msgctxt "field:party.check_vies.result,parties_succeed:"
 msgid "Parties Succeed"
-msgstr "Stranke uspešno preverjene"
+msgstr "Partnerji uspešno preverjeni"
 
 msgctxt "field:party.configuration,create_date:"
 msgid "Create Date"
@@ -168,11 +168,11 @@ msgstr "ID"
 
 msgctxt "field:party.configuration,party_lang:"
 msgid "Party Language"
-msgstr "Jezik stranke"
+msgstr "Jezik partnerja"
 
 msgctxt "field:party.configuration,party_sequence:"
 msgid "Party Sequence"
-msgstr "Štetje strank"
+msgstr "Štetje partnerjev"
 
 msgctxt "field:party.configuration,rec_name:"
 msgid "Name"
@@ -216,7 +216,7 @@ msgstr "Drugo"
 
 msgctxt "field:party.contact_mechanism,party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "field:party.contact_mechanism,rec_name:"
 msgid "Name"
@@ -372,7 +372,7 @@ msgstr "ID"
 
 msgctxt "field:party.party-party.category,party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "field:party.party-party.category,rec_name:"
 msgid "Name"
@@ -388,7 +388,7 @@ msgstr "Zapisal"
 
 msgctxt "help:party.configuration,party_lang:"
 msgid "The value set on this field will preset the language on new parties"
-msgstr "Vrednost v tem polju bo nastavila jezik za nove stranke."
+msgstr "Vrednost v tem polju bo nastavila jezik za nove partnerje."
 
 msgctxt "help:party.party,vat_country:"
 msgid "Setting VAT country will enable validation of the VAT number."
@@ -412,15 +412,15 @@ msgstr "Kategorije"
 
 msgctxt "model:ir.action,name:act_party_by_category"
 msgid "Parties by Category"
-msgstr "Stranke po kategorijah"
+msgstr "Partnerji po kategorijah"
 
 msgctxt "model:ir.action,name:act_party_configuration_form"
 msgid "Party Configuration"
-msgstr "Konfiguracija strank"
+msgstr "Konfiguracija partnerjev"
 
 msgctxt "model:ir.action,name:act_party_form"
 msgid "Parties"
-msgstr "Stranke"
+msgstr "Partnerji"
 
 msgctxt "model:ir.action,name:report_label"
 msgid "Labels"
@@ -432,11 +432,11 @@ msgstr "Preveri z VIES sistemom"
 
 msgctxt "model:ir.sequence,name:sequence_party"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "model:ir.sequence.type,name:sequence_type_party"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "model:ir.ui.menu,name:menu_address_form"
 msgid "Addresses"
@@ -456,7 +456,7 @@ msgstr "Nastavitve"
 
 msgctxt "model:ir.ui.menu,name:menu_party"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "model:ir.ui.menu,name:menu_party_configuration"
 msgid "Party Configuration"
@@ -464,7 +464,7 @@ msgstr "Konfiguracija"
 
 msgctxt "model:ir.ui.menu,name:menu_party_form"
 msgid "Parties"
-msgstr "Stranke"
+msgstr "Partnerji"
 
 msgctxt "model:party.address,name:"
 msgid "Address"
@@ -484,7 +484,7 @@ msgstr "Preveri z VIES sistemom"
 
 msgctxt "model:party.configuration,name:"
 msgid "Party Configuration"
-msgstr "Konfiguracija strank"
+msgstr "Konfiguracija partnerjev"
 
 msgctxt "model:party.contact_mechanism,name:"
 msgid "Contact Mechanism"
@@ -492,15 +492,15 @@ msgstr "Kontakt"
 
 msgctxt "model:party.party,name:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "model:party.party-party.category,name:"
 msgid "Party - Category"
-msgstr "Stranka - Kategorija"
+msgstr "Partner - Kategorija"
 
 msgctxt "model:res.group,name:group_party_admin"
 msgid "Party Administration"
-msgstr "Stranka - vodenje"
+msgstr "Partner - vodenje"
 
 msgctxt "selection:party.contact_mechanism,type:"
 msgid "E-Mail"
@@ -568,7 +568,7 @@ msgstr "Rezultati sistem za izmenjavo DDV informacij"
 
 msgctxt "view:party.configuration:"
 msgid "Party Configuration"
-msgstr "Konfiguracija strank"
+msgstr "Konfiguracija partnerjev"
 
 msgctxt "view:party.contact_mechanism:"
 msgid "Contact Mechanism"
@@ -588,11 +588,11 @@ msgstr "Splošno"
 
 msgctxt "view:party.party:"
 msgid "Parties"
-msgstr "Stranke"
+msgstr "Partnerji"
 
 msgctxt "view:party.party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "view:party.party:"
 msgid "VAT"
diff --git a/party.py b/party.py
index 3104d4c..2911175 100644
--- a/party.py
+++ b/party.py
@@ -53,9 +53,8 @@ class Party(ModelSQL, ModelView):
         depends=DEPENDS,
         help="Setting VAT country will enable validation of the VAT number.",
         translate=False)
-    vat_code = fields.Function(fields.Char('VAT Code',
-        on_change_with=['vat_number', 'vat_country']), 'get_vat_code',
-        searcher='search_vat_code')
+    vat_code = fields.Function(fields.Char('VAT Code'),
+        'on_change_with_vat_code', searcher='search_vat_code')
     addresses = fields.One2Many('party.address', 'party',
         'Addresses', states=STATES, depends=DEPENDS)
     contact_mechanisms = fields.One2Many('party.contact_mechanism', 'party',
@@ -122,10 +121,8 @@ class Party(ModelSQL, ModelView):
     def get_code_readonly(self, name):
         return True
 
-    def on_change_with_vat_code(self):
-        return (self.vat_country or '') + (self.vat_number or '')
-
-    def get_vat_code(self, name):
+    @fields.depends('vat_country', 'vat_number')
+    def on_change_with_vat_code(self, name=None):
         return (self.vat_country or '') + (self.vat_number or '')
 
     @classmethod
@@ -162,14 +159,19 @@ class Party(ModelSQL, ModelView):
                 config = Configuration(1)
                 values['code'] = Sequence.get_id(config.party_sequence.id)
             values['code_length'] = len(values['code'])
+            values.setdefault('addresses', None)
         return super(Party, cls).create(vlist)
 
     @classmethod
-    def write(cls, parties, vals):
-        if vals.get('code'):
-            vals = vals.copy()
-            vals['code_length'] = len(vals['code'])
-        super(Party, cls).write(parties, vals)
+    def write(cls, *args):
+        actions = iter(args)
+        args = []
+        for parties, values in zip(actions, actions):
+            if values.get('code'):
+                values = values.copy()
+                values['code_length'] = len(values['code'])
+            args.extend((parties, values))
+        super(Party, cls).write(*args)
 
     @classmethod
     def copy(cls, parties, default=None):
@@ -180,13 +182,17 @@ class Party(ModelSQL, ModelView):
         return super(Party, cls).copy(parties, default=default)
 
     @classmethod
-    def search_rec_name(cls, name, clause):
-        parties = cls.search([('code',) + tuple(clause[1:])], order=[])
-        if parties:
-            parties += cls.search([('name',) + tuple(clause[1:])], order=[])
+    def search_global(cls, text):
+        for id_, rec_name, icon in super(Party, cls).search_global(text):
+            icon = icon or 'tryton-party'
+            yield id_, rec_name, icon
 
-            return [('id', 'in', [party.id for party in parties])]
-        return [('name',) + tuple(clause[1:])]
+    @classmethod
+    def search_rec_name(cls, name, clause):
+        return ['OR',
+            ('code',) + tuple(clause[1:]),
+            ('name',) + tuple(clause[1:]),
+            ]
 
     def address_get(self, type=None):
         """
diff --git a/setup.py b/setup.py
index fcfac67..d84ff71 100644
--- a/setup.py
+++ b/setup.py
@@ -11,33 +11,51 @@ import ConfigParser
 def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
+
+def get_require_version(name):
+    if minor_version % 2:
+        require = '%s >= %s.%s.dev0, < %s.%s'
+    else:
+        require = '%s >= %s.%s, < %s.%s'
+    require %= (name, major_version, minor_version,
+        major_version, minor_version + 1)
+    return require
+
 config = ConfigParser.ConfigParser()
 config.readfp(open('tryton.cfg'))
 info = dict(config.items('tryton'))
 for key in ('depends', 'extras_depend', 'xml'):
     if key in info:
         info[key] = info[key].strip().splitlines()
-major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
+version = info.get('version', '0.0.1')
+major_version, minor_version, _ = version.split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
+name = 'trytond_party'
+
+download_url = 'http://downloads.tryton.org/%s.%s/' % (
+    major_version, minor_version)
+if minor_version % 2:
+    version = '%s.%s.dev0' % (major_version, minor_version)
+    download_url = (
+        'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
+            name[8:], name, version))
 
 requires = []
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|webdav)(\W|$)', dep):
-        requires.append('trytond_%s >= %s.%s, < %s.%s' %
-            (dep, major_version, minor_version, major_version,
-                minor_version + 1))
-requires.append('trytond >= %s.%s, < %s.%s' %
-    (major_version, minor_version, major_version, minor_version + 1))
+        requires.append(get_require_version('trytond_%s' % dep))
+requires.append(get_require_version('trytond'))
 
-setup(name='trytond_party',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module with parties and addresses',
     long_description=read('README'),
     author='Tryton',
+    author_email='issue_tracker at tryton.org',
     url='http://www.tryton.org/',
-    download_url=("http://downloads.tryton.org/" +
-        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
+    download_url=download_url,
+    keywords='tryton party',
     package_dir={'trytond.modules.party': '.'},
     packages=[
         'trytond.modules.party',
@@ -68,7 +86,6 @@ setup(name='trytond_party',
         'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         ],
diff --git a/tests/test_party.py b/tests/test_party.py
index 2ac5e86..3d5f04b 100644
--- a/tests/test_party.py
+++ b/tests/test_party.py
@@ -1,13 +1,5 @@
-#!/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.
-import sys
-import os
-DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
-    '..', '..', '..', '..', '..', 'trytond')))
-if os.path.isdir(DIR):
-    sys.path.insert(0, os.path.dirname(DIR))
-
 import unittest
 import trytond.tests.test_tryton
 from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
@@ -16,9 +8,7 @@ from trytond.transaction import Transaction
 
 
 class PartyTestCase(unittest.TestCase):
-    '''
-    Test Party module.
-    '''
+    'Test Party module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('party')
@@ -27,21 +17,15 @@ class PartyTestCase(unittest.TestCase):
         self.address = POOL.get('party.address')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('party')
 
     def test0006depends(self):
-        '''
-        Test depends.
-        '''
+        'Test depends'
         test_depends()
 
     def test0010category(self):
-        '''
-        Create category.
-        '''
+        'Create category'
         with Transaction().start(DB_NAME, USER,
                 context=CONTEXT) as transaction:
             category1, = self.category.create([{
@@ -51,9 +35,7 @@ class PartyTestCase(unittest.TestCase):
             transaction.cursor.commit()
 
     def test0020category_recursion(self):
-        '''
-        Test category recursion.
-        '''
+        'Test category recursion'
         with Transaction().start(DB_NAME, USER, context=CONTEXT):
             category1, = self.category.search([
                 ('name', '=', 'Category 1'),
@@ -71,9 +53,7 @@ class PartyTestCase(unittest.TestCase):
                 })
 
     def test0030party(self):
-        '''
-        Create party.
-        '''
+        'Create party'
         with Transaction().start(DB_NAME, USER,
                 context=CONTEXT) as transaction:
             party1, = self.party.create([{
@@ -83,9 +63,7 @@ class PartyTestCase(unittest.TestCase):
             transaction.cursor.commit()
 
     def test0040party_code(self):
-        '''
-        Test party code constraint.
-        '''
+        'Test party code constraint'
         with Transaction().start(DB_NAME, USER, context=CONTEXT):
             party1, = self.party.search([], limit=1)
 
@@ -101,9 +79,7 @@ class PartyTestCase(unittest.TestCase):
                 })
 
     def test0050address(self):
-        '''
-        Create address.
-        '''
+        'Create address'
         with Transaction().start(DB_NAME, USER, context=CONTEXT):
             party1, = self.party.search([], limit=1)
 
@@ -119,6 +95,3 @@ def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(PartyTestCase))
     return suite
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index 6e07686..c78920a 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.0
+version=3.2.0
 depends:
     country
     ir
diff --git a/trytond_party.egg-info/PKG-INFO b/trytond_party.egg-info/PKG-INFO
index 21ec555..a98f5f2 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.0.0
+Version: 3.2.0
 Summary: Tryton module with parties and addresses
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_party
         =============
         
@@ -43,6 +43,7 @@ Description: trytond_party
         
           http://www.tryton.org/
         
+Keywords: tryton party
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -63,6 +64,5 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/trytond_party.egg-info/requires.txt b/trytond_party.egg-info/requires.txt
index b86a589..83006b9 100644
--- a/trytond_party.egg-info/requires.txt
+++ b/trytond_party.egg-info/requires.txt
@@ -1,5 +1,5 @@
-trytond_country >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
+trytond_country >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
 
 [VAT]
 vatnumber
\ No newline at end of file
-- 
tryton-modules-party



More information about the tryton-debian-vcs mailing list