[tryton-debian-vcs] tryton-modules-stock-supply-production branch debian updated. debian/3.2.0-1-5-g7f4bc35

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Oct 23 12:19:17 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-stock-supply-production.git;a=commitdiff;h=debian/3.2.0-1-5-g7f4bc35

commit 7f4bc356911687f28ef0a502e9ec9406dec2d264
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Oct 23 13:32:11 2014 +0200

    Releasing debian version 3.4.0-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index b5e63d0..ff52e14 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+tryton-modules-stock-supply-production (3.4.0-1) unstable; urgency=medium
+
+  * Updating signing key while using now plain .asc files instead of .pgp
+    binaries.
+  * Adding actual upstream signing key.
+  * Updating to Standards-Version: 3.9.6, no changes needed.
+  * Merging upstream version 3.4.0.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Tue, 21 Oct 2014 20:24:38 +0200
+
 tryton-modules-stock-supply-production (3.2.0-1) unstable; urgency=medium
 
   * Removing  LC_ALL=C.UTF-8 as build environment.
commit 7a8ff2600463b7d24399ee2c85940b75160c5fa2
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Oct 21 11:29:24 2014 +0200

    Merging upstream version 3.4.0.

diff --git a/CHANGELOG b/CHANGELOG
index e5f2927..4f5e9d1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 3.4.0 - 2014-10-20
+* Bug fixes (see mercurial logs for details)
+* Allow to calculate production requests filtered by warehouse
+
 Version 3.2.0 - 2014-04-21
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 09988ff..c5fed2b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_stock_supply_production
-Version: 3.2.0
+Version: 3.4.0
 Summary: Tryton module for stock supply of production
 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.2/
+Download-URL: http://downloads.tryton.org/3.4/
 Description: trytond_stock_supply_production
         ===============================
         
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index d1430c6..2438955 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -24,6 +24,12 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr ""
 
+#, fuzzy
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Управление на производство"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr ""
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index a31f75c..13e7536 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Crea sol·licituds de producció"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Producció"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Creació sol·licituds de producció"
@@ -48,7 +53,7 @@ msgstr "Crea sol·licituds de producció"
 
 msgctxt "view:production.create_request.start:"
 msgid "Create Production Requests?"
-msgstr ""
+msgstr "Voleu crear les sol·licituds de producció?"
 
 msgctxt "wizard_button:production.create_request,start,create_:"
 msgid "Create"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index ea27b90..e99c332 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr ""
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr ""
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 090f61d..d87c789 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -4,7 +4,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:production.configuration,supply_period:"
 msgid "Supply Period"
-msgstr "Auslieferungszeitraum"
+msgstr "Beschaffungszeitraum"
 
 msgctxt "field:production.create_request.start,id:"
 msgid "ID"
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Produktionsanforderungen erstellen"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Produktion"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Erstellen von Produktionsanforderungen"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 6a43613..74c3563 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Crear solicitudes de producción"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Producción"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Generar solicitudes de producción"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 127a771..090a485 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Crear Ordenes de Producción"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Producción"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Generar Ordenes de Producción"
diff --git a/locale/es_CO.po b/locale/es_EC.po
similarity index 73%
copy from locale/es_CO.po
copy to locale/es_EC.po
index 127a771..1799ac2 100644
--- a/locale/es_CO.po
+++ b/locale/es_EC.po
@@ -16,27 +16,32 @@ msgstr "En número de días"
 
 msgctxt "model:ir.action,name:act_production_request"
 msgid "Request Productions"
-msgstr "Órdenes de Producción"
+msgstr "Solicitudes de Producción"
 
 msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
-msgstr "Crear Ordenes de Producción"
+msgstr "Crear Solicitudes de Producción"
+
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Producción"
 
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
-msgstr "Generar Ordenes de Producción"
+msgstr "Generar Solicitudes de Producción"
 
 msgctxt "model:ir.ui.menu,name:menu_production_request_create"
 msgid "Create Production Requests"
