[tryton-debian-vcs] tryton-modules-stock-package branch debian updated. debian/4.2.0-1-2-g28d131b

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Jun 7 13:36:52 UTC 2017


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-stock-package.git;a=commitdiff;h=debian/4.2.0-1-2-g28d131b

commit 28d131b3c50b503c4ccc10921bbb0710bc5a28c7
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Jun 7 15:27:04 2017 +0200

    Merging upstream version 4.4.0.

diff --git a/CHANGELOG b/CHANGELOG
index 01bf130..6f48157 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 4.4.0 - 2017-05-01
+* Bug fixes (see mercurial logs for details)
+* Check package also when packing shipment
+
 Version 4.2.0 - 2016-11-28
 * Bug fixes (see mercurial logs for details)
 
@@ -15,4 +19,4 @@ Version 3.4.0 - 2014-10-20
 * Bug fixes (see mercurial logs for details)
 
 Version 3.2.0 - 2014-04-21
-* Initial release
\ No newline at end of file
+* Initial release
diff --git a/COPYRIGHT b/COPYRIGHT
index 20bd036..4d643a0 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2013-2016 Cédric Krier.
-Copyright (C) 2013-2016 B2CK SPRL.
+Copyright (C) 2013-2017 Cédric Krier.
+Copyright (C) 2013-2017 B2CK SPRL.
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
diff --git a/PKG-INFO b/PKG-INFO
index afa100e..0688428 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_stock_package
-Version: 4.2.0
+Version: 4.4.0
 Summary: Tryton module for stock packaging
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/4.2/
+Download-URL: http://downloads.tryton.org/4.4/
 Description: trytond_stock_package
         =====================
         
@@ -52,7 +52,7 @@ Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: Intended Audience :: Manufacturing
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
 Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: Catalan
 Classifier: Natural Language :: Chinese (Simplified)
