[tryton-debian-vcs] tryton-modules-stock-product-location branch debian updated. debian/4.2.0-1-2-ge0ae364

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Jun 7 13:37:08 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-product-location.git;a=commitdiff;h=debian/4.2.0-1-2-ge0ae364

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

    Merging upstream version 4.4.0.

diff --git a/CHANGELOG b/CHANGELOG
index e103387..3aa64ff 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 4.4.0 - 2017-05-01
+* Bug fixes (see mercurial logs for details)
+* Use MatchMixin for ProductLocation
+
 Version 4.2.0 - 2016-11-28
 * Bug fixes (see mercurial logs for details)
 * Use product default location for production outputs
diff --git a/COPYRIGHT b/COPYRIGHT
index 808b71b..1474fa9 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2016 Cédric Krier.
+Copyright (C) 2008-2017 Cédric Krier.
 Copyright (C) 2008-2012 Bertrand Chenal.
-Copyright (C) 2008-2016 B2CK SPRL.
+Copyright (C) 2008-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 c878d95..7bba285 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_stock_product_location
-Version: 4.2.0
+Version: 4.4.0
 Summary: Tryton module to add default location on product
 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_product_location
         ==============================
         
@@ -51,7 +51,7 @@ Classifier: Framework :: Tryton
 Classifier: Intended Audience :: Developers
 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 6a41c60..b52e832 100644
--- a/__init__.py
+++ b/__init__.py
@@ -12,6 +12,7 @@ def register():
         Product,
         ProductLocation,
         production.Production,
+        Move,
         ShipmentIn,
         ShipmentOutReturn,
         module='stock_product_location', type_='model')
diff --git a/locale/es_419.po b/locale/es_419.po
index 49e2fa1..ed9ec4f 100644
--- a/locale/es_419.po
+++ b/locale/es_419.po
@@ -12,7 +12,7 @@ msgstr ""
 
 msgctxt "field:stock.product.location,create_uid:"
 msgid "Create User"
-msgstr "Creado por usuario"
+msgstr ""
 
 msgctxt "field:stock.product.location,id:"
 msgid "ID"
@@ -44,7 +44,7 @@ msgstr ""
 
 msgctxt "field:stock.product.location,write_uid:"
 msgid "Write User"
-msgstr "Modificado por usuario"
+msgstr ""
 
 msgctxt "model:stock.product.location,name:"
 msgid "Product Location"
diff --git a/locale/lo.po b/locale/lo.po
index 3168234..8708f0c 100644
--- a/locale/lo.po
+++ b/locale/lo.po
@@ -4,56 +4,48 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:product.product,locations:"
 msgid "Default Locations"
-msgstr ""
+msgstr "ບ່ອນເກັບມ້ຽນເດີມ"
 
-#, fuzzy
 msgctxt "field:stock.product.location,create_date:"
 msgid "Create Date"
-msgstr "ສ້າງວັນທີ"
+msgstr "ວັນທີສ້າງ"
 
-#, fuzzy
 msgctxt "field:stock.product.location,create_uid:"
 msgid "Create User"
-msgstr "ສ້າງຜູ້ໃຊ້ງານ"
+msgstr "ຜູ້ສ້າງ"
 
-#, fuzzy
 msgctxt "field:stock.product.location,id:"
 msgid "ID"
-msgstr "ເລດລຳດັບ"
+msgstr "ເລກລຳດັບ"
 
 msgctxt "field:stock.product.location,location:"
 msgid "Storage Location"
-msgstr ""
+msgstr "ບ່ອນເກັບມ້ຽນ"
 
-#, fuzzy
 msgctxt "field:stock.product.location,product:"
 msgid "Product"
 msgstr "ຜະລິດຕະພັນ"
 
-#, fuzzy
 msgctxt "field:stock.product.location,rec_name:"
 msgid "Name"
 msgstr "ຊື່"
 
-#, fuzzy
 msgctxt "field:stock.product.location,sequence:"
 msgid "Sequence"
 msgstr "ລໍາດັບ"
 
 msgctxt "field:stock.product.location,warehouse:"
 msgid "Warehouse"
-msgstr ""
+msgstr "ສາງໃຫຍ່"
 
-#, fuzzy
 msgctxt "field:stock.product.location,write_date:"
 msgid "Write Date"
 msgstr "ວັນທີບັນທຶກ"
 
-#, fuzzy
 msgctxt "field:stock.product.location,write_uid:"
 msgid "Write User"
-msgstr "ສ້າງຜູ້ໃຊ້"
+msgstr "ຜູ້ບັນທຶກ"
 
 msgctxt "model:stock.product.location,name:"
 msgid "Product Location"
-msgstr ""
+msgstr "ບ່ອນເກັບມ້ຽນຜະລິດຕະພັນ"
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index d3e6c75..52034e5 100644
--- a/locale/pt_BR.po
+++ b/locale/pt_BR.po
@@ -36,7 +36,7 @@ msgstr "Sequência"
 
 msgctxt "field:stock.product.location,warehouse:"
 msgid "Warehouse"