-msgstr "Crear Ordenes de Producción"
+msgstr "Crear Solicitudes de Producción"
 
 msgctxt "model:production.create_request.start,name:"
 msgid "Create Production Request"
-msgstr "Crear Orden de Producción"
+msgstr "Crear Solicitud de Producción"
 
 msgctxt "model:res.user,name:user_generate_request"
 msgid "Cron Production Request"
-msgstr "Cron Orden de Producción"
+msgstr "Programador de Solicitudes de Producción"
 
 msgctxt "selection:stock.order_point,type:"
 msgid "Production"
@@ -44,11 +49,11 @@ msgstr "Producción"
 
 msgctxt "view:production.create_request.start:"
 msgid "Create Production Requests"
-msgstr "Crear Ordenes de Producción"
+msgstr "Crear Solicitudes de Producción"
 
 msgctxt "view:production.create_request.start:"
 msgid "Create Production Requests?"
-msgstr "Crear Ordenes de Producción?"
+msgstr "¿Crear las Solicitudes de Producción?"
 
 msgctxt "wizard_button:production.create_request,start,create_:"
 msgid "Create"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 8797fc3..76b72a7 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Crear solicitudes de producción"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Producción"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Generar solicitudes de producción"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 1eaff94..f5a37af 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Créer les demandes de production"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Production"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Générer les demandes de production"
@@ -48,7 +53,7 @@ msgstr "Créer les demandes de production"
 
 msgctxt "view:production.create_request.start:"
 msgid "Create Production Requests?"
-msgstr "Créer les demandes de production ?"
+msgstr "Créer les demandes de production ?"
 
 msgctxt "wizard_button:production.create_request,start,create_:"
 msgid "Create"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index fe6ac0a..24dfacb 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr ""
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr ""
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr ""
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index b589084..72b37bc 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -24,6 +24,12 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr ""
 
+#, fuzzy
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Производство"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr ""
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index 315f58b..0c09593 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -22,6 +22,11 @@ msgctxt "model:ir.action,name:act_production_request_create"
 msgid "Create Production Requests"
 msgstr "Izdelava proizvodnih zahtevkov"
 
+msgctxt ""
+"model:ir.action.act_window.domain,name:act_order_point_form_domain_production"
+msgid "Production"
+msgstr "Proizvodnja"
+
 msgctxt "model:ir.cron,name:cron_generate_request"
 msgid "Generate Production Requests"
 msgstr "Izdelava proizvodnih zahtevkov"
@@ -42,18 +47,17 @@ msgctxt "selection:stock.order_point,type:"
 msgid "Production"
 msgstr "Proizvodni nalog"
 
-#, fuzzy
 msgctxt "view:production.create_request.start:"
 msgid "Create Production Requests"
 msgstr "Izdelava proizvodnih zahtevkov"
 
 msgctxt "view:production.create_request.start:"
 msgid "Create Production Requests?"
-msgstr ""
+msgstr "Izdelava proizvodnih zahtevkov?"
 
 msgctxt "wizard_button:production.create_request,start,create_:"
 msgid "Create"
-msgstr "Ustvari"
+msgstr "Izdelaj"
 
 msgctxt "wizard_button:production.create_request,start,end:"
 msgid "Cancel"
diff --git a/production.py b/production.py
index 338334b..cd6ebc1 100644
--- a/production.py
+++ b/production.py
@@ -7,6 +7,7 @@ from trytond.model import ModelView, fields
 from trytond.pool import Pool, PoolMeta
 from trytond.transaction import Transaction
 from trytond.wizard import Wizard, StateView, StateAction, Button
+from trytond.tools import grouped_slice
 
 __all__ = ['Configuration', 'Production',
     'CreateProductionRequestStart', 'CreateProductionRequest']
@@ -27,12 +28,15 @@ class Production:
     __name__ = 'production'
 
     @classmethod
