Merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-mrp_production_wizard-dev-fernando into lp:addons-vauxoo/6.1

Proposed by Moisés López - http://www.vauxoo.com
Status: Merged
Merged at revision: 571
Proposed branch: lp:~vauxoo/addons-vauxoo/addons-vauxoo-mrp_production_wizard-dev-fernando
Merge into: lp:addons-vauxoo/6.1
Diff against target: 145 lines (+29/-11)
4 files modified
mrp_production_wizard/i18n/es.po (+7/-7)
mrp_production_wizard/mrp.py (+12/-2)
mrp_production_wizard/wizard/__init__.py (+1/-1)
mrp_production_wizard/wizard/special_order_wizard.py (+9/-1)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-mrp_production_wizard-dev-fernando
Reviewer Review Type Date Requested Status
Fernando Lopez (community) Needs Resubmitting
Moisés López - http://www.vauxoo.com Needs Fixing
Rodolfo Lopez Pending
Isaac López Zúñiga Pending
Review via email: mp+131652@code.launchpad.net

This proposal supersedes a proposal from 2012-10-19.

Description of the change

Se agregó un módulo que genera una orden de producción desde un wizard, el cual de datos de entrada pide el producto a producir, y los productos que se usarán como su lista de materiales, creando la orden de producción en estado draft y escribiendo en los o2m de productos planificados y productos planificados terminados los registros correspondientes.

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote : Posted in a previous version of this proposal

Ok Fernando,
Ahora la nueva funcionalidad que te había prometido decirte será:
El one2many cuando se esté llenando, agregar un onchange en el product_id, para que se llene automáticamente la cantidad de producto, que hay actualmente.

Revision history for this message
Fernando Lopez (kyon) wrote : Posted in a previous version of this proposal

La cantidad del producto en el o2m ahora se llena con la existencia que hay actualmente.

review: Needs Resubmitting
Revision history for this message
Rodolfo Lopez (el-rodo-1) wrote : Posted in a previous version of this proposal

Una mejora Fer.
Al momento de generar la producción podrías abrir la vista de producciones mostrando la producción que se creo.

Revision history for this message
Fernando Lopez (kyon) wrote : Posted in a previous version of this proposal

Se agregó que muestre la orden de producción creada y las traducciones del módulo.

review: Needs Resubmitting
Revision history for this message
Fernando Lopez (kyon) wrote : Posted in a previous version of this proposal

Se cambio a la vista tree por default y se cambió el orden de los campos en el wizard para capturar mas rápido

review: Needs Resubmitting
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Revisando y probando el módulo se detectan las siguientes observaciones.
En el cliente WEB está marcando un error, debido a que se está definiendo mal la vista que está ejecutando, que el GTK interpreta y por eso no marca error.

En el archivo
=== added file 'mrp_production_wizard/wizard/wizard.py'
+ 'view_mode': 'form,tree',

Por cierto el nombre del archivo "wizard.py", no está estandarizado, si tuvieras 5 wizard's como identificarías el .py de cada uno? (wizard.py, wizard2.py, wizard3.py...)
Acuérdate de la guideline fish-to-fish.
ALGO_wizard.py

review: Needs Fixing
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Actualmente pone por default el valor del producto terminado en 1.
Pero debe de poner la cantidad de la suma de todos sus hijos, como decía la tarea inicialmente.
Tanto en los productos terminados planificados, como en la cantidad de la producción.

Te comento que ahorita viendo la necesidad de otro desarrollo, a lo mejor lo podemos empatar aquí.
Para calcular la cantidad del producto terminado, debe de tomar el
Valor ingresado en el wizard, transformado a la uom por default de ese producto * (product.product::peso_bruto or 1)

NOTA: La traducción de unidad de medida, le pusiste LdM, y debería de ser UdM (LdM es Lista de Materiales)

review: Needs Fixing
526. By Fernando Lopez

[IMP] wizard gets a sum for the weight of the products and multiplies it by the quantity to consume

