[tryton-debian-vcs] tryton-modules-production branch upstream updated. upstream/3.0.0-1-gde52850

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


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

commit de52850e18dbdbd0fb3bfa90f4ba35e5b8c3e962
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:22:35 2014 +0200

    Adding upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index d04ed00..935fe8f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+Version 3.2.0 - 2014-04-21
+* Bug fixes (see mercurial logs for details)
+* Allow to define effective date of productions
+
 Version 3.0.0 - 2013-10-21
 * Bug fixes (see mercurial logs for details)
 * Add calendar view
diff --git a/COPYRIGHT b/COPYRIGHT
index 7668cfa..5695e54 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2012-2013 Cédric Krier.
-Copyright (C) 2012-2013 B2CK SPRL.
+Copyright (C) 2012-2014 Cédric Krier.
+Copyright (C) 2012-2014 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/INSTALL b/INSTALL
index 105e6e6..b4d270d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_production
 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_product (http://www.tryton.org/)
  * trytond_company (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index f040e5e..f2f691a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,14 +1,11 @@
 include INSTALL
 include README
-include TODO
 include COPYRIGHT
 include CHANGELOG
 include LICENSE
 include tryton.cfg
 include *.xml
 include view/*.xml
-include *.odt
 include locale/*.po
 include doc/*
-include icons/*
 include tests/*.rst
diff --git a/PKG-INFO b/PKG-INFO
index f64d1fc..7908437 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_production
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module for production
 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_production
         ==================
         
@@ -43,6 +43,7 @@ Description: trytond_production
         
           http://www.tryton.org/
         
+Keywords: tryton production
 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/bom.py b/bom.py
index 737abc4..87082a6 100644
--- a/bom.py
+++ b/bom.py
@@ -53,20 +53,19 @@ class BOMInput(ModelSQL, ModelView):
     _rec_name = 'product'
 
     bom = fields.Many2One('production.bom', 'BOM', required=True,
-        select=1)
+        select=1, ondelete='CASCADE')
     product = fields.Many2One('product.product', 'Product',
         required=True, domain=[
             ('type', '!=', 'service'),
-        ], on_change=['product', 'uom'])
+        ])
     uom_category = fields.Function(fields.Many2One(
-        'product.uom.category', 'Uom Category',
-        on_change_with=['product']), 'on_change_with_uom_category')
+        'product.uom.category', 'Uom Category'), 'on_change_with_uom_category')
     uom = fields.Many2One('product.uom', 'Uom', required=True,
         domain=[
             ('category', '=', Eval('uom_category')),
         ], depends=['uom_category'])
-    unit_digits = fields.Function(fields.Integer('Unit Digits',
-        on_change_with=['uom']), 'on_change_with_unit_digits')
+    unit_digits = fields.Function(fields.Integer('Unit Digits'),
+        'on_change_with_unit_digits')
     quantity = fields.Float('Quantity', required=True,
         digits=(16, Eval('unit_digits', 2)),
         depends=['unit_digits'])
@@ -83,6 +82,7 @@ class BOMInput(ModelSQL, ModelView):
                 'recursive_bom': 'You can not create recursive BOMs.',
                 })
 
+    @fields.depends('product', 'uom')
     def on_change_product(self):
         res = {}
         if self.product:
@@ -97,10 +97,12 @@ class BOMInput(ModelSQL, ModelView):
             res['unit_digits'] = 2
         return res
 
+    @fields.depends('product')
     def on_change_with_uom_category(self, name=None):
         if self.product:
             return self.product.default_uom.category.id
 
+    @fields.depends('uom')
     def on_change_with_unit_digits(self, name=None):
         if self.uom:
             return self.uom.digits
@@ -175,8 +177,7 @@ class OpenBOMTreeStart(ModelView):
         domain=[
             ('category', '=', Eval('category')),
         ], depends=['category'])
-    unit_digits = fields.Integer('Unit Digits', readonly=True,
-        on_change_with=['uom'])
+    unit_digits = fields.Integer('Unit Digits', readonly=True)
     category = fields.Many2One('product.uom.category', 'Category',
         readonly=True)
     bom = fields.Many2One('product.product-production.bom',
@@ -185,6 +186,7 @@ class OpenBOMTreeStart(ModelView):
         ], depends=['product'])
     product = fields.Many2One('product.product', 'Product', readonly=True)
 
+    @fields.depends('uom')
     def on_change_with_unit_digits(self):
         if self.uom:
             return self.uom.digits
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index 3bf8ae9..6719634 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -33,7 +33,9 @@ msgid "product_bom_uniq"
 msgstr ""
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
 msgstr ""
 
 msgctxt "field:product.product,boms:"
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index b070838..eeaecd2 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -35,8 +35,12 @@ msgid "product_bom_uniq"
 msgstr "El producte ha de ser únic a la LdM."
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "La producció \"%s\" perd costos a alguna de les seves sortides."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"Els costs dels moviments de sortida (%(outputs)s) de la producció "
+"\"%(production)s\" són diferents del cost de la producció (%(costs)s)."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
@@ -454,7 +458,7 @@ msgstr "Tot"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_assigned"
 msgid "Assigned"
-msgstr "Assignat"
+msgstr "Reservat"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_draft"
@@ -474,7 +478,7 @@ msgstr "En curs"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_waiting"
 msgid "Waiting"
-msgstr "Esperant"
+msgstr "En espera"
 
 msgctxt "model:ir.sequence,name:sequence_production"
 msgid "Production"
@@ -562,15 +566,15 @@ msgstr "Producció"
 
 msgctxt "selection:production,state:"
 msgid "Assigned"
-msgstr "Assignat"
+msgstr "Reservada"
 
 msgctxt "selection:production,state:"
 msgid "Canceled"
-msgstr "Cancel·la"
+msgstr "Cancel·lada"
 
 msgctxt "selection:production,state:"
 msgid "Done"
-msgstr "Realitzat"
+msgstr "Realitzada"
 
 msgctxt "selection:production,state:"
 msgid "Draft"
@@ -582,11 +586,11 @@ msgstr "Sol·licitud"
 
 msgctxt "selection:production,state:"
 msgid "Running"
-msgstr "En curs"
+msgstr "En execució"
 
 msgctxt "selection:production,state:"
 msgid "Waiting"
-msgstr "Esperant"
+msgstr "En espera"
 
 msgctxt "view:product.product-production.bom:"
 msgid "Product - BOM"
@@ -598,7 +602,7 @@ msgstr "Producte - Llistes de materials"
 
 msgctxt "view:production.assign.failed:"
 msgid "Unable to Assign"
-msgstr "No es pot assignar"
+msgstr "No es pot reservar"
 
 msgctxt "view:production.assign.failed:"
 msgid "Unable to assign those products:"
@@ -642,7 +646,7 @@ msgstr "Configuració de la producció"
 
 msgctxt "view:production:"
 msgid "Assign"
-msgstr "Assigna"
+msgstr "Reserva"
 
 msgctxt "view:production:"
 msgid "Cancel"
@@ -686,7 +690,7 @@ msgstr "Accepta"
 
 msgctxt "wizard_button:production.assign,failed,force:"
 msgid "Force Assign"
-msgstr "Forçar reserva"
+msgstr "Força reserva"
 
 msgctxt "wizard_button:production.bom.tree.open,start,end:"
 msgid "Cancel"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index e7f815d..7e96a5c 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -33,7 +33,9 @@ msgid "product_bom_uniq"
 msgstr ""
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
 msgstr ""
 
 msgctxt "field:product.product,boms:"
diff --git a/locale/de_DE.po b/locale/de_DE.po
index e8c9a76..cd51d67 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -34,8 +34,12 @@ msgid "product_bom_uniq"
 msgstr ""
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "Fehlende Angaben für Kosten für einige Ausgänge von Produktion \"%s\"."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"Die Kosten der Ausgänge (%(outputs)s) von Produktion \"%(production)s\" "
+"stimmen nicht mit den Kosten der Produktion (%(costs)s) überein."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
@@ -147,7 +151,7 @@ msgstr "Status"
 
 msgctxt "field:production,unit_digits:"
 msgid "Unit Digits"
-msgstr "Anzahl Stellen"
+msgstr "Nachkommastellen"
 
 msgctxt "field:production,uom:"
 msgid "Uom"
@@ -251,7 +255,7 @@ msgstr "Name"
 
 msgctxt "field:production.bom.input,unit_digits:"
 msgid "Unit Digits"
-msgstr "Anzahl Stellen"
+msgstr "Nachkommastellen"
 
 msgctxt "field:production.bom.input,uom:"
 msgid "Uom"
@@ -299,7 +303,7 @@ msgstr "Name"
 
 msgctxt "field:production.bom.output,unit_digits:"
 msgid "Unit Digits"
-msgstr "Anzahl Stellen"
+msgstr "Nachkommastellen"
 
 msgctxt "field:production.bom.output,uom:"
 msgid "Uom"
@@ -335,7 +339,7 @@ msgstr "Menge"
 
 msgctxt "field:production.bom.tree,unit_digits:"
 msgid "Unit Digits"
-msgstr "Anzahl Stellen"
+msgstr "Nachkommastellen"
 
 msgctxt "field:production.bom.tree,uom:"
 msgid "Uom"
@@ -363,7 +367,7 @@ msgstr "Menge"
 
 msgctxt "field:production.bom.tree.open.start,unit_digits:"
 msgid "Unit Digits"
-msgstr "Anzahl Stellen"
+msgstr "Nachkommastellen"
 
 msgctxt "field:production.bom.tree.open.start,uom:"
 msgid "Unit"
@@ -371,7 +375,7 @@ msgstr "Stück"
 
 msgctxt "field:production.bom.tree.open.tree,bom_tree:"
 msgid "BOM Tree"
-msgstr "Stückliste Baum"
+msgstr "Stücklistenbaum"
 
 msgctxt "field:production.bom.tree.open.tree,id:"
 msgid "ID"
@@ -443,7 +447,7 @@ msgstr "Produktion zuweisen"
 
 msgctxt "model:ir.action,name:wizard_bom_tree_open"
 msgid "BOM Tree"
-msgstr "Stückliste Baum"
+msgstr "Stücklistenbaum"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_all"
@@ -533,7 +537,7 @@ msgstr "Stückliste Ausgang"
 
 msgctxt "model:production.bom.tree,name:"
 msgid "BOM Tree"
-msgstr "Stückliste Baum"
+msgstr "Stücklistenbaum"
 
 msgctxt "model:production.bom.tree.open.start,name:"
 msgid "Open BOM Tree"
@@ -613,15 +617,15 @@ msgstr "Stückliste Ausgänge"
 
 msgctxt "view:production.bom.tree.open.start:"
 msgid "BOM Tree"
-msgstr "Stückliste Baum"
+msgstr "Stücklistenbaum"
 
 msgctxt "view:production.bom.tree.open.tree:"
 msgid "BOM Tree"
-msgstr "Stückliste Baum"
+msgstr "Stücklistenbaum"
 
 msgctxt "view:production.bom.tree:"
 msgid "BOM Tree"
-msgstr "Stückliste Baum"
+msgstr "Stücklistenbaum"
 
 msgctxt "view:production.bom:"
 msgid "BOM"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 4d7b9c8..0799d59 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -35,8 +35,12 @@ msgid "product_bom_uniq"
 msgstr "El producto debe ser único en la LdM."
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "La producción «%s» pierde costos en alguna de sus salidas."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"El costo de las salidas (%(output)s) de la producción «%(production)s» no "
+"coincide con el costo de producción (%(costs)s)."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 2a1f9db..28a4366 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -16,7 +16,7 @@ msgstr "El producto debe ser único en la LDM!"
 
 msgctxt "error:production.bom.input:"
 msgid "You can not create recursive BOMs."
-msgstr "No puede crear LDMs recursivas!"
+msgstr "No puede crear LDMs recursivas."
 
 msgctxt "error:production.bom.input:"
 msgid "product_bom_uniq"
@@ -35,8 +35,12 @@ msgid "product_bom_uniq"
 msgstr "El producto debe ser único en la LDM."
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "A la producción \"%s\" le faltan algunos costos en sus salidas."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"El costo de las salidas (%(output)s) de la producción \"%(production)s\" no "
+"coincide con el costo de producción (%(costs)s)."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
@@ -60,7 +64,7 @@ msgstr "ID"
 
 msgctxt "field:product.product-production.bom,product:"
 msgid "Product"
-msgstr "Productos"
+msgstr "Producto"
 
 msgctxt "field:product.product-production.bom,rec_name:"
 msgid "Name"
@@ -124,11 +128,11 @@ msgstr "Salidas"
 
 msgctxt "field:production,planned_date:"
 msgid "Planned Date"
-msgstr "Fecha Estimada"
+msgstr "Fecha Planeada"
 
 msgctxt "field:production,product:"
 msgid "Product"
-msgstr "Productos"
+msgstr "Producto"
 
 msgctxt "field:production,quantity:"
 msgid "Quantity"
@@ -240,7 +244,7 @@ msgstr "ID"
 
 msgctxt "field:production.bom.input,product:"
 msgid "Product"
-msgstr "Productos"
+msgstr "Producto"
 
 msgctxt "field:production.bom.input,quantity:"
 msgid "Quantity"
@@ -288,7 +292,7 @@ msgstr "ID"
 
 msgctxt "field:production.bom.output,product:"
 msgid "Product"
-msgstr "Productos"
+msgstr "Producto"
 
 msgctxt "field:production.bom.output,quantity:"
 msgid "Quantity"
@@ -328,7 +332,7 @@ msgstr "ID"
 
 msgctxt "field:production.bom.tree,product:"
 msgid "Product"
-msgstr "Productos"
+msgstr "Producto"
 
 msgctxt "field:production.bom.tree,quantity:"
 msgid "Quantity"
@@ -356,7 +360,7 @@ msgstr "ID"
 
 msgctxt "field:production.bom.tree.open.start,product:"
 msgid "Product"
-msgstr "Productos"
+msgstr "Producto"
 
 msgctxt "field:production.bom.tree.open.start,quantity:"
 msgid "Quantity"
@@ -474,7 +478,7 @@ msgstr "En Ejecución"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_waiting"
 msgid "Waiting"
-msgstr "Esperando"
+msgstr "En Espera"
 
 msgctxt "model:ir.sequence,name:sequence_production"
 msgid "Production"
@@ -566,11 +570,11 @@ msgstr "Asignado"
 
 msgctxt "selection:production,state:"
 msgid "Canceled"
-msgstr "Cancelado"
+msgstr "Anulado"
 
 msgctxt "selection:production,state:"
 msgid "Done"
-msgstr "Realizado"
+msgstr "Hecho"
 
 msgctxt "selection:production,state:"
 msgid "Draft"
@@ -578,7 +582,7 @@ msgstr "Borrador"
 
 msgctxt "selection:production,state:"
 msgid "Request"
-msgstr "Solicitud"
+msgstr "Solicitado"
 
 msgctxt "selection:production,state:"
 msgid "Running"
@@ -586,7 +590,7 @@ msgstr "En ejecución"
 
 msgctxt "selection:production,state:"
 msgid "Waiting"
-msgstr "En espera"
+msgstr "En Espera"
 
 msgctxt "view:product.product-production.bom:"
 msgid "Product - BOM"
@@ -650,7 +654,7 @@ msgstr "Cancelar"
 
 msgctxt "view:production:"
 msgid "Done"
-msgstr "Realizado"
+msgstr "Hecho"
 
 msgctxt "view:production:"
 msgid "Draft"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index def65c6..858d907 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -35,8 +35,12 @@ msgid "product_bom_uniq"
 msgstr "El producto debe ser único en la LdM."
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "La producción \"%s\" pierde costes en alguna de sus salidas."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"Los costes de los movimientos de salida (%(outputs)s) de la producción "
+"\"%(production)s\" no coinciden con el coste de la producción (%(cost)s)."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
@@ -554,7 +558,7 @@ msgstr "Producción"
 
 msgctxt "model:res.group,name:group_production_admin"
 msgid "Production Administration"
-msgstr "Administración producción"
+msgstr "Administración de producción"
 
 msgctxt "model:stock.location,name:location_production"
 msgid "Production"
@@ -562,15 +566,15 @@ msgstr "Producción"
 
 msgctxt "selection:production,state:"
 msgid "Assigned"
-msgstr "Reservado"
+msgstr "Reservada"
 
 msgctxt "selection:production,state:"
 msgid "Canceled"
-msgstr "Cancelado"
+msgstr "Cancelada"
 
 msgctxt "selection:production,state:"
 msgid "Done"
-msgstr "Realizado"
+msgstr "Realizada"
 
 msgctxt "selection:production,state:"
 msgid "Draft"
@@ -678,7 +682,7 @@ msgstr "Ejecutar"
 
 msgctxt "view:production:"
 msgid "Wait"
-msgstr "Esperando"
+msgstr "En espera"
 
 msgctxt "wizard_button:production.assign,failed,end:"
 msgid "Ok"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 84e2f72..f6f0f94 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -35,8 +35,12 @@ msgid "product_bom_uniq"
 msgstr "product_bom_uniq"
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "Des coûts sont manquants sur les sorties de la production \"%s\"."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"Le coût des sorties (%(outputs)s) de production \"%(production)s\" ne "
+"correspond pas au coût de production (%(costs)s)."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index 9c97c31..de6fb5a 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -33,7 +33,9 @@ msgid "product_bom_uniq"
 msgstr ""
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
 msgstr ""
 
 msgctxt "field:product.product,boms:"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index aa64419..a1df564 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -33,8 +33,10 @@ msgid "product_bom_uniq"
 msgstr ""
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "У производства \"%s\" отсутствует цена для некоторых продуктов."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index b60b453..9cb8f54 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -33,8 +33,12 @@ msgid "product_bom_uniq"
 msgstr "product_bom_uniq"
 
 msgctxt "error:production:"
-msgid "Production \"%s\" misses costs on some of its outputs."
-msgstr "Na proizvodnem nalogu \"%s\" manjkajo stroški na nekaterih izhodih."
+msgid ""
+"The costs of the outputs (%(outputs)s) of production \"%(production)s\" do "
+"not match the cost of the production (%(costs)s)."
+msgstr ""
+"Izhodni stroški (%(outputs)s) proizvodnega naloga \"%(production)s\" se ne "
+"ujemajo s proizvodnimi stroški (%(costs)s)."
 
 msgctxt "field:product.product,boms:"
 msgid "BOMs"
@@ -86,7 +90,7 @@ msgstr "Šifra"
 
 msgctxt "field:production,company:"
 msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
 
 msgctxt "field:production,cost:"
 msgid "Cost"
@@ -457,7 +461,7 @@ msgstr "Dodeljeno"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_draft"
 msgid "Draft"
-msgstr "Osnutki"
+msgstr "Priprava"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_production_list_domain_requests"
@@ -572,7 +576,7 @@ msgstr "Zaključeno"
 
 msgctxt "selection:production,state:"
 msgid "Draft"
-msgstr "Osnutek"
+msgstr "V pripravi"
 
 msgctxt "selection:production,state:"
 msgid "Request"
@@ -652,7 +656,7 @@ msgstr "Zaključeno"
 
 msgctxt "view:production:"
 msgid "Draft"
-msgstr "Osnutek"
+msgstr "Priprava"
 
 msgctxt "view:production:"
 msgid "Lines"
diff --git a/product.py b/product.py
index cef2ada..a0ad739 100644
--- a/product.py
+++ b/product.py
@@ -14,7 +14,9 @@ class Product:
     boms = fields.One2Many('product.product-production.bom', 'product',
         'BOMs', order=[('sequence', 'ASC'), ('id', 'ASC')],
         states={
-            'invisible': Eval('type', 'service') == 'service',
+            'invisible': (Eval('type', 'service').in_(['service', None])
+                & (Eval('_parent_template', {}).get(
+                        'type', 'service').in_(['service', None]))),
             },
         depends=['type'])
 
diff --git a/production.py b/production.py
index 6638001..8863027 100644
--- a/production.py
+++ b/production.py
@@ -30,7 +30,11 @@ class Production(Workflow, ModelSQL, ModelView):
             'readonly': ~Eval('state').in_(['request', 'draft']),
             },
         depends=['state'])
-    effective_date = fields.Date('Effective Date', readonly=True)
+    effective_date = fields.Date('Effective Date',
+        states={
+            'readonly': Eval('state').in_(['cancel', 'done']),
+            },
+        depends=['state'])
     company = fields.Many2One('company.company', 'Company', required=True,
         states={
             'readonly': ~Eval('state').in_(['request', 'draft']),
@@ -44,7 +48,6 @@ class Production(Workflow, ModelSQL, ModelView):
             'readonly': (~Eval('state').in_(['request', 'draft'])
                 | Eval('inputs', True) | Eval('outputs', True)),
             },
-        on_change=['warehouse'],
         depends=['state'])
     location = fields.Many2One('stock.location', 'Location', required=True,
         domain=[
@@ -61,8 +64,7 @@ class Production(Workflow, ModelSQL, ModelView):
             ],
         states={
             'readonly': ~Eval('state').in_(['request', 'draft']),
-            },
-        on_change=BOM_CHANGES)
+            })
     bom = fields.Many2One('production.bom', 'BOM',
         domain=[
             ('output_products', '=', Eval('product', 0)),
@@ -71,11 +73,10 @@ class Production(Workflow, ModelSQL, ModelView):
             'readonly': ~Eval('state').in_(['request', 'draft']),
             'invisible': ~Eval('product'),
             },
-        on_change=BOM_CHANGES,
         depends=['product'])
     uom_category = fields.Function(fields.Many2One(
-            'product.uom.category', 'Uom Category',
-            on_change_with=['product']), 'on_change_with_uom_category')
+            'product.uom.category', 'Uom Category'),
+        'on_change_with_uom_category')
     uom = fields.Many2One('product.uom', 'Uom',
         domain=[
             ('category', '=', Eval('uom_category')),
@@ -85,10 +86,9 @@ class Production(Workflow, ModelSQL, ModelView):
             'required': Bool(Eval('bom')),
             'invisible': ~Eval('product'),
             },
-        on_change=BOM_CHANGES,
         depends=['uom_category'])
-    unit_digits = fields.Function(fields.Integer('Unit Digits',
-            on_change_with=['uom']), 'on_change_with_unit_digits')
+    unit_digits = fields.Function(fields.Integer('Unit Digits'),
+        'on_change_with_unit_digits')
     quantity = fields.Float('Quantity',
         digits=(16, Eval('unit_digits', 2)),
         states={
@@ -96,10 +96,9 @@ class Production(Workflow, ModelSQL, ModelView):
             'required': Bool(Eval('bom')),
             'invisible': ~Eval('product'),
             },
-        on_change=BOM_CHANGES,
         depends=['unit_digits'])
     cost = fields.Function(fields.Numeric('Cost', digits=(16, 4),
-            readonly=True, on_change_with=['inputs']), 'get_cost')
+            readonly=True), 'get_cost')
     inputs = fields.One2Many('stock.move', 'production_input', 'Inputs',
         domain=[
             ('from_location', 'child_of', [Eval('warehouse')], 'parent'),
@@ -134,8 +133,9 @@ class Production(Workflow, ModelSQL, ModelView):
     def __setup__(cls):
         super(Production, cls).__setup__()
         cls._error_messages.update({
-                'missing_cost': ('Production "%s" misses costs on '
-                    'some of its outputs.'),
+                'uneven_costs': ('The costs of the outputs (%(outputs)s) of '
+                    'production "%(production)s" do not match the cost of the '
+                    'production (%(costs)s).')
                 })
         cls._transitions |= set((
                 ('request', 'draft'),
@@ -285,7 +285,7 @@ class Production(Workflow, ModelSQL, ModelView):
             values = self._explode_move_values(storage_location, self.location,
                 self.company, input_, quantity)
             if values:
-                inputs['add'].append(values)
+                inputs['add'].append((-1, values))
                 quantity = Uom.compute_qty(input_.uom, quantity,
                     input_.product.default_uom)
                 changes['cost'] += (Decimal(str(quantity)) *
@@ -305,9 +305,10 @@ class Production(Workflow, ModelSQL, ModelView):
                     values['unit_price'] = Decimal(
                         changes['cost'] / Decimal(str(quantity))
                         ).quantize(Decimal(str(10 ** -digits[1])))
-                outputs['add'].append(values)
+                outputs['add'].append((-1, values))
         return changes
 
+    @fields.depends('warehouse')
     def on_change_warehouse(self):
         changes = {
             'location': None,
@@ -316,6 +317,7 @@ class Production(Workflow, ModelSQL, ModelView):
             changes['location'] = self.warehouse.production_location.id
         return changes
 
+    @fields.depends(*BOM_CHANGES)
     def on_change_product(self):
         result = {}
         if self.product:
@@ -337,21 +339,26 @@ class Production(Workflow, ModelSQL, ModelView):
         result.update(self.explode_bom())
         return result
 
+    @fields.depends('product')
     def on_change_with_uom_category(self, name=None):
         if self.product:
             return self.product.default_uom.category.id
 
+    @fields.depends('uom')
     def on_change_with_unit_digits(self, name=None):
         if self.uom:
             return self.uom.digits
         return 2
 
+    @fields.depends(*BOM_CHANGES)
     def on_change_bom(self):
         return self.explode_bom()
 
+    @fields.depends(*BOM_CHANGES)
     def on_change_uom(self):
         return self.explode_bom()
 
+    @fields.depends(*BOM_CHANGES)
     def on_change_quantity(self):
         return self.explode_bom()
 
@@ -365,6 +372,7 @@ class Production(Workflow, ModelSQL, ModelView):
             cost += (Decimal(str(input_.internal_quantity)) * cost_price)
         return cost
 
+    @fields.depends('inputs')
     def on_change_with_cost(self):
         Uom = Pool().get('product.uom')
 
@@ -448,7 +456,11 @@ class Production(Workflow, ModelSQL, ModelView):
             cost_price += (Decimal(str(output.quantity))
                 * output.unit_price)
         if not self.company.currency.is_zero(self.cost - cost_price):
-            self.raise_user_error('missing_cost', (self.rec_name,))
+            self.raise_user_error('uneven_costs', {
+                    'production': self.rec_name,
+                    'costs': self.cost,
+                    'outputs': cost_price,
+                    })
 
     @classmethod
     def create(cls, vlist):
@@ -465,9 +477,9 @@ class Production(Workflow, ModelSQL, ModelView):
         return productions
 
     @classmethod
-    def write(cls, productions, values):
-        super(Production, cls).write(productions, values)
-        for production in productions:
+    def write(cls, *args):
+        super(Production, cls).write(*args)
+        for production in sum(args[::2], []):
             production._set_move_planned_date()
 
     def _get_move_planned_date(self):
@@ -537,7 +549,7 @@ class Production(Workflow, ModelSQL, ModelView):
         Move = pool.get('stock.move')
         Date = pool.get('ir.date')
         Move.do([m for p in productions for m in p.outputs])
-        cls.write(productions, {
+        cls.write([p for p in productions if not p.effective_date], {
                 'effective_date': Date.today(),
                 })
 
diff --git a/setup.py b/setup.py
index 32037af..be6b963 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_production'
+
+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_production',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module for production',
     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 production',
     package_dir={'trytond.modules.production': '.'},
     packages=[
         'trytond.modules.production',
@@ -67,7 +85,6 @@ setup(name='trytond_production',
         '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/stock.py b/stock.py
index ffc7ecb..0985784 100644
--- a/stock.py
+++ b/stock.py
@@ -33,3 +33,10 @@ class Move:
         readonly=True, select=True, ondelete='CASCADE',
         domain=[('company', '=', Eval('company'))],
         depends=['company'])
+
+    def set_effective_date(self):
+        if not self.effective_date and self.production_input:
+            self.effective_date = self.production_input.effective_date
+        if not self.effective_date and self.production_output:
+            self.effective_date = self.production_output.effective_date
+        super(Move, self).set_effective_date()
diff --git a/tests/scenario_production.rst b/tests/scenario_production.rst
index d91f191..c161c5a 100644
--- a/tests/scenario_production.rst
+++ b/tests/scenario_production.rst
@@ -13,6 +13,7 @@ Imports::
     >>> from decimal import Decimal
     >>> from proteus import config, Model, Wizard
     >>> today = datetime.date.today()
+    >>> yesterday = today - relativedelta(days=1)
 
 Create database::
 
@@ -145,11 +146,11 @@ Create an Inventory::
     >>> inventory_line1 = InventoryLine()
     >>> inventory.lines.append(inventory_line1)
     >>> inventory_line1.product = component1
-    >>> inventory_line1.quantity = 10
+    >>> inventory_line1.quantity = 20
     >>> inventory_line2 = InventoryLine()
     >>> inventory.lines.append(inventory_line2)
     >>> inventory_line2.product = component2
-    >>> inventory_line2.quantity = 5
+    >>> inventory_line2.quantity = 6
     >>> inventory.save()
     >>> Inventory.confirm([inventory.id], config.context)
     >>> inventory.state
@@ -167,8 +168,8 @@ Make a production::
     >>> output, = production.outputs
     >>> output.quantity == 2
     True
-    >>> production.cost == Decimal('25')
-    True
+    >>> production.cost
+    Decimal('25.0')
     >>> production.save()
     >>> Production.wait([production.id], config.context)
     >>> production.state
@@ -182,12 +183,37 @@ Make a production::
     >>> production.reload()
     >>> all(i.state == 'done' for i in production.inputs)
     True
+    >>> len(set(i.effective_date == today for i in production.inputs))
+    1
     >>> Production.done([production.id], config.context)
     >>> production.reload()
     >>> output, = production.outputs
     >>> output.state
     u'done'
+    >>> output.effective_date == production.effective_date
+    True
     >>> config._context['locations'] = [storage.id]
     >>> product.reload()
     >>> product.quantity == 2
     True
+
+Make a production with effective date yesterday::
+
+    >>> Production = Model.get('production')
+    >>> production = Production()
+    >>> production.effective_date = yesterday
+    >>> production.product = product
+    >>> production.bom = bom
+    >>> production.quantity = 2
+    >>> production.click('wait')
+    >>> Production.assign_try([production.id], config.context)
+    True
+    >>> production.click('run')
+    >>> production.reload()
+    >>> all(i.effective_date == yesterday for i in production.inputs)
+    True
+    >>> production.click('done')
+    >>> production.reload()
+    >>> output, = production.outputs
+    >>> output.effective_date == yesterday
+    True
diff --git a/tests/test_production.py b/tests/test_production.py
index 105409a..b689710 100644
--- a/tests/test_production.py
+++ b/tests/test_production.py
@@ -1,55 +1,26 @@
-#!/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
 import unittest
 import doctest
-
-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 trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view, test_depends
-from trytond.backend.sqlite.database import Database as SQLiteDatabase
+from trytond.tests.test_tryton import test_view, test_depends, doctest_dropdb
 
 
 class ProductionTestCase(unittest.TestCase):
-    '''
-    Test Production module.
-    '''
+    'Test Production module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('production')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('production')
 
     def test0006depends(self):
-        '''
-        Test depends.
-        '''
+        'Test depends'
         test_depends()
 
 
-def doctest_dropdb(test):
-    '''
-    Remove sqlite memory database
-    '''
-    database = SQLiteDatabase().connect()
-    cursor = database.cursor(autocommit=True)
-    try:
-        database.drop(cursor, ':memory:')
-        cursor.commit()
-    finally:
-        cursor.close()
-
-
 def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
@@ -58,6 +29,3 @@ def suite():
         setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
             optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index e60bd9e..ec7bef5 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.0
+version=3.2.0
 depends:
     company
     ir
diff --git a/trytond_production.egg-info/PKG-INFO b/trytond_production.egg-info/PKG-INFO
index a3c7de0..e6d9231 100644
--- a/trytond_production.egg-info/PKG-INFO
+++ b/trytond_production.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-production
-Version: 3.0.0
+Version: 3.2.0
 Summary: Tryton module for production
 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_production
         ==================
         
@@ -43,6 +43,7 @@ Description: trytond_production
         
           http://www.tryton.org/
         
+Keywords: tryton production
 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_production.egg-info/requires.txt b/trytond_production.egg-info/requires.txt
index b24a68f..465c9eb 100644
--- a/trytond_production.egg-info/requires.txt
+++ b/trytond_production.egg-info/requires.txt
@@ -1,4 +1,4 @@
-trytond_company >= 3.0, < 3.1
-trytond_product >= 3.0, < 3.1
-trytond_stock >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_company >= 3.2, < 3.3
+trytond_product >= 3.2, < 3.3
+trytond_stock >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
-- 
tryton-modules-production



More information about the tryton-debian-vcs mailing list