diff --git a/__init__.py b/__init__.py
index 21ba638..01e42a1 100644
--- a/__init__.py
+++ b/__init__.py
@@ -8,6 +8,7 @@ from .stock import *
 def register():
     Pool.register(
         Configuration,
+        ConfigurationSequence,
         Type,
         Package,
         Move,
diff --git a/locale/bg.po b/locale/bg.po
index 9bb50d7..017392f 100644
--- a/locale/bg.po
+++ b/locale/bg.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/ca.po b/locale/ca.po
index ceee9eb..a5a3075 100644
--- a/locale/ca.po
+++ b/locale/ca.po
@@ -3,8 +3,10 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
-msgstr "L'albarà de devolució a proveïdor \"%s\" no està completament empaquetat."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
+msgstr ""
+"No s'han empaquetat tots els moviments de l'albarà de devolució a proveïdor "
+"\"%s\"."
 
 msgctxt "error:stock.shipment.out:"
 msgid "Not all Outgoing Moves of Customer Shipment \"%s\" are packaged."
@@ -14,6 +16,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Seqüència de paquet"
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Seqüència de paquet"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr "Paquet"
diff --git a/locale/cs.po b/locale/cs.po
index bc5c2ca..0585bf5 100644
--- a/locale/cs.po
+++ b/locale/cs.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/de.po b/locale/de.po
index fbfb75c..869fcb4 100644
--- a/locale/de.po
+++ b/locale/de.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 "Es konnten nicht alle ausgehenden Lagerbewegungen der Warenrückgabe \"%s\" "
 "gepackt werden."
@@ -18,6 +18,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Nummernkreis Paket"
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Nummernkreis Paket"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr "Paket"
diff --git a/locale/es.po b/locale/es.po
index ff9fded..5da8a8b 100644
--- a/locale/es.po
+++ b/locale/es.po
@@ -3,10 +3,10 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
-"El albarán de devolución a proveedor \"%s\" no está completamente "
-"empaquetado."
+"No se han empaquetado todos los movimientos del albarán de devolución a "
+"proveedor \"%s\"."
 
 msgctxt "error:stock.shipment.out:"
 msgid "Not all Outgoing Moves of Customer Shipment \"%s\" are packaged."
@@ -16,6 +16,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Secuencia de paquete"
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Secuencia de paquete"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr "Paquete"
diff --git a/locale/es_419.po b/locale/es_419.po
index 1720fec..e1cb4a9 100644
--- a/locale/es_419.po
+++ b/locale/es_419.po
@@ -2,8 +2,9 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+#, fuzzy
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 "No todos los movimientos de salida de devolución al proveedor \"%s\" están "
 "empaquetados."
@@ -18,6 +19,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/fr.po b/locale/fr.po
index a697a2b..c2178e6 100644
--- a/locale/fr.po
+++ b/locale/fr.po
@@ -3,10 +3,10 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
-"Tous les mouvements de sorties du retour d'expédition fournisseur « %s » ne "
-"sont pas emballés."
+"Tous les mouvements du retour d'expédition fournisseur « %s » ne sont pas "
+"emballés."
 
 msgctxt "error:stock.shipment.out:"
 msgid "Not all Outgoing Moves of Customer Shipment \"%s\" are packaged."
@@ -18,6 +18,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Séquence d'emballage"
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Séquence d'emballage"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr "Emballage"
diff --git a/locale/hu_HU.po b/locale/hu_HU.po
index 40af0de..b6efc77 100644
--- a/locale/hu_HU.po
+++ b/locale/hu_HU.po
@@ -2,8 +2,9 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
+#, fuzzy
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr "Nem lehetett az összes elfogyó visszárut  \"%s\" elcsomagolni"
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +15,11 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Csomag számkör"
 
+#, fuzzy
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Csomag számkör"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr "Csomag"
diff --git a/locale/it_IT.po b/locale/it_IT.po
index b704ec7..5c62d7c 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/ja_JP.po b/locale/ja_JP.po
index 8e4c8b4..f3670cb 100644
--- a/locale/ja_JP.po
+++ b/locale/ja_JP.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/lo.po b/locale/lo.po
index 37aa12f..77f2b3f 100644
--- a/locale/lo.po
+++ b/locale/lo.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/lt.po b/locale/lt.po
index bc5c2ca..0585bf5 100644
--- a/locale/lt.po
+++ b/locale/lt.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/nl.po b/locale/nl.po
index 9803797..63609ba 100644
--- a/locale/nl.po
+++ b/locale/nl.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/pl.po b/locale/pl.po
index 8e4c8b4..f3670cb 100644
--- a/locale/pl.po
+++ b/locale/pl.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index 3e7cb87..3f74200 100644
--- a/locale/pt_BR.po
+++ b/locale/pt_BR.po
@@ -3,10 +3,10 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
-"Nem todas as Movimentações de Saída de Remessas de Retorno de Fornecedor "
-"\"%s\" estão embalados."
+"Nem todas as Movimentações de Retorno de Remessas \"%s\" do Fornecedor estão"
+" embalados."
 
 msgctxt "error:stock.shipment.out:"
 msgid "Not all Outgoing Moves of Customer Shipment \"%s\" are packaged."
@@ -18,9 +18,13 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Sequência das Embalagens"
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Sequência dos Pacotes"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
-msgstr "Embalagem"
+msgstr "Pacote"
 
 msgctxt "field:stock.package,children:"
 msgid "Children"
@@ -136,15 +140,15 @@ msgstr "Tipos de Pacote"
 
 msgctxt "model:stock.package,name:"
 msgid "Stock Package"
-msgstr "Embalagem de Estoque"
+msgstr "Estoque de Pacote"
 
 msgctxt "model:stock.package.type,name:"
 msgid "Stock Package Type"
-msgstr "Tipo de Pacote de Estoque"
+msgstr "Tipo de Estoque de Pacote"
 
 msgctxt "report:stock.package.label:"
 msgid "Package:"
-msgstr "Embalagem:"
+msgstr "Pacote:"
 
 msgctxt "report:stock.package.label:"
 msgid "Shipment:"
@@ -152,15 +156,15 @@ msgstr "Remessa:"
 
 msgctxt "view:stock.package.type:"
 msgid "Package Type"
-msgstr "Tipos de embalagem"
+msgstr "Tipo de Pacote"
 
 msgctxt "view:stock.package.type:"
 msgid "Package Types"
-msgstr "Tipos de Pacotes"
+msgstr "Tipo de Pacote"
 
 msgctxt "view:stock.package:"
 msgid "Package"
-msgstr "Embalagem"
+msgstr "Pacote"
 
 msgctxt "view:stock.package:"
 msgid "Packages"
diff --git a/locale/ru.po b/locale/ru.po
index 50af59d..5716a85 100644
--- a/locale/ru.po
+++ b/locale/ru.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/locale/sl.po b/locale/sl.po
index 9e5d5b5..0ca3c7c 100644
--- a/locale/sl.po
+++ b/locale/sl.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr "Izhodni promet vrnjene prevzemnice \"%s\" ni v celoti zapakiran."
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr "Štetje paketov"
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr "Štetje paketov"
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr "Paket"
diff --git a/locale/zh_CN.po b/locale/zh_CN.po
index d9e6409..bd25988 100644
--- a/locale/zh_CN.po
+++ b/locale/zh_CN.po
@@ -3,7 +3,7 @@ msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "error:stock.shipment.in.return:"
-msgid "Not all Outgoing Moves of Supplier Return Shipment \"%s\" are packaged."
+msgid "Not all Moves of Supplier Return Shipment \"%s\" are packaged."
 msgstr ""
 
 msgctxt "error:stock.shipment.out:"
@@ -14,6 +14,10 @@ msgctxt "field:stock.configuration,package_sequence:"
 msgid "Package Sequence"
 msgstr ""
 
+msgctxt "field:stock.configuration.sequence,package_sequence:"
+msgid "Package Sequence"
+msgstr ""
+
 msgctxt "field:stock.move,package:"
 msgid "Package"
 msgstr ""
diff --git a/setup.py b/setup.py
index ea8dbe9..58e23b2 100644
--- a/setup.py
+++ b/setup.py
@@ -86,7 +86,7 @@ setup(name=name,
         'Intended Audience :: Financial and Insurance Industry',
         'Intended Audience :: Legal Industry',
         'Intended Audience :: Manufacturing',
-        'License :: OSI Approved :: GNU General Public License (GPL)',
+        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
         'Natural Language :: Bulgarian',
         'Natural Language :: Catalan',
         'Natural Language :: Chinese (Simplified)',
diff --git a/stock.py b/stock.py
index 4ebd5ae..4f774f6 100644
--- a/stock.py
+++ b/stock.py
@@ -1,23 +1,77 @@
 # 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 import backend
 from trytond.model import ModelSQL, ModelView, Workflow, fields
 from trytond.pool import Pool, PoolMeta
 from trytond.pyson import Eval
 from trytond.report import Report
 
-__all__ = ['Configuration', 'Package', 'Type', 'Move',
+__all__ = ['Configuration', 'ConfigurationSequence', 'Package', 'Type', 'Move',
     'ShipmentOut', 'ShipmentInReturn', 'PackageLabel']
 
 
 class Configuration:
     __metaclass__ = PoolMeta
     __name__ = 'stock.configuration'
-    package_sequence = fields.Property(fields.Many2One('ir.sequence',
-            'Package Sequence', domain=[
+    package_sequence = fields.MultiValue(fields.Many2One(
+            'ir.sequence', "Package Sequence", required=True,
+            domain=[
                 ('company', 'in', [Eval('context', {}).get('company'), None]),
                 ('code', '=', 'stock.package'),
-                ], required=True))
+                ]))
+
+    @classmethod
+    def multivalue_model(cls, field):
+        pool = Pool()
+        if field == 'package_sequence':
+            return pool.get('stock.configuration.sequence')
+        return super(Configuration, cls).multivalue_model(field)
+
+    @classmethod
+    def default_package_sequence(cls, **pattern):
+        return cls.multivalue_model(
+            'package_sequence').default_package_sequence()
+
+
+class ConfigurationSequence:
+    __metaclass__ = PoolMeta
+    __name__ = 'stock.configuration.sequence'
+    package_sequence = fields.Many2One(
+        'ir.sequence', "Package Sequence", required=True,
+        domain=[
+            ('company', 'in', [Eval('company', -1), None]),
+            ('code', '=', 'stock.package'),
+            ],
+        depends=['company'])
+
+    @classmethod
+    def __register__(cls, module_name):
+        TableHandler = backend.get('TableHandler')
+        exist = TableHandler.table_exist(cls._table)
+        if exist:
+            table = TableHandler(cls, module_name)
+            exist &= table.column_exist('package_sequence')
+
+        super(ConfigurationSequence, cls).__register__(module_name)
+
+        if not exist:
+            cls._migrate_property([], [], [])
+
+    @classmethod
+    def _migrate_property(cls, field_names, value_names, fields):
+        field_names.append('package_sequence')
+        value_names.append('package_sequence')
+        super(ConfigurationSequence, cls)._migrate_property(
+            field_names, value_names, fields)
+
+    @classmethod
+    def default_package_sequence(cls):
+        pool = Pool()
+        ModelData = pool.get('ir.model.data')
+        try:
+            return ModelData.get_id('stock_package', 'sequence_package')
+        except KeyError:
+            return None
 
 
 class Package(ModelSQL, ModelView):
@@ -115,6 +169,19 @@ class PackageMixin(object):
                 'packages': value,
                 })
 
+    @classmethod
+    def check_packages(cls, shipments):
+        for shipment in shipments:
+            if not shipment.packages:
+                continue
+            length = sum(len(p.moves) for p in shipment.packages)
+            if len(shipment.packages_moves) != length:
+                cls.raise_user_error('package_mismatch', shipment.rec_name)
+
+    @property
+    def packages_moves(self):
+        raise NotImplementedError
+
 
 class ShipmentOut(PackageMixin, object):
     __metaclass__ = PoolMeta
@@ -130,15 +197,21 @@ class ShipmentOut(PackageMixin, object):
 
     @classmethod
     @ModelView.button
+    @Workflow.transition('packed')
+    def pack(cls, shipments):
+        super(ShipmentOut, cls).pack(shipments)
+        cls.check_packages(shipments)
+
+    @classmethod
+    @ModelView.button
     @Workflow.transition('done')
     def done(cls, shipments):
         super(ShipmentOut, cls).done(shipments)
-        for shipment in shipments:
-            if not shipment.packages:
-                continue
-            if (len(shipment.outgoing_moves)
-                    != sum(len(p.moves) for p in shipment.packages)):
-                cls.raise_user_error('package_mismatch', shipment.rec_name)
+        cls.check_packages(shipments)
+
+    @property
+    def packages_moves(self):
+        return self.outgoing_moves
 
 
 class ShipmentInReturn(PackageMixin, object):
@@ -149,7 +222,7 @@ class ShipmentInReturn(PackageMixin, object):
     def __setup__(cls):
         super(ShipmentInReturn, cls).__setup__()
         cls._error_messages.update({
-                'package_mismatch': ('Not all Outgoing Moves of '
+                'package_mismatch': ('Not all Moves of '
                     'Supplier Return Shipment "%s" are packaged.'),
                 })
 
@@ -158,12 +231,11 @@ class ShipmentInReturn(PackageMixin, object):
     @Workflow.transition('done')
     def done(cls, shipments):
         super(ShipmentInReturn, cls).done(shipments)
-        for shipment in shipments:
-            if not shipment.packages:
-                continue
-            if (len(shipment.moves)
-                    != sum(len(p.moves) for p in shipment.packages)):
-                cls.raise_user_error('package_mismatch', shipment.rec_name)
+        cls.check_packages(shipments)
+
+    @property
+    def packages_moves(self):
+        return self.moves
 
 
 class PackageLabel(Report):
diff --git a/stock.xml b/stock.xml
index d2c59cb..67f5836 100644
--- a/stock.xml
+++ b/stock.xml
@@ -145,12 +145,4 @@ this repository contains the full copyright notices and license terms. -->
         </record>
 
     </data>
-    <data noupdate="1">
-        <record model="ir.property" id="property_package_sequence">
-            <field name="field"
-                search="[('model.model', '=', 'stock.configuration'), ('name', '=', 'package_sequence')]"/>
-            <field name="value"
-                eval="'ir.sequence,' + str(ref('sequence_package'))"/>
-        </record>
-    </data>
 </tryton>
diff --git a/tests/scenario_stock_package.rst b/tests/scenario_stock_package.rst
index d2c19c2..617a13b 100644
--- a/tests/scenario_stock_package.rst
+++ b/tests/scenario_stock_package.rst
@@ -83,7 +83,6 @@ Pack shipment::
 
     >>> shipment_out.click('wait')
     >>> shipment_out.click('assign_force')
-    >>> shipment_out.click('pack')
 
 Package products::
 
@@ -96,7 +95,7 @@ Package products::
     2
     >>> package1.moves.append(moves[0])
 
-    >>> shipment_out.click('done')  # doctest: +IGNORE_EXCEPTION_DETAIL
+    >>> shipment_out.click('pack')  # doctest: +IGNORE_EXCEPTION_DETAIL
     Traceback (most recent call last):
         ...
     UserError: ...
@@ -107,4 +106,4 @@ Package products::
     1
     >>> package2.moves.append(moves[0])
 
-    >>> shipment_out.click('done')
+    >>> shipment_out.click('pack')
diff --git a/tryton.cfg b/tryton.cfg
index 7ce498b..f847396 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.2.0
+version=4.4.0
 depends:
     ir
     res
diff --git a/trytond_stock_package.egg-info/PKG-INFO b/trytond_stock_package.egg-info/PKG-INFO
index d5f7a48..dd3bb3d 100644
--- a/trytond_stock_package.egg-info/PKG-INFO
+++ b/trytond_stock_package.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-stock-package
-Version: 4.2.0
+Version: 4.4.0
 Summary: Tryton module for stock packaging
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/4.2/
+Download-URL: http://downloads.tryton.org/4.4/
 Description: trytond_stock_package
         =====================
         
@@ -52,7 +52,7 @@ Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: Intended Audience :: Manufacturing
-Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
 Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: Catalan
 Classifier: Natural Language :: Chinese (Simplified)
diff --git a/trytond_stock_package.egg-info/requires.txt b/trytond_stock_package.egg-info/requires.txt
index d2cdcba..e771890 100644
--- a/trytond_stock_package.egg-info/requires.txt
+++ b/trytond_stock_package.egg-info/requires.txt
@@ -1,2 +1,2 @@
-trytond_stock >= 4.2, < 4.3
-trytond >= 4.2, < 4.3
+trytond_stock >= 4.4, < 4.5
+trytond >= 4.4, < 4.5
diff --git a/view/shipment_in_return_form.xml b/view/shipment_in_return_form.xml
index ba896ba..20332f6 100644
--- a/view/shipment_in_return_form.xml
+++ b/view/shipment_in_return_form.xml
@@ -2,7 +2,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. -->
 <data>
-    <xpath expr="/form/field[@name='moves']" position="after">
+    <xpath expr="//field[@name='moves']" position="after">
         <field name="root_packages" colspan="4"
             view_ids="stock_package.package_view_tree"/>
     </xpath>
-- 
tryton-modules-stock-package



More information about the tryton-debian-vcs mailing list