527. By Fernando Lopez

[IMP] Located factor of the product uom

528. By Fernando Lopez

[IMP] Gets and multiplies converting with factor

529. By Fernando Lopez

[IMP] The field qty of the production order now grabs the correct value, and also the weight considers the weight of the product to produce

530. By Fernando Lopez

[REM] Module is now full functional. Removed prints, and unnecesary comments.

531. By Fernando Lopez

[FIX] Fixed translations, and wizard file name

Revision history for this message
Fernando Lopez (kyon) wrote :

La cantidad de la orden de producción nueva cumple con el requerimiento "Valor ingresado en el wizard, transformado a la uom por default de ese producto * (product.product::peso_bruto or 1)". Se corrigió las traducciones, y el nombre del archivo del wizard.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'mrp_production_wizard/i18n/es_MX.mo' => 'mrp_production_wizard/i18n/es.mo'
2Binary files mrp_production_wizard/i18n/es_MX.mo 2012-10-22 18:21:32 +0000 and mrp_production_wizard/i18n/es.mo 2012-10-29 19:22:21 +0000 differ
3=== renamed file 'mrp_production_wizard/i18n/es_MX.po' => 'mrp_production_wizard/i18n/es.po'
4--- mrp_production_wizard/i18n/es_MX.po 2012-10-22 18:21:32 +0000
5+++ mrp_production_wizard/i18n/es.po 2012-10-29 19:22:21 +0000
6@@ -6,8 +6,8 @@
7 msgstr ""
8 "Project-Id-Version: OpenERP Server 6.1\n"
9 "Report-Msgid-Bugs-To: \n"
10-"POT-Creation-Date: 2012-10-22 18:08+0000\n"
11-"PO-Revision-Date: 2012-10-22 13:20-0600\n"
12+"POT-Creation-Date: 2012-10-29 18:58+0000\n"
13+"PO-Revision-Date: 2012-10-29 13:02-0600\n"
14 "Last-Translator: fernando <fernando_ld@vauxoo.com>\n"
15 "Language-Team: \n"
16 "MIME-Version: 1.0\n"
17@@ -32,7 +32,7 @@
18 msgstr "Nombre"
19
20 #. module: mrp_production_wizard
21-#: code:addons/mrp_production_wizard/mrp.py:79
22+#: code:addons/mrp_production_wizard/mrp.py:89
23 #, python-format
24 msgid "The category of the product to produce has not predefined locations "
25 msgstr "La categoría del producto a producir no tiene ubicaciones predefinidas."
26@@ -48,7 +48,7 @@
27 msgstr "Crear orden de producción"
28
29 #. module: mrp_production_wizard
30-#: code:addons/mrp_production_wizard/mrp.py:79
31+#: code:addons/mrp_production_wizard/mrp.py:89
32 #, python-format
33 msgid "Error"
34 msgstr "Error"
35@@ -71,7 +71,7 @@
36 #. module: mrp_production_wizard
37 #: field:wizard.data,product_uom:0
38 msgid "Product UOM"
39-msgstr "LdM del producto"
40+msgstr "UdM del producto"
41
42 #. module: mrp_production_wizard
43 #: view:mrp.production.wizard:0
44@@ -84,7 +84,7 @@
45 msgstr "Productos a consumir"
46
47 #. module: mrp_production_wizard
48-#: code:addons/mrp_production_wizard/wizard/wizard.py:60
49+#: code:addons/mrp_production_wizard/wizard/wizard.py:61
50 #, python-format
51 msgid "Manufacturing orders"
52 msgstr "Ordenes de producción"
53@@ -118,7 +118,7 @@
54 #. module: mrp_production_wizard
55 #: view:mrp.production.wizard:0
56 msgid "UOM"
57-msgstr "LdM"
58+msgstr "UdM"
59
60 #. module: mrp_production_wizard
61 #: field:wizard.data,mrp_production_wiz:0
62
63=== modified file 'mrp_production_wizard/mrp.py'
64--- mrp_production_wizard/mrp.py 2012-10-22 18:08:05 +0000
65+++ mrp_production_wizard/mrp.py 2012-10-29 19:22:21 +0000
66@@ -44,13 +44,23 @@
67 @param product id to create
68 @return: True
69 """
70+
71+ total_weight = 0
72+ for line in list_produce:
73+ product_obj_data = self.pool.get('product.product').browse(cr, uid, line['product_id'], context=None)
74+ if product_obj_data.weight:
75+ total_weight += (line['product_qty'] * product_obj_data.weight * (product.uom_id.factor / product_obj_data.uom_id.factor))
76+ else:
77+ total_weight += line['product_qty'] * (product.uom_id.factor / product_obj_data.uom_id.factor)
78+ total_weight = total_weight / ((product.weight or 1) * product.uom_id.factor)
79+
80 default_location_dict = self.product_id_change(cr, uid, [], product.id, context)
81 if (default_location_dict['value']['location_src_id'] & default_location_dict['value']['location_dest_id']):
82 production_order_dict = {
83 'name' : self.pool.get('ir.sequence').get(cr, uid, 'mrp.production'),
84 'date_planned' : time.strftime('%Y-%m-%d %H:%M:%S'),
85 'product_id' : product.id,
86- 'product_qty' : 1,
87+ 'product_qty' : total_weight,
88 'product_uom' : product.uom_id.id,
89 'location_src_id': default_location_dict['value']['location_src_id'],
90 'location_dest_id': default_location_dict['value']['location_dest_id'],
91@@ -70,7 +80,7 @@
92
93 mrp_pt_planifed_dict = {
94 'product_id' : product.id,
95- 'quantity' : 1,
96+ 'quantity' : total_weight,
97 'production_id' : new_id,
98 'product_uom' : product.uom_id.id,
99 }
100
101=== modified file 'mrp_production_wizard/wizard/__init__.py'
102--- mrp_production_wizard/wizard/__init__.py 2012-10-12 23:14:26 +0000
103+++ mrp_production_wizard/wizard/__init__.py 2012-10-29 19:22:21 +0000
104@@ -23,4 +23,4 @@
105 # along with this program. If not, see <http://www.gnu.org/licenses/>.
106 #
107 ##############################################################################
108-import wizard
109\ No newline at end of file
110+import special_order_wizard
111\ No newline at end of file
112
113=== renamed file 'mrp_production_wizard/wizard/wizard.py' => 'mrp_production_wizard/wizard/special_order_wizard.py'
114--- mrp_production_wizard/wizard/wizard.py 2012-10-22 18:46:48 +0000
115+++ mrp_production_wizard/wizard/special_order_wizard.py 2012-10-29 19:22:21 +0000
116@@ -32,6 +32,8 @@
117 _name='mrp.production.wizard'
118 _columns={
119 'product_id': fields.many2one('product.product', 'Product', required=True, ),
120+ #'product_qty': fields.float('Product Qty', required=True),
121+ #'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
122 'wiz_data': fields.one2many('wizard.data', 'mrp_production_wiz', 'Prod lines'),
123 }
124
125@@ -58,7 +60,7 @@
126 return {
127 'name': _('Manufacturing orders'),
128 'view_type': 'form',
129- 'view_mode': 'form,tree',
130+ 'view_mode': 'form',
131 'view_id': [res_id],
132 'res_model': 'mrp.production',
133 'context': "",
134@@ -67,6 +69,12 @@
135 'target': 'current',
136 'res_id': mrp_production_id or False,
137 }
138+
139+ #def onchange_product_to_produce(self, cr, uid, ids, product_id):
140+ # res = self.pool.get('wizard.data').onchange_production_wizard_product_name(cr, uid, ids, product_id)
141+ # print res['value'], " = res value"
142+ # return res
143+
144
145 mrp_production_wizard()
146