-    def generate_requests(cls, clean=True):
+    def generate_requests(cls, clean=True, warehouses=None):
         """
         For each product compute the production request that must be created
         today to meet product outputs.
 
         If clean is set, it will remove all previous requests.
+
+        If warehouses is specified it will compute the production requests
+        only for the selected warehouses.
         """
         pool = Pool()
         OrderPoint = pool.get('stock.order_point')
@@ -48,10 +52,11 @@ class Production:
                     ])
             cls.delete(reqs)
 
-        # fetch warehouse
-        warehouses = Location.search([
-                ('type', '=', 'warehouse'),
-                ])
+        if warehouses is None:
+            # fetch warehouse
+            warehouses = Location.search([
+                    ('type', '=', 'warehouse'),
+                    ])
         warehouse_ids = [w.id for w in warehouses]
         # fetch order points
         order_points = OrderPoint.search([
@@ -71,19 +76,19 @@ class Production:
                 ('purchasable', '=', False),
                 ])
         # compute requests
-        cursor = Transaction().cursor
         today = Date.today()
         requests = []
-        for i in range(0, len(products), cursor.IN_MAX):
-            product_ids = [p.id for p in products[i:i + cursor.IN_MAX]]
+        for sub_products in grouped_slice(products):
+            sub_products = list(sub_products)
+            product_ids = [p.id for p in sub_products]
             with Transaction().set_context(forecast=True,
                     stock_date_end=today):
                 pbl = Product.products_by_location(warehouse_ids,
                     product_ids, with_childs=True)
 
             # order product by supply period
-            products_period = sorted([(p.get_supply_period(), p)
-                    for p in products[i:i + cursor.IN_MAX]])
+            products_period = sorted((p.get_supply_period(), p)
+                for p in sub_products)
 
             for warehouse in warehouses:
                 quantities = dict((x, pbl.pop((warehouse.id, x), 0))
@@ -91,7 +96,7 @@ class Production:
                 shortages = cls.get_shortage(warehouse.id, product_ids, today,
                     quantities, products_period, product2ops)
 
-                for product in products[i:i + cursor.IN_MAX]:
+                for product in sub_products:
                     for date, quantity in shortages[product.id]:
                         req = cls.compute_request(product, warehouse,
                             quantity, date, company)
@@ -99,7 +104,7 @@ class Production:
                         req.set_moves()
                         requests.append(req)
         if requests:
-            cls.generate_requests(clean=False)
+            cls.generate_requests(False, warehouses)
         return requests
 
     @classmethod
@@ -172,15 +177,6 @@ class Production:
                     shortages[product_id].append((current_date, quantity))
                     current_qties[product_id] += quantity
 
-            # Update current quantities
-            with Transaction().set_context(stock_date_start=current_date,
-                    stock_date_end=current_date):
-                pbl = Product.products_by_location([location_id],
-                    product_ids, with_childs=True)
-            for key, qty in pbl.iteritems():
-                _, product_id = key
-                current_qties[product_id] += qty
-
             # Remove product with smaller period
             while (products_period
                     and products_period[0][0] <= (current_date - date).days):
@@ -188,6 +184,16 @@ class Production:
                 product_ids.remove(product.id)
             current_date += datetime.timedelta(1)
 
+            # Update current quantities with next moves
+            with Transaction().set_context(forecast=True,
+                    stock_date_start=current_date,
+                    stock_date_end=current_date):
+                pbl = Product.products_by_location([location_id],
+                    product_ids, with_childs=True)
+            for key, qty in pbl.iteritems():
+                _, product_id = key
+                current_qties[product_id] += qty
+
         return shortages
 
 
@@ -206,10 +212,14 @@ class CreateProductionRequest(Wizard):
             ])
     create_ = StateAction('stock_supply_production.act_production_request')
 
+    @property
+    def _requests_parameters(self):
+        return {}
+
     def do_create_(self, action):
         pool = Pool()
         Production = pool.get('production')