-msgstr "Armazém"
+msgstr "Almoxarifado"
 
 msgctxt "field:stock.product.location,write_date:"
 msgid "Write Date"
diff --git a/location.py b/location.py
index 3cbfdb9..9e3c9d6 100644
--- a/location.py
+++ b/location.py
@@ -1,14 +1,15 @@
 # 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, sequence_ordered
+from trytond.model import (ModelView, ModelSQL, MatchMixin, fields,
+    sequence_ordered)
 from trytond.pyson import If, Eval, Bool
 from trytond import backend
 from trytond.pool import PoolMeta
 
-__all__ = ['ProductLocation', 'ShipmentIn', 'ShipmentOutReturn']
+__all__ = ['ProductLocation', 'Move', 'ShipmentIn', 'ShipmentOutReturn']
 
 
-class ProductLocation(sequence_ordered(), ModelSQL, ModelView):
+class ProductLocation(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
     '''
     Product Location
     It defines the default storage location by warehouse for a product.
@@ -37,6 +38,21 @@ class ProductLocation(sequence_ordered(), ModelSQL, ModelView):
         table.not_null_action('sequence', action='remove')
 
 
+class Move:
+    __metaclass__ = PoolMeta
+    __name__ = 'stock.move'
+
+    def set_product_location(self, field='to_location', **pattern):
+        assert field in {'from_location', 'to_location'}
+        if getattr(self, 'shipment', None):
+            pattern.setdefault('warehouse', self.shipment.warehouse.id)
+
+        for product_location in self.product.locations:
+            if product_location.match(pattern):
+                setattr(self, field, product_location.location)
+                break
+
+
 class ShipmentIn:
     __metaclass__ = PoolMeta
     __name__ = 'stock.shipment.in'
@@ -45,11 +61,8 @@ class ShipmentIn:
     def _get_inventory_moves(cls, incoming_move):
         move = super(ShipmentIn, cls)._get_inventory_moves(incoming_move)
         if move:
-            for product_location in incoming_move.product.locations:
-                if product_location.warehouse.id != \
-                        incoming_move.shipment.warehouse.id:
-                    continue
-                move.to_location = product_location.location
+            move.set_product_location(
+                warehouse=incoming_move.shipment.warehouse.id)
         return move
 
 
@@ -62,8 +75,6 @@ class ShipmentOutReturn:
         move = super(ShipmentOutReturn, cls)._get_inventory_moves(
             incoming_move)
         if move:
-            for product_location in incoming_move.product.locations:
-                if (product_location.warehouse
-                        == incoming_move.shipment.warehouse):
-                    move.to_location = product_location.location
+            move.set_product_location(
+                warehouse=incoming_move.shipment.warehouse.id)
         return move
diff --git a/setup.py b/setup.py
index ff81019..6a96bff 100644
--- a/setup.py
+++ b/setup.py
@@ -87,7 +87,7 @@ setup(name=name,
         'Intended Audience :: Developers',
         '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/tests/scenario_stock_product_location_production.rst b/tests/scenario_stock_product_location_production.rst
index fcee626..27a4aed 100644
--- a/tests/scenario_stock_product_location_production.rst
+++ b/tests/scenario_stock_product_location_production.rst
@@ -45,6 +45,7 @@ Create product::
     >>> template.name = 'product'
     >>> template.default_uom = unit
     >>> template.type = 'goods'
+    >>> template.producible = True
     >>> template.list_price = Decimal(30)
     >>> template.cost_price = Decimal(20)
     >>> template.save()
diff --git a/tryton.cfg b/tryton.cfg
index fc73fb5..b83ee9d 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.2.0
+version=4.4.0
 depends:
     ir
     product
diff --git a/trytond_stock_product_location.egg-info/PKG-INFO b/trytond_stock_product_location.egg-info/PKG-INFO
index 5c2eb5e..e45e3f8 100644
--- a/trytond_stock_product_location.egg-info/PKG-INFO
+++ b/trytond_stock_product_location.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-stock-product-location
-Version: 4.2.0
+Version: 4.4.0
 Summary: Tryton module to add default location on product
 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_product_location
         ==============================
         
@@ -51,7 +51,7 @@ Classifier: Framework :: Tryton
 Classifier: Intended Audience :: Developers
 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_product_location.egg-info/requires.txt b/trytond_stock_product_location.egg-info/requires.txt
index b8880b2..5eb4fb5 100644
--- a/trytond_stock_product_location.egg-info/requires.txt
+++ b/trytond_stock_product_location.egg-info/requires.txt
@@ -1,4 +1,4 @@
 python-sql >= 0.4
-trytond_product >= 4.2, < 4.3
-trytond_stock >= 4.2, < 4.3
-trytond >= 4.2, < 4.3
+trytond_product >= 4.4, < 4.5
+trytond_stock >= 4.4, < 4.5
+trytond >= 4.4, < 4.5
-- 
tryton-modules-stock-product-location



More information about the tryton-debian-vcs mailing list