-        Production.generate_requests()
+        Production.generate_requests(**self._requests_parameters)
         return action, {}
 
     def transition_create_(self):
diff --git a/stock.xml b/stock.xml
new file mode 100644
index 0000000..d718449
--- /dev/null
+++ b/stock.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tryton>
+    <data>
+        <record model="ir.action.act_window.domain"
+                id="act_order_point_form_domain_production">
+            <field name="name">Production</field>
+            <field name="sequence" eval="30"/>
+            <field name="domain">[('type', '=', 'production')]</field>
+            <field name="act_window" ref="stock_supply.act_order_point_form"/>
+        </record>
+    </data>
+</tryton>
diff --git a/tryton.cfg b/tryton.cfg
index dc3b837..4292f0e 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.2.0
+version=3.4.0
 depends:
     ir
     product
@@ -8,3 +8,4 @@ depends:
     stock_supply
 xml:
     production.xml
+    stock.xml
diff --git a/trytond_stock_supply_production.egg-info/PKG-INFO b/trytond_stock_supply_production.egg-info/PKG-INFO
index c42d023..fbbb848 100644
--- a/trytond_stock_supply_production.egg-info/PKG-INFO
+++ b/trytond_stock_supply_production.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-stock-supply-production
-Version: 3.2.0
+Version: 3.4.0
 Summary: Tryton module for stock supply of production
 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.2/
+Download-URL: http://downloads.tryton.org/3.4/
 Description: trytond_stock_supply_production
         ===============================
         
diff --git a/trytond_stock_supply_production.egg-info/SOURCES.txt b/trytond_stock_supply_production.egg-info/SOURCES.txt
index 31a2da8..ebde8a4 100644
--- a/trytond_stock_supply_production.egg-info/SOURCES.txt
+++ b/trytond_stock_supply_production.egg-info/SOURCES.txt
@@ -6,13 +6,31 @@ MANIFEST.in
 README
 production.xml
 setup.py
+stock.xml
 tryton.cfg
 ./__init__.py
 ./product.py
 ./production.py
+./production.xml
 ./stock.py
+./stock.xml
+./tryton.cfg
+./locale/bg_BG.po
+./locale/ca_ES.po
+./locale/cs_CZ.po
+./locale/de_DE.po
+./locale/es_AR.po
+./locale/es_CO.po
+./locale/es_EC.po
+./locale/es_ES.po
+./locale/fr_FR.po
+./locale/nl_NL.po
+./locale/ru_RU.po
+./locale/sl_SI.po
 ./tests/__init__.py
 ./tests/test_stock_supply_production.py
+./view/production_configuration_form.xml
+./view/production_create_request_start_form.xml
 doc/index.rst
 locale/bg_BG.po
 locale/ca_ES.po
@@ -20,6 +38,7 @@ locale/cs_CZ.po
 locale/de_DE.po
 locale/es_AR.po
 locale/es_CO.po
+locale/es_EC.po
 locale/es_ES.po
 locale/fr_FR.po
 locale/nl_NL.po
diff --git a/trytond_stock_supply_production.egg-info/requires.txt b/trytond_stock_supply_production.egg-info/requires.txt
index b2b7a19..576c688 100644
--- a/trytond_stock_supply_production.egg-info/requires.txt
+++ b/trytond_stock_supply_production.egg-info/requires.txt
@@ -1,5 +1,5 @@
-trytond_product >= 3.2, < 3.3
-trytond_production >= 3.2, < 3.3
-trytond_stock >= 3.2, < 3.3
-trytond_stock_supply >= 3.2, < 3.3
-trytond >= 3.2, < 3.3
\ No newline at end of file
+trytond_product >= 3.4, < 3.5
+trytond_production >= 3.4, < 3.5
+trytond_stock >= 3.4, < 3.5
+trytond_stock_supply >= 3.4, < 3.5
+trytond >= 3.4, < 3.5
\ No newline at end of file
-- 
tryton-modules-stock-supply-production



More information about the tryton-debian-vcs mailing list