avanzosc team mailing list archive
-
avanzosc team
-
Mailing list archive
-
Message #00275
[Merge] lp:~oscarolar/avanzosc/avanzosc_to_merge into lp:avanzosc/addons-6.1
OscarAlca has proposed merging lp:~oscarolar/avanzosc/avanzosc_to_merge into lp:avanzosc/addons-6.1.
Requested reviews:
Daniel Campos (dani-ds)
Nhomar Hernandez (Vauxoo) (nhomar)
Ana Juaristi Olalde (ajuaristio)
For more details, see:
https://code.launchpad.net/~oscarolar/avanzosc/avanzosc_to_merge/+merge/103744
This version is already working on OpenERP V 6.1, hope we can merge it
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~oscarolar/avanzosc/avanzosc_to_merge/+merge/103744
Your team Avanzosc Developers is subscribed to branch lp:avanzosc/addons-6.1.
=== added file '.project'
--- .project 1970-01-01 00:00:00 +0000
+++ .project 2012-04-26 18:16:21 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Manufacturing</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.python.pydev.PyDevBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.python.pydev.pythonNature</nature>
+ </natures>
+</projectDescription>
=== added file '.pydevproject'
--- .pydevproject 1970-01-01 00:00:00 +0000
+++ .pydevproject 2012-04-26 18:16:21 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+</pydev_project>
=== added directory 'mrp_analytics_control'
=== added file 'mrp_analytics_control/__init__.py'
--- mrp_analytics_control/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import wizard
+import company
+import mrp_manufacturing_cost
+import manufacturing_analitic_accounts
+import production
\ No newline at end of file
=== added file 'mrp_analytics_control/__openerp__.py'
--- mrp_analytics_control/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/__openerp__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,46 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+{
+ "name" : "MRP Analytics Control",
+ "version" : "0.1",
+ "description" : """This module adds new features to the actual OpenERP manufacturing""",
+ "author" : "Ting! & Avanzosc",
+ "website" : "http://www.ting.es",
+ "depends" : [
+ 'account',
+ 'stock',
+ 'mrp',
+ 'mrp_master_extension',
+ 'mrp_manufacturing_cost',
+ ],
+ "category" : "Custom Modules",
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : [
+ 'wizard/mrp_analytic_schema_wizard_view.xml',
+ 'wizard/mrp_analytic_installer.xml',
+ 'manufacturing_analitic_accounts_view.xml',
+ 'company_view.xml',
+
+ ],
+ "active": False,
+ "installable": True
+}
=== added file 'mrp_analytics_control/company.py'
--- mrp_analytics_control/company.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/company.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,33 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Avanzosc - Avanced Open Source Consulting
+# Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv,fields
+
+class company(osv.osv):
+ _inherit = 'res.company'
+
+ _columns = {
+ 'material_account': fields.many2one('account.account', 'Material Cost Account', domain="[('type', '=', 'other')]", help="Account to impute material costs"),
+ 'workcenter_account': fields.many2one('account.account', 'Workcenter Cost Account', domain="[('type', '=', 'other')]", help="Account to impute workcenter costs"),
+ 'operator_account': fields.many2one('account.account', 'Operator Cost Account', domain="[('type', '=', 'other')]", help="Account to impute operator costs"),
+ }
+
+company()
\ No newline at end of file
=== added file 'mrp_analytics_control/company_view.xml'
--- mrp_analytics_control/company_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/company_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="mrp_analytic_company" model="ir.ui.view">
+ <field name="name">res.company.mrp.analytic</field>
+ <field name="model">res.company</field>
+ <field name="type">form</field>
+ <field name="priority">22</field>
+ <field name="inherit_id" ref="base.view_company_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="/form/notebook/page/group[last()]" position="after">
+ <group colspan="4" >
+ <separator string="MRP Account Configuration" colspan="4" />
+ <field name="material_account"/>
+ <field name="workcenter_account"/>
+ <field name="operator_account"/>
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'mrp_analytics_control/i18n'
=== added file 'mrp_analytics_control/i18n/es.mo'
Binary files mrp_analytics_control/i18n/es.mo 1970-01-01 00:00:00 +0000 and mrp_analytics_control/i18n/es.mo 2012-04-26 18:16:21 +0000 differ
=== added file 'mrp_analytics_control/i18n/es.po'
--- mrp_analytics_control/i18n/es.po 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/i18n/es.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,319 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_analytics_control
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.1\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-06-07 11:54+0000\n"
+"PO-Revision-Date: 2011-06-07 14:05+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/production.py:50
+#: code:addons/mrp_analytics_control/production.py:56
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:62
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:111
+#: code:addons/mrp_analytics_control/wizard/users.py:55
+#: code:addons/mrp_analytics_control/wizard/users.py:271
+#: code:addons/mrp_analytics_control/wizard/users.py:366
+#: code:addons/mrp_analytics_control/wizard/users.py:445
+#: code:addons/mrp_analytics_control/wizard/wc.py:138
+#: code:addons/mrp_analytics_control/wizard/wc.py:197
+#, python-format
+msgid "Unable to perform action"
+msgstr "Imposible realizar la acción"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_manufacturing_user
+#: model:ir.model,name:mrp_analytics_control.model_manufacturing_user_op_add
+msgid "Manufacturing new user"
+msgstr "Nuevo usuario de facturación"
+
+#. module: mrp_analytics_control
+#: model:ir.ui.menu,name:mrp_analytics_control.menu_manu_ana_acc
+msgid "Manufacturing analytical accounting "
+msgstr "Contabilidad analitica de fabricación"
+
+#. module: mrp_analytics_control
+#: field:aux.analityc.account,wizard_id:0
+msgid "Wizard"
+msgstr "Asistente"
+
+#. module: mrp_analytics_control
+#: model:ir.actions.act_window,name:mrp_analytics_control.act_analityc_create
+msgid "act.ana.wiz "
+msgstr "act.ana.wiz "
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:398
+#, python-format
+msgid ""
+"La cuenta analitica de esta maquina no esta creada. codigo: '+wc_acc_code))\n"
+" \n"
+" man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing"
+msgstr ""
+"La cuenta analitica de esta maquina no esta creada. codigo: '+wc_acc_code))\n"
+" \n"
+" man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:215
+#, python-format
+msgid "You must assign a product to all machines"
+msgstr "Debes asignar un producto a todas las maquinas"
+
+#. module: mrp_analytics_control
+#: model:ir.module.module,shortdesc:mrp_analytics_control.module_meta_information
+msgid "MRP Master Extension"
+msgstr "MRP Master Extension"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_aux_analityc_account
+msgid "Created schema"
+msgstr "Esquema generado"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/users.py:55
+#, python-format
+msgid "You must select Operator"
+msgstr "Debes seleccionar un operador"
+
+#. module: mrp_analytics_control
+#: wizard_field:ana_create,init,schema:0
+msgid "Translation state"
+msgstr "Estado de la traducción"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_ana_wiz
+msgid "Wizard to create account analityc schema"
+msgstr "Asistente para crear esquema de contabilidad analítica"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:111
+#, python-format
+msgid "Analitic account for this Manufacturing order already exists."
+msgstr "Ya existe contabilidad analítica para esta orden de fabricación."
+
+#. module: mrp_analytics_control
+#: view:account.analytic.account:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: mrp_analytics_control
+#: model:ir.module.module,description:mrp_analytics_control.module_meta_information
+msgid "This module adds new features to the actual OpenERP manufacturing"
+msgstr "Este módulo añade nuevas características a la actual fabricación de OpenERP"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:62
+#, python-format
+msgid "You cannot create analytic accounting before starting the production order."
+msgstr "No se puede generar la contabilidad analitica antes de iniciar la orden de producción"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/users.py:271
+#: code:addons/mrp_analytics_control/wizard/users.py:366
+#: code:addons/mrp_analytics_control/wizard/users.py:445
+#: code:addons/mrp_analytics_control/wizard/wc.py:138
+#: code:addons/mrp_analytics_control/wizard/wc.py:197
+#, python-format
+msgid "Operation must be started to allocate hours"
+msgstr "La operación debe estar iniciada para poder imputar horas"
+
+#. module: mrp_analytics_control
+#: field:ana.wiz,schema:0
+msgid "Analityc schema"
+msgstr "Esquema analítico"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/production.py:40
+#: code:addons/mrp_analytics_control/production.py:56
+#, python-format
+msgid "Not allowed to change the name of fixed costs!"
+msgstr "No se puede cambiar la descripción de los costes fijos!"
+
+#. module: mrp_analytics_control
+#: view:account.analytic.account:0
+msgid "Order"
+msgstr "Ordenar"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:439
+#, python-format
+msgid ""
+"La cuenta analitica de este operario no esta creada. codigo: '+ope_acc_code))\n"
+" \n"
+" \n"
+" man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing"
+msgstr ""
+"La cuenta analitica de este operario no esta creada. codigo: '+ope_acc_code))\n"
+" \n"
+" \n"
+" man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_input_time
+#: model:ir.model,name:mrp_analytics_control.model_input_time_wc
+#: model:ir.model,name:mrp_analytics_control.model_new_input_time_wc
+msgid "Input time"
+msgstr "Imputar tiempo"
+
+#. module: mrp_analytics_control
+#: field:account.analytic.account,acc_type:0
+msgid "Account type"
+msgstr "Tipo de cuenta"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_mrp_fixed_cost
+msgid "MRP fixed costs"
+msgstr "Costes fijos de fabricación"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_mrp_production_operation_real
+msgid "mrp.production.operation.real"
+msgstr "mrp.production.operation.real"
+
+#. module: mrp_analytics_control
+#: wizard_button:ana_create,init,end:0
+msgid "Ok"
+msgstr "Ok"
+
+#. module: mrp_analytics_control
+#: field:aux.analityc.account,code:0
+#: field:aux.analityc.account,company_id:0
+#: field:aux.analityc.account,currency_id:0
+#: field:aux.analityc.account,name:0
+#: field:aux.analityc.account,state:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:398
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:439
+#, python-format
+msgid "Error de programación"
+msgstr "Error de programación"
+
+#. module: mrp_analytics_control
+#: model:ir.actions.wizard,name:mrp_analytics_control.analytic_creation_wizard
+msgid "Analytic accounting creation"
+msgstr "Creación de contabilidad analitica"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/users.py:242
+#: code:addons/mrp_analytics_control/wizard/users.py:329
+#: code:addons/mrp_analytics_control/wizard/users.py:413
+#: code:addons/mrp_analytics_control/wizard/wc.py:123
+#: code:addons/mrp_analytics_control/wizard/wc.py:182
+#, python-format
+msgid "The time must be greater than 0"
+msgstr "El tiempo debe ser mayor de 0"
+
+#. module: mrp_analytics_control
+#: view:account.analytic.account:0
+msgid "Materials"
+msgstr "Materiales"
+
+#. module: mrp_analytics_control
+#: model:ir.actions.act_window,name:mrp_analytics_control.action_manu_acc
+msgid "Manufacturing analytic account"
+msgstr "Cuenta analítica de fabricación"
+
+#. module: mrp_analytics_control
+#: constraint:account.analytic.account:0
+msgid "Error! The currency has to be the same as the currency of the selected company"
+msgstr "¡Error! La divisa tiene que ser la misma que la establecida en la compañía seleccionada"
+
+#. module: mrp_analytics_control
+#: field:account.analytic.account,acc_result:0
+msgid "Account result"
+msgstr "Resultado de la cuenta"
+
+#. module: mrp_analytics_control
+#: view:account.analytic.account:0
+msgid "Operation"
+msgstr "Operación"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_new_input_time
+msgid "new_Input time"
+msgstr "Nueva imputación de tiempo"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_mrp_production_users
+msgid "mrp.production.users"
+msgstr "mrp.production.users"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/ana_acc_wiz.py:424
+#: code:addons/mrp_analytics_control/wizard/users.py:94
+#: code:addons/mrp_analytics_control/wizard/users.py:190
+#: code:addons/mrp_analytics_control/wizard/users.py:561
+#: code:addons/mrp_analytics_control/wizard/wc.py:79
+#, python-format
+msgid "You must assign a product to all employers"
+msgstr "Debes asignar un producto a todos los empleados"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/users.py:239
+#: code:addons/mrp_analytics_control/wizard/users.py:332
+#, python-format
+msgid "A job description should be given"
+msgstr "Se debe dar una descripción de trabajo"
+
+#. module: mrp_analytics_control
+#: view:account.analytic.account:0
+msgid "Operators"
+msgstr "Operadores"
+
+#. module: mrp_analytics_control
+#: model:ir.model,name:mrp_analytics_control.model_account_analytic_account
+msgid "Analytic Account"
+msgstr "Cuenta analítica"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/production.py:39
+#, python-format
+msgid "Warning!"
+msgstr "Atención!"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/production.py:50
+#, python-format
+msgid "Not allowed to delete the fixed costs, set its quantity to 0!"
+msgstr "No se permite eliminar las referencias a costes fijos, sino se han producido establezca su coste a 0!"
+
+#. module: mrp_analytics_control
+#: code:addons/mrp_analytics_control/wizard/users.py:239
+#: code:addons/mrp_analytics_control/wizard/users.py:332
+#, python-format
+msgid "Missing data"
+msgstr "Datos no encontrados"
+
+#. module: mrp_analytics_control
+#: constraint:account.analytic.account:0
+msgid "Error! You can not create recursive analytic accounts."
+msgstr "¡Error! No puede crear cuentas analíticas recursivas."
+
+#. module: mrp_analytics_control
+#: field:account.analytic.account,total_estimated:0
+msgid "Estimated"
+msgstr "Estimado"
+
+#. module: mrp_analytics_control
+#: field:aux.analityc.account,parent_id:0
+msgid "ID op"
+msgstr "ID de operación"
+
+#. module: mrp_analytics_control
+#: view:account.analytic.account:0
+msgid "Machines"
+msgstr "Maquinas"
+
=== added file 'mrp_analytics_control/manufacturing_analitic_accounts.py'
--- mrp_analytics_control/manufacturing_analitic_accounts.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/manufacturing_analitic_accounts.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,134 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+import tools
+import math
+from tools.translate import _
+import time
+from datetime import datetime
+
+class account_analytic_account(osv.osv):
+ _name = "account.analytic.account"
+ _inherit = "account.analytic.account"
+
+# def _acc_result(cr,uid,ids):
+# dif_acc = self.browse(cr,uid,ids)
+# dif = dif_acc.debit - dif_acc.total_estimated
+# return dif
+
+ _columns = {
+ 'total_estimated':fields.float('Estimated'),
+ 'acc_type':fields.char('Account type',size = 2),
+ 'acc_result':fields.float('Account result')
+ }
+
+ def recalculate_result(self, cr, uid, acc_id):
+ analytic_obj = self.pool.get('account.analytic.account')
+ if acc_id:
+ acc = analytic_obj.browse(cr, uid, acc_id)
+
+ resu = float(acc.balance) + float(acc.total_estimated)
+
+ analytic_obj.write(cr, uid, acc_id,{'acc_result':resu})
+
+ if not acc.acc_type == 'MF':
+ self.recalculate_result(cr, uid, acc.parent_id.id)
+ return True
+
+ def calculate_estimated(self, cr, uid, parnt_id, amount):
+
+ analytic_obj = self.pool.get('account.analytic.account')
+ acc = analytic_obj.browse(cr, uid, parnt_id)
+
+ total = acc.total_estimated
+ if total is None:
+ total = 0.0
+ tot = total + amount
+ resu = acc.debit - tot
+ analytic_obj.write(cr,uid,parnt_id,{'total_estimated':tot,'acc_result':resu})
+ if not acc.acc_type == 'MF':
+ self.calculate_estimated(cr, uid, acc.parent_id.id, amount)
+
+ return True
+
+ _defaults = {
+ 'total_estimated': 0.00,
+ }
+account_analytic_account()
+
+
+class mrp_production_operation_real(osv.osv):
+
+ _inherit = "mrp.production.operation.real"
+ _name = "mrp.production.operation.real"
+
+ def action_done(self, cr, uid, ids):
+
+ """ Sets state to done, writes finish date and calculates delay.
+ @return: True
+ """
+ tot_time = 0.0
+ date_now = time.strftime('%Y-%m-%d %H:%M:%S')
+ obj_line = self.browse(cr, uid, ids[0])
+
+ if not obj_line.move_lines2:
+ raise osv.except_osv(_('Error'), _('You can not finish before produce'))
+
+ date_start = datetime.strptime(obj_line.date_start,'%Y-%m-%d %H:%M:%S')
+
+ date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
+ tot_time += (date_finished-date_start).days * 24
+ tot_time += (date_finished-date_start).seconds / float(60*60)
+
+ tot_time -= obj_line.paused_time
+
+ if obj_line.date_restart:
+ date_start = datetime.strptime(obj_line.date_restart,'%Y-%m-%d %H:%M:%S')
+
+ delay = 0.0
+
+ date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
+ delay += (date_finished-date_start).days * 24
+ delay += (date_finished-date_start).seconds / float(60*60)
+
+
+ time_obj = self.pool.get('new.input.time')
+
+ time_obj.input_real_worktime(cr, uid, ids, uid, delay, obj_line.mrp_manu_op.id, date_now, 'Work in '+str(obj_line.workcenter_id.name))
+
+ self.write(cr, uid, ids, {'state':'done', 'date_finished': date_now,'delay':tot_time})
+ self.modify_production_order_state(cr,uid,ids,'done')
+
+ #Añadido link a contabilidad analitica para costes de materiales
+
+ self.pool.get('mrp.analytic.wizard').mats_final_cost(cr, uid, ids[0])
+
+ return True
+
+mrp_production_operation_real()
+#class mrp_production_operation_real(osv.osv):
+# _name = 'mrp.production.operation.real'
+# _inherit = 'mrp.production.operation.real'
+#
+# def action_done(self, cr, uid, ids):
+#
+#
+#mrp_production_real()
\ No newline at end of file
=== added file 'mrp_analytics_control/manufacturing_analitic_accounts_view.xml'
--- mrp_analytics_control/manufacturing_analitic_accounts_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/manufacturing_analitic_accounts_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="manufacturing_analytic_account_search_form_view" model="ir.ui.view">
+ <field name="name">manufacturing_analytic_account_search_view</field>
+ <field name="model">account.analytic.account</field>
+ <field name="type">search</field>
+ <field eval="1" name="priority" />
+ <field name="arch" type="xml">
+ <search string="Product">
+ <filter string="Order" icon="terp-accessories-archiver"
+ domain="[('acc_type','=','OF')]" />
+ <filter string="Operation" icon="terp-accessories-archiver"
+ domain="[('acc_type','=','OP')]" />
+ <filter string="Operators" icon="terp-accessories-archiver"
+ domain="[('acc_type','=','WK')]" />
+ <filter string="Materials" icon="terp-accessories-archiver"
+ domain="[('acc_type','=','MT')]" />
+ <filter string="Machines" icon="terp-accessories-archiver"
+ domain="[('acc_type','=','MA')]" />
+ </search>
+ </field>
+ </record>
+
+
+ <record id="mrp_production_inherit_analit_form_view" model="ir.ui.view">
+ <field name="name">mrp.production.inherit.analit.form</field>
+ <field name="model">mrp.production</field>
+ <field name="inherit_id" ref="mrp_manufacturing_cost.mrp_production_inherit_inherit_form_view"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/notebook/page[@string='Allocation of hours']/group/button[@string='Show costs']" position="replace">
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+
+ <record id="mrp_inherit_wc_form_view" model="ir.ui.view">
+ <field name="name">mrp.inherit.wc.form</field>
+ <field name="model">mrp.workcenter</field>
+ <field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/group/field[@name='calendar_id']" position="replace">
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='costs_hour_account_id']" position="replace">
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='costs_cycle_account_id']" position="replace">
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='costs_journal_id']" position="replace">
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='costs_general_account_id']" position="replace">
+ </xpath>
+
+ </data>
+ </field>
+ </record>
+
+ <record id="mrp_inherit_wc_2_form_view" model="ir.ui.view">
+ <field name="name">mrp.inherit.wc.form</field>
+ <field name="model">mrp.workcenter</field>
+ <field name="inherit_id" ref="mrp_master_extension.mrp_work_center_master_view"/>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/notebook/page[@string='Maintaining']" position="replace">
+ <page string="Maintaining" invisible="1">
+ </page>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+
+
+ <!-- INSERCCION DE CAMPOS EN TREE HEREDADO -->
+
+
+ <record id="view_account_analytic_account_tree" model="ir.ui.view">
+ <field name="name">account.analytic.account.tree</field>
+ <field name="model">account.analytic.account</field>
+ <field name="inherit_id" ref="account.view_account_analytic_account_tree" />
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <xpath expr="/tree/field[@name='balance']" position="after">
+ <field name="total_estimated" />
+ <field name="acc_result"/>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- TREE ESQUEMATICO -->
+
+
+
+ <record id="action_manu_acc" model="ir.actions.act_window">
+ <field name="name">Manufacturing analytic account</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">account.analytic.account</field>
+ <field name="view_type">tree</field>
+ <field name="domain">[('parent_id','=',False)]</field>
+ <field name="search_view" ref="manufacturing_analytic_account_search_form_view"/>
+ <field name="view_id" ref="view_account_analytic_account_tree" />
+ </record>
+
+ <menuitem
+ name="Manufacturing analytical accounting "
+ parent="mrp.menu_mrp_manufacturing"
+ action="action_manu_acc"
+ id="menu_manu_ana_acc"
+ icon='terp-hr'/>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'mrp_analytics_control/production.py'
--- mrp_analytics_control/production.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/production.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,135 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+from tools.translate import _
+import netsvc
+
+class mrp_fixed_cost(osv.osv):
+ _inherit = 'mrp.fixed.cost'
+ _name = 'mrp.fixed.cost'
+ _description = 'MRP fixed costs'
+#
+# def change_name(self, cr, uid, ids, name):
+# me = self.browse(cr, uid, ids)[0]
+# if True :
+# warning = {
+# 'title': _('Warning!'),
+# 'message': _('Not allowed to change the name of fixed costs!')
+# }
+# return { 'warning': warning}
+# else:
+# return {'value':{'created':True}}
+
+ def unlink(self, cr, uid, ids, context=None):
+ if 'borrar' in context:
+ super(mrp_fixed_cost, self).unlink(cr, uid, ids, context=context)
+ else:
+ raise osv.except_osv(_('Unable to perform action'), _('Not allowed to delete the fixed costs, set its quantity to 0!'))
+ return True
+
+ def write(self, cr, uid, ids, vals, context=None):
+ fix = self.browse(cr, uid, ids, context)
+ if vals['name'] <> fix[0].name:
+ raise osv.except_osv(_('Unable to perform action'), _('Not allowed to change the name of fixed costs!'))
+ res = super(mrp_fixed_cost, self).write(cr, uid, ids, vals, context=context)
+
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
+ account_analytic_obj = self.pool.get('account.analytic.account')
+
+ for cost in fix:
+ fix_acc_search = account_analytic_obj.search(cr, uid, [('code','=','OF'+str(cost.production_id.id)+ "FIX" )])
+ if fix_acc_search:
+ line_search = account_analytic_line_obj.search(cr, uid, [('name','=',cost.name),('account_id','=',fix_acc_search[0])])
+ if line_search:
+ print 'name '+str(cost.name)+' ip '+ str(fix_acc_search[0])
+ account_analytic_line_obj.write(cr, uid, line_search[0],{'amount':(cost.amount*(-1))})
+ account_analytic_obj.recalculate_result(cr, uid, fix_acc_search[0])
+ else:
+ print 'fallo de programacion al leer la linea de cuenta analitica'
+ else:
+ print 'Analitica no creada o fallo de programacion al leer la cuenta analitica'
+ return res
+
+ def create(self, cr, uid, vals, context=None):
+ fix_created = super(mrp_fixed_cost, self).create(cr, uid, vals, context=context)
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_analytic_jour_obj = self.pool.get('account.analytic.journal')
+ acc_search = account_analytic_obj.search(cr, uid,[('code','=','OF'+str(vals['production_id']))])
+ acc_id = False
+ if acc_search:
+ acc_id = acc_search[0]
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+
+ if acc_id:
+
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
+ op_acc_code = False
+ prod_maq_name_acc_code = False
+
+ man_fix_account = account_analytic_obj.search(cr, uid,[('code','=','OF'+str(vals['production_id'])+'FIX') ] )[0]
+
+ if not man_fix_account:
+ #Crear cuenta analitica de costes fijos
+
+
+
+ op_acc_code = 'OF' + str(acc_id)
+ prod_maq_name_acc_code = op_acc_code + 'FIX'
+
+ est = 0
+
+ values={
+ 'name':prod_maq_name_acc_code + " " + 'Fijos ' ,
+ 'code':prod_maq_name_acc_code ,
+ 'currency_id':1,
+ 'company_id':1,
+ 'state':'open',
+ 'parent_id':acc_id,
+ 'total_estimated':est,
+ 'acc_type':'FIX'
+ }
+
+
+ man_fix_account = account_analytic_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, man_fix_account)
+
+
+ #añadir costes reales de costes fijos
+
+ values = {
+ 'amount':vals['amount']*(-1),
+ 'name':vals['name'],
+ 'date':datetime.today(),
+ 'company_in':1,
+ 'account_id': man_fix_account,
+ 'general_account_id':950,
+ 'journal_id':man_journal_search[0],
+ }
+
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, man_fix_account)
+
+ return True
+
+mrp_fixed_cost()
\ No newline at end of file
=== added directory 'mrp_analytics_control/wizard'
=== added file 'mrp_analytics_control/wizard/__init__.py'
--- mrp_analytics_control/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import mrp_analytic_schema_wizard
+import mrp_analytic_installer
+import users
+import wc
=== added file 'mrp_analytics_control/wizard/mrp_analytic_installer.py'
--- mrp_analytics_control/wizard/mrp_analytic_installer.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/mrp_analytic_installer.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,58 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Avanzosc - Avanced Open Source Consulting
+# Copyright (C) 2010 - 2011 Avanzosc <http://www.avanzosc.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class mrp_analytic_installer(osv.osv_memory):
+ _name = 'mrp.analytic.installer'
+ _inherit = 'res.config'
+
+ _columns = {
+ 'material_account': fields.many2one('account.account', 'Material Cost Account', domain="[('type', '=', 'other')]", help="Account to impute material costs"),
+ 'workcenter_account': fields.many2one('account.account', 'Workcenter Cost Account', domain="[('type', '=', 'other')]", help="Account to impute workcenter costs"),
+ 'operator_account': fields.many2one('account.account', 'Operator Cost Account', domain="[('type', '=', 'other')]", help="Account to impute operator costs"),
+ }
+
+ def execute(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, context=context)
+ company_obj = self.pool.get('res.company')
+ default_co = company_obj._company_default_get(cr, uid, 'mrp.routing', context=context)
+ if not data:
+ return {}
+ mt_acc = data[0]['material_account']
+ wk_acc = data[0]['workcenter_account']
+ op_acc = data[0]['operator_account']
+
+ values = {
+ 'material_account': mt_acc,
+ 'workcenter_account': wk_acc,
+ 'operator_account': op_acc,
+ }
+# data_pool = self.pool.get('ir.model.data')
+# transition_obj = self.pool.get('workflow.transition')
+# waiting = data_pool._get_id(cr, uid, 'purchase_triple_validation', 'trans_validated_router')
+# waiting_id = data_pool.browse(cr, uid, waiting, context=context).res_id
+# confirm = data_pool._get_id(cr, uid, 'purchase_triple_validation', 'trans_waiting_validated_router')
+# confirm_id = data_pool.browse(cr, uid, confirm, context=context).res_id
+ company_obj.write(cr, uid, default_co, values)
+ return {}
+
+mrp_analytic_installer()
\ No newline at end of file
=== added file 'mrp_analytics_control/wizard/mrp_analytic_installer.xml'
--- mrp_analytics_control/wizard/mrp_analytic_installer.xml 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/mrp_analytic_installer.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- configartion view -->
+
+ <record id="mrp_analytic_installer_view" model="ir.ui.view">
+ <field name="name">mrp.analytic.installer.view</field>
+ <field name="model">mrp.analytic.installer</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="base.res_config_view_base"/>
+ <field name="arch" type="xml">
+ <data>
+ <form position="attributes">
+ <attribute name="string">MRP Analytic Account Configuration</attribute>
+ </form>
+ <separator string="title" position="attributes">
+ <attribute name="string">Configure accounts for MRP</attribute>
+ </separator>
+ <xpath expr="//label[@string='description']" position="attributes">
+ <attribute name="string">Define default accounts to impute MRP costs</attribute>
+ </xpath>
+ <xpath expr='//separator[@string="vsep"]' position='attributes'>
+ <attribute name='rowspan'>15</attribute>
+ <attribute name='string'></attribute>
+ </xpath>
+ <group string="res_config_contents" position="replace">
+ <field name="material_account"/>
+ <field name="workcenter_account"/>
+ <field name="operator_account"/>
+ <newline/>
+ </group>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_config_mrp_analytic_accounts" model="ir.actions.act_window">
+ <field name="name">Configure accounts for MRP</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">mrp.analytic.installer</field>
+ <field name="view_id" ref="mrp_analytic_installer_view"/>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <!-- register configuration wizard -->
+ <record id="config_wizard_mrp_analytic_accounts" model="ir.actions.todo">
+ <field name="action_id" ref="action_config_mrp_analytic_accounts"/>
+ <field name="restart">onskip</field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'mrp_analytics_control/wizard/mrp_analytic_schema_wizard.py'
--- mrp_analytics_control/wizard/mrp_analytic_schema_wizard.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/mrp_analytic_schema_wizard.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,477 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+import gtk, gtk.glade,gtk.gdk
+import wizard
+import pooler
+
+
+class mrp_analytic_wizard(osv.osv_memory):
+ _name = "mrp.analytic.wizard"
+ _description = "Wizard to create account analityc schema"
+
+ _columns = {
+ 'company_id': fields.many2one('res.company','Company', required=True, readonly=True),
+ 'main_account': fields.many2one('account.analytic.account','Main Analytic Account'),
+ }
+
+
+ def get_default_account(self, cr, uid, context=None):
+ analytic_account = self.pool.get('account.analytic.account').search(cr, uid,[('name', '=', 'Manufacturing')])
+ if analytic_account:
+ return analytic_account[0]
+ else:
+ return False
+
+ def default_get(self, cr, uid, fields_list, context=None):
+ values = {}
+ if context == None:
+ context = {}
+ for order in self.pool.get('mrp.production').browse(cr, uid, context['active_ids']):
+ values = {
+ 'company_id': order.company_id.id,
+ 'main_account': self.get_default_account(cr, uid, context),
+ }
+ return values
+
+ def mats_final_cost(self, cr, uid, op):
+ real_obj = self.pool.get('mrp.production.operation.real')
+ real = real_obj.browse(cr, uid, op)
+
+ man_op = real.mrp_manu_op
+ production = real.production_id
+
+ account_analytic_jour_obj = self.pool.get('account.analytic.journal')
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
+ result = []
+
+ #Cuenta analitica de materiales
+
+ prod_mat_name_acc_code = 'OF'+ str(production.id) + 'OP' + str(man_op.id) + 'MAT'
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+
+ #Cuenta analitica de materiales
+
+ prod_mat_name_acc_code = 'OF'+ str(production.id) + 'OP' + str(man_op.id) + 'MAT'
+ account_analytic_search = account_analytic_obj.search(cr, uid,[('code', '=', prod_mat_name_acc_code)])
+ if account_analytic_search:
+ acc_id = account_analytic_search[0]
+ mats_amount = 0
+ for aux in real.move_lines2:
+ if aux.state == 'done':
+ mats_amount += aux.product_id.standard_price * aux.product_qty
+ values = {
+ 'amount':mats_amount*(-1),
+ 'name':prod_mat_name_acc_code,
+ 'date':real.date_finished,
+ 'company_in':wizard_config.company_id.id,
+ 'account_id': acc_id,
+ 'general_account_id': wizard_config.company_id.material_account.id,
+ 'journal_id':man_journal_search[0],
+ }
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, acc_id)
+ return True
+
+ def create_analytic_structure(self, cr, uid, ids, context=None):
+ pool = pooler.get_pool(cr.dbname)
+ if context is None:
+ context = {}
+
+ wizard_config = self.browse(cr, uid, ids)
+ if wizard_config:
+ wizard_config = wizard_config[0]
+ else:
+ return {'type': 'ir.actions.act_window_close'}
+
+ parent_op_acc_name = 'Manufacturing'
+ mrp_production_obj = pool.get('mrp.production')
+ prod_brow = mrp_production_obj.browse(cr, uid,context['active_ids'])
+ operations_obj = pool.get('mrp.production.operation')
+ account_analytic_obj = pool.get('account.analytic.account')
+ account_analytic_jour_obj = pool.get('account.analytic.journal')
+ account_analytic_line_obj = pool.get('account.analytic.line')
+ result = []
+
+ if not (wizard_config.company_id.material_account or wizard_config.company_id.workcenter_account or wizard_config.company_id.operator_account):
+ raise osv.except_osv(_('Unable to perform action'), _('MRP accounts NOT configured for this company.'))
+
+ #Comprobación de que la orden esta iniciada
+ for prod in prod_brow:
+ if prod.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('You cannot create analytic accounting before starting the production order.'))
+
+ #Comprobación y asignación del diario analitico
+
+ man_jornal = False
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', parent_op_acc_name)])
+ if not man_journal_search:
+ values={
+ 'name': parent_op_acc_name,
+ 'type':'general',
+ 'company_id': wizard_config.company_id.id,
+ }
+ man_journal = account_analytic_jour_obj.create(cr, uid, values)
+ man_journal = account_analytic_jour_obj.browse(cr, uid, man_journal)
+ else:
+ man_journal = account_analytic_jour_obj.browse(cr, uid, man_journal_search[0])
+
+ #Comprobación y creación de cuenta analitica general de fabricación
+
+ if wizard_config.main_account:
+ parent_op_acc = wizard_config.main_account
+ else:
+ parent_acc_search = account_analytic_obj.search(cr, uid,[('name', '=', parent_op_acc_name)])
+
+ if parent_acc_search:
+ parent_op_acc = account_analytic_obj.browse(cr, uid, parent_acc_search[0])
+ else:
+ values = {
+ 'name':parent_op_acc_name,
+ 'code':parent_op_acc_name,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'acc_type':'MF',
+ 'total_estimated':0.0,
+ }
+ parent_op_acc_create = account_analytic_obj.create(cr, uid, values)
+ parent_op_acc = account_analytic_obj.browse(cr, uid,parent_op_acc_create)
+ result.append(values)
+
+ #Comprobación y creación de cuenta analitica de orden de fabricación
+ op_acc_code = False
+ production_id = False
+ progress = 90 / len(prod_brow)
+ for prod in prod_brow:
+ production_id = prod.id
+ op_acc_code = 'OF' + str(production_id)
+ acc_search = account_analytic_obj.search(cr, uid,[('code', '=', op_acc_code)])
+
+ if acc_search:
+ raise osv.except_osv(_('Unable to perform action'), _('Analitic account for this Manufacturing order already exists.'))
+ else:
+ values={
+ 'name':op_acc_code + " " +prod.name +" -> "+prod.product_id.name,
+ 'code':op_acc_code,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':parent_op_acc.id,
+ 'total_estimated':0.0,
+ 'acc_type':'OF'
+ }
+ man_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ result.append(values)
+ operations_obj_search = operations_obj.search(cr, uid, [('production_id','=',prod.id)])
+ operations = operations_obj.browse(cr, uid, operations_obj_search)
+
+ #Cuenta analitica de costes fijos
+
+ prod_maq_name_acc_code = op_acc_code + 'FIX'
+ cost_fixed = prod.fixed_costs
+ est = 0
+ for fin in cost_fixed:
+ est += fin.estimated
+ values={
+ 'name':prod_maq_name_acc_code + " " + _('Fixed ') ,
+ 'code':prod_maq_name_acc_code ,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':man_account,
+ 'total_estimated':est,
+ 'acc_type':'FIX',
+ }
+ man_fix_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ values['parent_id'] = man_fix_account
+ result.append(values)
+ account_analytic_obj.recalculate_result(cr, uid, man_fix_account)
+ account_analytic_obj.calculate_estimated(cr, uid, man_account, est)
+
+ #añadir costes reales de costes fijos
+
+ for fin in cost_fixed:
+ values = {
+ 'amount':fin.amount*(-1),
+ 'name':fin.name,
+ 'date':datetime.today(),
+ 'company_in': wizard_config.company_id.id,
+ 'account_id': man_fix_account,
+ 'general_account_id': wizard_config.company_id.material_account.id,
+ 'journal_id':man_journal_search[0],
+ }
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, man_fix_account)
+
+ #Creacion de las cuentas analiticas de operaciones de fabricacion
+
+ for prod_op in operations:
+ prod_op_name_acc_code = op_acc_code + 'OP' + str(prod_op.id)
+ values = {
+ 'name':prod_op_name_acc_code + " " + prod_op.name,
+ 'code':prod_op_name_acc_code,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':man_account,
+ 'total_estimated':0.0,
+ 'acc_type':'OP'
+ }
+ man_op_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ result.append(values)
+
+ #Cuenta analitica de maquina
+
+ prod_maq_name_acc_code = op_acc_code + 'OP' + str(prod_op.id) + 'MA'
+ maq_obj = pool.get('mrp.workcenter')
+ maq = maq_obj.browse(cr, uid, prod_op.workcenter_id.id)
+ if not maq.product_id:
+ raise osv.except_osv(_('You must assign a product to all machines'), _(maq.name))
+
+ aux_product = pool.get('product.product').browse(cr , uid, maq.product_id.id)
+ total_estimated = prod_op.hour * aux_product.standard_price
+ values = {
+ 'name':prod_maq_name_acc_code + " " + _('Machine ') + prod_op.workcenter_id.name,
+ 'code':prod_maq_name_acc_code ,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':man_op_account,
+ 'total_estimated':total_estimated,
+ 'acc_type':'MA'
+ }
+ account_analytic_obj.calculate_estimated(cr, uid, man_op_account, total_estimated)
+ man_maq_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ values['parent_id'] = man_maq_account
+ result.append(values)
+ account_analytic_obj.recalculate_result(cr, uid, man_maq_account)
+
+ #Cuenta analitica de materiales
+
+ prod_mat_name_acc_code = op_acc_code + 'OP' + str(prod_op.id) + 'MAT'
+ total_estimated = 0
+ for aux_mat in prod_op.components_used_ids:
+ total_estimated += aux_mat.product_id.standard_price * aux_mat.product_qty
+
+ values = {
+ 'name':prod_mat_name_acc_code + " " + _('Materials') ,
+ 'code':prod_mat_name_acc_code ,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':man_op_account,
+ 'total_estimated':total_estimated,
+ 'acc_type':'MT'
+ }
+ account_analytic_obj.calculate_estimated(cr, uid, man_op_account, total_estimated)
+ man_mat_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ values['parent_id'] = man_mat_account
+ result.append(values)
+ account_analytic_obj.recalculate_result(cr, uid, man_mat_account)
+
+ #Lineas analiticas de los materiales en las operaciones realizadas hasta ahora
+ real_obj = pool.get('mrp.production.operation.real')
+ real_search = real_obj.search(cr, uid, [('state','=','done'),('mrp_manu_op','=',prod_op.id)])
+ for id in real_search:
+ self.mats_final_cost( cr, uid, id)
+
+ #Crear cuenta analitica de operadores por estimación
+
+ manu_users_obj = pool.get('mrp.production.users')
+ manu_tot_users = manu_users_obj.search(cr, uid, [('op','=',prod_op.id)])
+ usrs = manu_users_obj.browse(cr, uid, manu_tot_users)
+ for manufact_worker in usrs:
+ manu_users_search = manu_users_obj.search(cr, uid, [('name','=',manufact_worker.name.id),('op','=',prod_op.id)])
+ manus = manu_users_obj.browse(cr, uid, manu_users_search)
+
+ user_employer = pool.get('hr.employee').browse(cr, uid, pool.get('hr.employee').search(cr, uid, [('user_id','=',manufact_worker.name.id)]))
+ user_product = pool.get('product.product').browse(cr, uid, user_employer[0].product_id.id)
+ total_estimated=0
+
+ for aux_user in manus:
+ total_estimated = total_estimated + (manufact_worker.percent * user_product.standard_price * prod_op.hour)
+
+ prod_wrk_name_acc_code = op_acc_code + 'OP' + str(prod_op.id) + 'WK'+ str(manufact_worker.name.id)
+ prod_wrk_acc = account_analytic_obj.search(cr, uid, [('code','=', prod_wrk_name_acc_code)])
+
+ #compruebo que existe y adjudico el estimado o no existe y lo creo
+
+ if prod_wrk_acc:
+ wrk_acc = account_analytic_obj.browse(cr, uid, prod_wrk_acc)[0]
+ wrk_acc.total_estimated = total_estimated
+ else:
+ nombre = manufact_worker.name.name
+ values={
+ 'name':prod_wrk_name_acc_code + " " + _('Worker ')+ str(nombre),
+ 'code':prod_wrk_name_acc_code ,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':man_op_account,
+ 'total_estimated':total_estimated,
+ 'acc_type':'WK'
+ }
+ account_analytic_obj.calculate_estimated(cr, uid, man_op_account, total_estimated)
+ man_wrk_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ values['parent_id'] = man_wrk_account
+ result.append(values)
+ account_analytic_obj.recalculate_result(cr, uid, man_wrk_account)
+
+ #Crear cuenta analitica de operadores por inputación
+
+ usr_obj = pool.get('mrp.ops.cost')
+ usr_search = usr_obj.search(cr,uid, [('operation','=',prod_op.id)])
+ usrs = usr_obj.browse(cr, uid, usr_search)
+ for manufact_worker in usrs:
+ nombre = manufact_worker.user.name
+ prod_wrk_name_acc_code = op_acc_code + 'OP' + str(prod_op.id) + 'WK'+ str(manufact_worker.user.id)
+ prod_wrk_acc = account_analytic_obj.search(cr, uid, [('code','=', prod_wrk_name_acc_code)])
+
+ #compruebo que existe la cuenta analitica de este operario sino la creo
+
+ if not prod_wrk_acc:
+ values = {
+ 'name':prod_wrk_name_acc_code + " " + 'Operario '+ str(nombre),
+ 'code':prod_wrk_name_acc_code ,
+ 'currency_id': wizard_config.company_id.currency_id.id,
+ 'company_id': wizard_config.company_id.id,
+ 'state':'open',
+ 'parent_id':man_op_account,
+ 'total_estimated':0,
+ 'acc_type':'WK'
+ }
+ account_analytic_obj.calculate_estimated(cr, uid, man_op_account, total_estimated)
+ man_wrk_account = account_analytic_obj.create(cr, uid, values)
+ values['name'] = '| '+values['name']
+ values['parent_id'] = man_wrk_account
+ result.append(values)
+ account_analytic_obj.recalculate_result(cr, uid, man_wrk_account)
+
+ #Creacion de lineas analiticas de los datos existentes
+
+ ops_op_obj = pool.get('mrp.ops.cost')
+ ops_wc_obj = pool.get('mrp.wc.cost')
+
+ #Costes de maquinas
+
+ ops_wc_obj_all = ops_wc_obj.browse(cr, uid, ops_wc_obj.search(cr, uid, [('production','=',production_id)]))
+ for wc_cost in ops_wc_obj_all:
+ wc_cost_amount = wc_cost.wc.costs_hour * wc_cost.time
+ wc_acc_code = op_acc_code + 'OP' + str(wc_cost.operation.id) + 'MA'
+ wc_account_id = False
+ for aux_result in result:
+ if str(aux_result['code']) == (wc_acc_code):
+ wc_account_id = aux_result['parent_id']
+
+ if not wc_account_id:
+ raise osv.except_osv(_('Error de programación'), _('La cuenta analitica de esta maquina no esta creada. codigo: '+wc_acc_code))
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+ values = {
+ 'amount':wc_cost_amount*(-1),
+ 'name':wc_cost.descript,
+ 'date':wc_cost.date,
+ 'company_in': wizard_config.company_id.id,
+ 'account_id': wc_account_id,
+ 'general_account_id': wizard_config.company_id.workcenter_account.id,
+ 'journal_id':man_journal_search[0],
+ }
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, wc_account_id)
+
+ #Costes de operarios
+
+ ops_op_obj_all = ops_op_obj.browse(cr, uid, ops_op_obj.search(cr, uid, [('production','=',production_id)]))
+ for op_cost in ops_op_obj_all:
+ usr_obj = pool.get('hr.employee')
+ usr_search = usr_obj.search(cr, uid,[('user_id', '=', op_cost.user.id)])
+ usr = usr_obj.browse(cr , uid, usr_search[0])
+ if not usr.product_id:
+ raise osv.except_osv(_('You must assign a product to all employers'), _(usr.name))
+ aux_product = pool.get('product.product').browse(cr , uid, usr.product_id.id)
+ op_cost_amount = aux_product.standard_price * op_cost.time
+ ope_acc_code = op_acc_code + 'OP' + str(op_cost.operation.id) + 'WK'+ str(op_cost.user .id)
+ ope_account_id = False
+ for aux_result in result:
+ if str(aux_result['code']) == (ope_acc_code):
+ ope_account_id = aux_result['parent_id']
+ if not ope_account_id:
+ raise osv.except_osv(_('Error de programación'), _('La cuenta analitica de este operario no esta creada. codigo: '+ope_acc_code))
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+ values = {
+ 'amount':op_cost_amount*(-1),
+ 'name':op_cost.descript,
+ 'date':op_cost.date,
+ 'company_in': wizard_config.company_id.id,
+ 'account_id': ope_account_id,
+ 'general_account_id': wizard_config.company_id.operator_account.id,
+ 'journal_id':man_journal_search[0],
+ }
+
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, ope_account_id)
+
+# res.update({'schema': result})
+# res.update(values)
+
+# val = {
+# 'schema': 'Contabilidad analitica creada'
+# }
+ for prod in prod_brow:
+ if 'mrp_production' in context:
+ context.update({'mrp_production': context['mrp_production'] + ', ' + prod.name})
+ else:
+ context.update({'mrp_production': prod.name})
+ return {'type': 'ir.actions.act_window', 'res_model': 'mrp.analytic.warning', 'view_type': 'form', 'view_mode': 'form', 'target': 'new', 'context':context}
+# return {'type': 'ir.actions.act_window_close'}
+
+mrp_analytic_wizard()
+
+class mrp_analytic_warning(osv.osv_memory):
+ _name = 'mrp.analytic.warning'
+
+ _columns = {
+ 'mrp_production': fields.char('Production Nº', size=64, readonly=True),
+ }
+
+ def default_get(self, cr, uid, fields_list, context=None):
+ values = {}
+ if 'mrp_production' in context:
+ values = {
+ 'mrp_production': context['mrp_production'],
+ }
+ return values
+
+mrp_analytic_warning()
=== added file 'mrp_analytics_control/wizard/mrp_analytic_schema_wizard_view.xml'
--- mrp_analytics_control/wizard/mrp_analytic_schema_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/mrp_analytic_schema_wizard_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="mrp_analytic_wizard_form" model="ir.ui.view">
+ <field name="name">mrp.analytic.wizard.form</field>
+ <field name="model">mrp.analytic.wizard</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Create New Analytic Schema">
+ <group colspan="4">
+ <separator string="Create new analytic schema(s) " colspan="4" />
+ <label string="The 'Main Account' field is the parent analytic account in which is going to hang all analytic scheme. If you left empty this field, the sistem will take/create 'Manufacturing' as a main account." colspan="4"/>
+ </group>
+ <group colspan="4">
+ <field name="company_id" colspan="2"/>
+ <field name="main_account" colspan="2"/>
+ </group>
+ <group colspan="4">
+ <separator colspan="4"/>
+ <label string="Please wait until the operation is performed. This may take some time." />
+ </group>
+ <group colspan="4">
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="create_analytic_structure" icon='gtk-ok' type="object" string="Ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="mrp_analytic_warning_view" model="ir.ui.view">
+ <field name="name">mrp.analytic.warning.form</field>
+ <field name="model">mrp.analytic.warning</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Analytic Schema Created">
+ <group colspan="4">
+ <label string="Analytic account structure successfully created for:" colspan="4"/>
+ <field name="mrp_production" nolabel="1" colspan="2"/>
+ </group>
+ <group colspan="4">
+ <label string="" colspan="2" />
+ <button icon='gtk-ok' special="cancel" string="Ok" colspan="2" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="act_mrp_analityc_create" model="ir.actions.act_window">
+ <field name="name">action.mrp.analytic.wizard </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">mrp.analytic.wizard</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <act_window name="Analytic accounting creation"
+ res_model="mrp.analytic.wizard"
+ src_model="mrp.production"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="analytic_creation_wizard"/>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'mrp_analytics_control/wizard/users.py'
--- mrp_analytics_control/wizard/users.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/users.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,697 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+
+class manufacturing_user(osv.osv_memory):
+ _name = "manufacturing.user"
+ _inherit = "manufacturing.user"
+
+
+ def add_user(self, cr, uid, ids, context=None):
+
+ if context is None:
+ context = {}
+
+ objs = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'])
+ objs2 = self.pool.get('mrp.production.users')
+
+ con_user = []
+ con_ops = []
+ for obj in objs:
+ for usr_op in obj.user_ops:
+ con_user.append((usr_op.name.id, usr_op.op.id))
+ obj_ops = self.pool.get('mrp.production.operation')
+ ops_ids = obj_ops.search(cr, uid,[('production_id', '=',obj.id )])
+ con_ops = obj_ops.browse(cr , uid, ops_ids)
+
+
+ usr = context['user']
+ percent = context['percent']
+
+ if not usr:
+ raise osv.except_osv(_('Unable to perform action'), _('You must select Operator'))
+
+
+ for check in con_ops:
+ create = True
+ for check_op in con_user:
+ if check_op == (usr, check.id):
+ create = False
+ if create:
+ est_time = check.hour * percent /100
+ values = {
+ 'name': usr,
+ 'op':check.id,
+ 'prod':context['active_ids'][0],
+ 'percent': percent,
+ 'est_time':est_time,
+ }
+
+
+ res = objs2.create(cr, uid, values)
+
+
+
+
+#Crear cuenta analitica de operadores por estimación
+
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_analytic_jour_obj = self.pool.get('account.analytic.journal')
+
+ prod__acc_code = 'OF'+ str(context['active_ids'][0]) + 'OP' + str(check.id)
+ prod_op_acc = account_analytic_obj.search(cr, uid, [('code','=', prod__acc_code)])
+ if prod_op_acc:
+
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+ man_jounal = account_analytic_jour_obj.browse(cr, uid, man_journal_search[0])
+
+ user_search = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',usr)])
+ if not user_search:
+ raise osv.except_osv(_('You must assign a product to all employers'), _(usr))
+
+ user_employer = self.pool.get('hr.employee').browse(cr, uid, user_search[0])
+ user_product = self.pool.get('product.product').browse(cr, uid, user_employer.product_id.id)
+
+
+
+ total_estimated=0
+
+ oper = self.pool.get('mrp.production.operation').browse(cr,uid,check.id)
+ total_estimated = total_estimated + ((percent / 100) * user_product.standard_price * oper.hour)
+
+
+
+ prod_wrk_name_acc_code = prod__acc_code + 'WK'+ str(usr)
+
+ prod_wrk_acc = account_analytic_obj.search(cr, uid, [('code','=', prod_wrk_name_acc_code)])
+
+ #compruebo que existe y adjudico el estimado o no existe y lo creo
+
+ if prod_wrk_acc:
+ account_analytic_obj.write(cr, uid,prod_wrk_acc[0],{'total_estimated':total_estimated})
+ account_analytic_obj.recalculate_result(cr, uid, prod_wrk_acc[0])
+ else:
+
+ user = self.pool.get('res.users').browse(cr,uid,usr)
+ nombre = user.name
+
+ values={
+ 'name':prod_wrk_name_acc_code + " " + 'Operario '+ str(nombre),
+ 'code':prod_wrk_name_acc_code ,
+ 'currency_id':1,
+ 'company_id':1,
+ 'state':'open',
+ 'parent_id':prod_op_acc[0],
+ 'total_estimated':total_estimated,
+ }
+
+
+ man_wrk_account = account_analytic_obj.create(cr, uid, values)
+
+ account_analytic_obj.calculate_estimated(cr, uid, prod_op_acc[0], total_estimated)
+ account_analytic_obj.recalculate_result(cr, uid, man_wrk_account)
+
+ return {'type': 'ir.actions.act_window_close'}
+manufacturing_user()
+
+class input_time(osv.osv_memory):
+ _inherit = "input.time"
+ _name = "input.time"
+ _description = "Input time"
+
+ def get_description(self,cr,uid,ids,oid):
+ v={}
+ std_name = self.pool.get('mrp.operation.description').browse(cr,uid,[oid])[0].name
+ v['descript'] = std_name
+ return {'value':v}
+
+ def create_new_analityc_operator_account(self, cr, uid, user_in, op_in, prod_in, context=None):
+
+ #Crear cuenta analitica de operadores
+
+ account_analityc_obj = self.pool.get('account.analytic.account')
+
+ usr_object = self.pool.get('res.users')
+ usr = usr_object.browse(cr,uid,user_in)
+ nombre = usr.name
+
+ parent_code = 'OF'+ str(prod_in) + 'OP' + str(op_in)
+ parent_account = account_analityc_obj.search(cr, uid, [('code','=',parent_code)])[0]
+
+
+
+ prod_wrk_name_acc_code = 'OF'+ str(prod_in) + 'OP' + str(op_in) + 'WK'+ str(user_in)
+
+ values={
+ 'name':prod_wrk_name_acc_code + " " + 'Operario '+ str(nombre),
+ 'code':prod_wrk_name_acc_code ,
+ 'currency_id':1,
+ 'company_id':1,
+ 'state':'open',
+ 'parent_id':parent_account,
+ 'acc_type':'OP'
+ }
+
+
+
+ man_wrk_account = account_analityc_obj.create(cr, uid, values)
+
+ return man_wrk_account
+
+
+
+ def analityc_inpute(self, cr, uid, in_date, in_description, in_user, in_time, in_op, in_prod, context=None):
+
+ #calculo de ammount
+
+ usr_obj = self.pool.get('hr.employee')
+ usr_search = usr_obj.search(cr, uid,[('user_id', '=', in_user)])
+ usr = usr_obj.browse(cr , uid, usr_search[0])
+ if not usr.product_id:
+ raise osv.except_osv(_('You must assign a product to all employers'), _(usr.name))
+ aux_product = self.pool.get('product.product').browse(cr , uid, usr.product_id.id)
+
+ op_cost_amount = aux_product.standard_price * in_time
+
+ #busqueda y asignación de cuenta analitica correspondiente
+
+ ope_acc_code = 'OF'+ str(in_prod) + 'OP' + str(in_op) + 'WK'+ str(in_user)
+
+ ope_account_id = False
+
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_analytic_jour_obj = self.pool.get('account.analytic.journal')
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
+
+ account_search = account_analytic_obj.search(cr, uid, [('code','=',ope_acc_code)])
+ for aux_var in account_search:
+ ope_account_id = aux_var
+
+ if not ope_account_id:
+ ope_account_id=self.create_new_analityc_operator_account(cr, uid, in_user, in_op, in_prod)
+
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+ man_journal = account_analytic_jour_obj.browse(cr, uid, man_journal_search[0])
+
+ values = {
+ 'amount':op_cost_amount*(-1),
+ 'name':in_description,
+ 'date':in_date,
+ 'company_id':1,
+ 'account_id': ope_account_id,
+ 'general_account_id':1030,
+ 'journal_id':man_journal.id,
+ }
+
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, ope_account_id)
+
+ return True
+
+# ############################################# ESTE ES EL INPUT WORK TIME DEL DASHBOARD EN LA MO ###############################################
+
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if not context['descript']:
+ print context['std_description']
+ raise osv.except_osv(_('Missing data'), _('A job description should be given'))
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 011'), _(context['wtime']))
+
+ aux_prod = self.pool.get('mrp.production')
+ aux_prod_op = self.pool.get('mrp.production.operation')
+ op = aux_prod_op.browse(cr , uid, context['operation'])
+
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_us_obj = self.pool.get('mrp.ops.cost')
+
+ us_obj = self.pool.get('production.opert.users')
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ if len(us_search):
+ us = us_search[len(us_search)-1]
+ else:
+ values = {
+ 'user' :context['wuser'],
+ 'production_id':op.production_id.id,
+ 'op':op.id,
+ }
+ res = us_obj.create(cr, uid, values)
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ us = us_search[0]
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+ values = {
+ 'wuser': us,
+ 'user':context['wuser'],
+ 'operation':op.id,
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'std_descr':context['std_description'],
+ 'achievements':context['achievements']
+ }
+
+ res = ops_us_obj.create(cr, uid, values)
+ step_obj = self.pool.get('mrp.operation.description.steps')
+ step_ids = step_obj.search(cr,uid,[('descr_id','=',context['std_description'])])
+ steps = step_obj.browse(cr,uid,step_ids)
+ for s in steps:
+ step_values={
+ 'name':s.name,
+ 'descr_id':res
+ }
+ self.pool.get('mrp.ops.cost.steps').create(cr,uid,step_values)
+ op_user = ops_us_obj.browse(cr,uid,[res],context)[0].user.id
+ p = ops_us_obj.search(cr,uid,[('state','=','working'),('user.id','=',op_user),])
+ for x in p:
+ if x != res:
+ total_spent_time=0
+ h=0
+ for h in ops_us_obj.browse(cr,uid,[x]):
+ ops_us_obj.write(cr,uid,[x],{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1:
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'time':total_spent_time,
+ }
+ ops_us_obj.write(cr,uid,[x],done_values)
+ # inputación a contabilidad analitica
+ ope_acc_code = 'OF'+ str(prod.id)+'OP'+str(op.id)
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_search = account_analytic_obj.search(cr, uid, [('code','=',ope_acc_code)])
+
+ ope_account_id=False
+
+ for aux_var in account_search:
+ ope_account_id = aux_var
+
+ if ope_account_id:
+ resu = self.analityc_inpute(cr, uid ,context['work_date'],context['descript'],context['wuser'],context['wtime'],op.id, prod.id)
+
+
+ #Times
+ op_time_add = op.tot_ops + context['wtime']
+ tot_time_add = op.tot + context['wtime']
+ aux_prod_op.write(cr, uid, context['operation'], {'tot_ops':op_time_add , 'tot':tot_time_add })
+
+ prod_op_time_add = prod.tot_ops + context['wtime']
+ prod_tot_time_add = prod.tot + context['wtime']
+ aux_prod.write(cr, uid, prod.id, {'tot_ops':prod_op_time_add , 'tot':prod_tot_time_add })
+
+ return {'type': 'ir.actions.act_window_close'}
+
+input_time()
+
+class new_input_time(osv.osv_memory):
+ _inherit = "new.input.time"
+ _name = "new.input.time"
+ _description = "new_Input time"
+
+
+################################################## ESTE ES EL INPUT WORK TIME DE LA ALLOCATION OF HOURS EN LA MO #########################################################
+
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 002'), _(context['wtime']))
+
+ if not context['descript']:
+ raise osv.except_osv(_('Missing data'), _('A job description should be given'))
+
+ aux_prod = self.pool.get('mrp.production')
+ aux_prod_op = self.pool.get('mrp.production.operation')
+ op = aux_prod_op.browse(cr , uid, context['operation'])
+
+
+
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_us_obj = self.pool.get('mrp.ops.cost')
+
+ us_obj = self.pool.get('production.opert.users')
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ if len(us_search):
+ us = us_search[len(us_search)-1]
+ else:
+ values = {
+ 'user' :context['wuser'],
+ 'production_id':op.production_id.id,
+ 'op':op.id,
+ }
+ res = us_obj.create(cr, uid, values)
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ us = us_search[0]
+
+
+
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+
+ values = {
+ 'wuser': us,
+ 'user':context['wuser'],
+ 'operation':op.id,
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'std_descr':context['std_description'],
+ 'achievements':context['achievements']
+ }
+ res = ops_us_obj.create(cr, uid, values)
+ step_obj = self.pool.get('mrp.operation.description.steps')
+ step_ids = step_obj.search(cr,uid,[('descr_id','=',context['std_description'])])
+ steps = step_obj.browse(cr,uid,step_ids)
+ for s in steps:
+ step_values={
+ 'name':s.name,
+ 'descr_id':res
+ }
+ self.pool.get('mrp.ops.cost.steps').create(cr,uid,step_values)
+ op_user = ops_us_obj.browse(cr,uid,[res],context)[0].user.id
+ p = ops_us_obj.search(cr,uid,[('state','=','working'),('user.id','=',op_user),])
+ for x in p:
+ if x != res:
+ total_spent_time=0
+ h=0
+ for h in ops_us_obj.browse(cr,uid,[x]):
+ ops_us_obj.write(cr,uid,[x],{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1:
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'time':total_spent_time,
+ }
+ ops_us_obj.write(cr,uid,[x],done_values)
+
+ #INPUTACIÖN ANALITICA
+
+ input_obj = self.pool.get("input.time")
+
+ ope_acc_code = 'OF'+ str(prod.id)+'OP'+str(op.id)
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_search = account_analytic_obj.search(cr, uid, [('code','=',ope_acc_code)])
+
+ ope_account_id=False
+
+ for aux_var in account_search:
+ ope_account_id = aux_var
+
+ if ope_account_id:
+ resu = input_obj.analityc_inpute(cr, uid ,context['work_date'],context['descript'],context['wuser'],context['wtime'],op.id, prod.id)
+
+
+ op_time_add = op.tot_ops + context['wtime']
+ tot_time_add = op.tot + context['wtime']
+ aux_prod_op.write(cr, uid, context['operation'], {'tot_ops':op_time_add , 'tot':tot_time_add })
+
+
+ return {'type': 'ir.actions.act_window_close'}
+
+
+ def input_real_worktime(self, cr, uid, ids, in_wuser, in_wtime, in_op, in_date, in_desc, context=None):
+
+ if context is None:
+ context = {}
+
+ if in_wtime<=0:
+ raise osv.except_osv(_('The time must be greater than 003'), _(in_wtime))
+
+ aux_prod = self.pool.get('mrp.production')
+ aux_prod_op = self.pool.get('mrp.production.operation')
+ op = aux_prod_op.browse(cr , uid, in_op)
+
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_us_obj = self.pool.get('mrp.ops.cost')
+
+ us_obj = self.pool.get('production.opert.users')
+ us_search = us_obj.search(cr, uid,[('user', '=', in_wuser ),('op','=',op.id)])
+ if len(us_search):
+ us = us_search[len(us_search)-1]
+ else:
+ values = {
+ 'user' :in_wuser,
+ 'production_id':op.production_id.id,
+ 'op':op.id,
+ }
+ res = us_obj.create(cr, uid, values)
+ us_search = us_obj.search(cr, uid,[('user', '=', in_wuser ),('op','=',op.id)])
+ us = us_search[0]
+
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ print str(real_id.id) + '\n '+str(op.id)
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+
+ values = {
+ 'wuser': us,
+ 'user':in_wuser,
+ 'operation':op.id,
+ 'time': in_wtime,
+ 'date': in_date,
+ 'descript':in_desc,
+ 'production':prod.id,
+ 'real_op' : real_id.id
+ }
+
+ res = ops_us_obj.create(cr, uid, values)
+
+
+ #INPUTACIÖN ANALITICA
+
+ input_obj = self.pool.get("input.time")
+
+ ope_acc_code = 'OF'+ str(prod.id)+'OP'+str(op.id)
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_search = account_analytic_obj.search(cr, uid, [('code','=',ope_acc_code)])
+
+ ope_account_id=False
+
+ for aux_var in account_search:
+ ope_account_id = aux_var
+
+ if ope_account_id:
+ resu = input_obj.analityc_inpute(cr, uid ,in_date,in_desc,in_wuser,in_wtime,op.id, prod.id)
+
+
+ op_time_add = op.tot_ops + in_wtime
+ tot_time_add = op.tot + in_wtime
+ aux_prod_op.write(cr, uid, op.id, {'tot_ops':op_time_add , 'tot':tot_time_add })
+
+ return True
+
+new_input_time()
+
+
+class manufacturing_user_op_add(osv.osv_memory):
+ _inherit = "manufacturing.user.op.add"
+ _name = "manufacturing.user.op.add"
+ _description = "Manufacturing new user"
+
+
+
+
+ def add_user_op(self, cr, uid, ids, context=None):
+
+ if context is None:
+ context = {}
+
+ production = context['production']
+
+ objs = self.pool.get('mrp.production').browse(cr , uid, production)
+
+
+ usr = context['user']
+ percent = context['percent']
+
+ objs2 = self.pool.get('mrp.production.users')
+ objs2_id = objs2.search(cr, uid,[('prod', '=', [production])])
+ objs2_s = objs2.browse(cr , uid, objs2_id)
+
+ con_user = []
+
+ for usr_op in objs2_s:
+ con_user.append((usr_op.name.id, usr_op.op.id))
+
+
+
+
+ check = context['operation']
+ st_est_time = context['est_time']
+
+ est_time_list = st_est_time.rsplit(':')
+ est_time = float(est_time_list[0])+(float(est_time_list[1])/60)+(float(est_time_list[2])/360)
+
+
+ create = True
+
+ for check_op in con_user:
+ if check_op == (usr, check):
+ create = False
+ if create:
+
+ values = {
+ 'name': usr,
+ 'op':check,
+ 'prod':production,
+ 'percent':percent,
+ 'est_time':est_time
+ }
+ res = objs2.create(cr, uid, values)
+
+
+
+ #Crear cuenta analitica de operadores por estimación
+
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_analytic_jour_obj = self.pool.get('account.analytic.journal')
+
+ prod__acc_code = 'OF'+ str(production) + 'OP' + str(check)
+ prod_op_acc = account_analytic_obj.search(cr, uid, [('code','=', prod__acc_code)])
+
+ if prod_op_acc:
+
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+ man_jounal = account_analytic_jour_obj.browse(cr, uid, man_journal_search[0])
+
+ user_search = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',usr)])
+ if not user_search:
+ raise osv.except_osv(_('You must assign a product to all employers'), _(usr))
+
+ user_employer = self.pool.get('hr.employee').browse(cr, uid, user_search[0])
+ user_product = self.pool.get('product.product').browse(cr, uid, user_employer.product_id.id)
+
+
+
+ total_estimated=0
+
+ oper = self.pool.get('mrp.production.operation').browse(cr,uid,check)
+ total_estimated = total_estimated + ((percent / 100) * user_product.standard_price * oper.hour)
+
+
+
+ prod_wrk_name_acc_code = prod__acc_code + 'WK'+ str(usr)
+
+ prod_wrk_acc = account_analytic_obj.search(cr, uid, [('code','=', prod_wrk_name_acc_code)])
+
+ #compruebo que existe y adjudico el estimado o no existe y lo creo
+
+ if prod_wrk_acc:
+ account_analytic_obj.write(cr, uid,prod_wrk_acc[0],{'total_estimated':total_estimated})
+ account_analytic_obj.recalculate_result(cr, uid, prod_wrk_acc[0])
+ else:
+
+ user = self.pool.get('res.users').browse(cr,uid,usr)
+ nombre = user.name
+
+ values={
+ 'name':prod_wrk_name_acc_code + " " + 'Operario '+ str(nombre),
+ 'code':prod_wrk_name_acc_code ,
+ 'currency_id':1,
+ 'company_id':1,
+ 'state':'open',
+ 'parent_id':prod_op_acc[0],
+ 'total_estimated':total_estimated,
+ }
+
+
+ man_wrk_account = account_analytic_obj.create(cr, uid, values)
+
+ account_analytic_obj.calculate_estimated(cr, uid, prod_op_acc[0], total_estimated)
+ account_analytic_obj.recalculate_result(cr, uid, man_wrk_account)
+
+
+
+ return {'type': 'ir.actions.act_window_close'}
+
+manufacturing_user_op_add()
+
+class mrp_production_users(osv.osv):
+ _inherit = 'mrp.production.users'
+ _name = 'mrp.production.users'
+
+ def delete_it(self, cr, uid, ids, context=None):
+ user = self.browse(cr, uid, ids)[0]
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ acc_code = 'OF'+str(user.prod.id)+'OP'+str(user.op.id)+'WK'+ str(user.name.id)
+ acc_id = account_analytic_obj.search(cr, uid,[('code','=',acc_code)])
+ account_analytic_obj.write(cr, uid,acc_id,{'total_estimated':0} )
+ self.unlink(cr, uid,ids, context=context)
+ return False
+mrp_production_users()
=== added file 'mrp_analytics_control/wizard/wc.py'
--- mrp_analytics_control/wizard/wc.py 1970-01-01 00:00:00 +0000
+++ mrp_analytics_control/wizard/wc.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,267 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+
+
+
+
+class input_time_wc(osv.osv_memory):
+ _inherit = "input.time.wc"
+ _name = "input.time.wc"
+ _description = "Input time"
+
+ def create_new_analityc_operator_account(self, cr, uid, user_in, op_in, prod_in, context=None):
+
+ #Crear cuenta analitica de operadores
+
+ account_analityc_obj = self.pool.get('account.analytic.account')
+
+ usr_object = self.pool.get('res.users')
+ usr = usr_object.browse(cr,uid,user_in)
+ nombre = usr.name
+
+ parent_code = 'OF'+ str(prod_in) + 'OP' + str(op_in)
+ parent_account = account_analityc_obj.search(cr, uid, [('code','=',parent_code)])[0]
+
+
+
+ prod_wrk_name_acc_code = 'OF'+ str(prod_in) + 'OP' + str(op_in) + 'WK'+ str(user_in)
+
+ values={
+ 'name':prod_wrk_name_acc_code + " " + 'Operario '+ str(nombre),
+ 'code':prod_wrk_name_acc_code ,
+ 'currency_id':1,
+ 'company_id':1,
+ 'state':'open',
+ 'parent_id':parent_account,
+ 'acc_type':'MA'
+ }
+
+
+
+ man_wrk_account = account_analityc_obj.create(cr, uid, values)
+
+ return man_wrk_account
+
+
+
+ def analityc_inpute(self, cr, uid, in_date, in_description, in_wc, in_time, in_op, in_prod, context=None):
+
+ #calculo de ammount
+
+ wc_obj = self.pool.get('mrp.workcenter')
+ usr_search = wc_obj.search(cr, uid,[('id', '=', in_wc)])
+ wc = wc_obj.browse(cr , uid, usr_search[0])
+ if not wc.product_id:
+ raise osv.except_osv(_('You must assign a product to all employers'), _(wc.name))
+ aux_product = self.pool.get('product.product').browse(cr , uid, wc.product_id.id)
+
+ op_cost_amount = aux_product.standard_price * in_time
+
+ #busqueda y asignación de cuenta analitica correspondiente
+
+ ope_acc_code = 'OF'+ str(in_prod) + 'OP' + str(in_op) + 'MA'
+
+ ope_account_id = False
+
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_analytic_jour_obj = self.pool.get('account.analytic.journal')
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
+
+ account_search = account_analytic_obj.search(cr, uid, [('code','=',ope_acc_code)])
+ for aux_var in account_search:
+ ope_account_id = aux_var
+
+
+ man_journal_search = account_analytic_jour_obj.search(cr, uid,[('name', '=', 'Manufacturing')])
+ man_journal = account_analytic_jour_obj.browse(cr, uid, man_journal_search[0])
+
+ values = {
+ 'amount':op_cost_amount*(-1),
+ 'name':in_description,
+ 'date':in_date,
+ 'company_id':1,
+ 'account_id': ope_account_id,
+ 'general_account_id':1185,
+ 'journal_id':man_journal.id,
+ }
+
+ new_id = account_analytic_line_obj.create(cr, uid, values)
+ account_analytic_obj.recalculate_result(cr, uid, ope_account_id)
+
+ return True
+############################################### MACHINE INPUT VIA DASHBOARD ###########################################
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 02'), _(context['wtime']))
+
+ aux = self.pool.get('mrp.production.operation')
+ op = aux.browse(cr , uid, context['operation'])
+
+ aux_prod = self.pool.get('mrp.production')
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_wc_obj = self.pool.get('mrp.wc.cost')
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+ print "This is it"
+ values = {
+ 'wc': context['wc'],
+ 'operation':context['operation'],
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'date_end':context['date_end'],
+ 'state':'working'
+ }
+
+ res = ops_wc_obj.create(cr, uid, values)
+ op_wc = ops_wc_obj.browse(cr,uid,[res],context)[0].wc.id
+ p = ops_wc_obj.search(cr,uid,[('state','=','working'),('wc.id','=',op_wc),])
+ for x in p:
+ if x != res:
+ total_spent_time=0
+ h=0
+ for h in ops_wc_obj.browse(cr,uid,[x]):
+ ops_wc_obj.write(cr,uid,[x],{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1:
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'time':total_spent_time,
+ }
+ ops_wc_obj.write(cr,uid,[x],done_values)
+
+ # inputación a contabilidad analitica
+
+ ope_acc_code = 'OF'+ str(prod.id)+'OP'+str(op.id)
+ account_analytic_obj = self.pool.get('account.analytic.account')
+ account_search = account_analytic_obj.search(cr, uid, [('code','=',ope_acc_code)])
+
+ ope_account_id=False
+
+ for aux_var in account_search:
+ ope_account_id = aux_var
+
+ if ope_account_id:
+ resu = self.analityc_inpute(cr, uid ,context['work_date'],context['descript'],context['wc'],context['wtime'],op.id, prod.id)
+
+
+ return {'type': 'ir.actions.act_window_close'}
+input_time_wc()
+
+class new_input_time_wc(osv.osv_memory):
+ _inherit = "new.input.time.wc"
+ _name = "new.input.time.wc"
+ _description = "Input time"
+
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 02'), _(context['wtime']))
+ aux = self.pool.get('mrp.production.operation')
+ op = aux.browse(cr , uid, context['operation'])
+
+ aux_prod = self.pool.get('mrp.production')
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_wc_obj = self.pool.get('mrp.wc.cost')
+ wc = op.workcenter_id
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+
+ values = {
+ 'wc': wc.id,
+ 'operation':context['operation'],
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start': context['date_start'],
+ 'state':'working',
+ }
+
+ res = ops_wc_obj.create(cr, uid, values)
+ op_wc = ops_wc_obj.browse(cr,uid,[res],context)[0].wc.id
+ p = ops_wc_obj.search(cr,uid,[('state','=','working'),('wc.id','=',op_wc),])
+ for x in p:
+ if x != res:
+ total_spent_time=0
+ h=0
+ for h in ops_wc_obj.browse(cr,uid,[x]):
+ ops_wc_obj.write(cr,uid,[x],{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1:
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'time':total_spent_time,
+ }
+ ops_wc_obj.write(cr,uid,[x],done_values)
+
+
+ return {'type': 'ir.actions.act_window_close'}
+new_input_time_wc()
=== added directory 'mrp_manufacturing_cost'
=== added file 'mrp_manufacturing_cost/__init__.py'
--- mrp_manufacturing_cost/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import cost
+import wizard
\ No newline at end of file
=== added file 'mrp_manufacturing_cost/__openerp__.py'
--- mrp_manufacturing_cost/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/__openerp__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,50 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+{
+ "name" : "MRP Costs",
+ "version" : "0.1",
+ "description" : """This module adds new features to the actual OpenERP manufacturing""",
+ "author" : "Avanzosc & Ting! (Urtzi Odriozola and Francisco Pascual)",
+ "website" : "http://ting.es - http://www.avanzosc.com",
+ "depends" : [
+ 'mrp',
+ 'mrp_master_extension',
+ 'hr_timesheet',
+ 'hr_timesheet_sheet',
+ 'mrp_operations_ext',
+ 'project',
+
+ ],
+ "category" : "Custom Modules",
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : [
+ 'wizard/final_cost_view.xml',
+ 'wizard/wc_view.xml',
+ 'wizard/users_view.xml',
+ 'cost_view.xml',
+
+
+
+ ],
+ "active": False,
+ "installable": True
+}
=== added file 'mrp_manufacturing_cost/cost.py'
--- mrp_manufacturing_cost/cost.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/cost.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,430 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+import time
+from datetime import datetime
+
+class production_opert_users(osv.osv):
+ _name = 'production.opert.users'
+ _columns = {
+ 'name':fields.char('Name', size=54),
+ 'user' :fields.many2one('res.users','Operator'),
+ 'production':fields.many2one('mrp.production', 'Production'),
+ 'op':fields.many2one('mrp.production.operation', 'Operation'),
+ 'ops_times' : fields.one2many('mrp.ops.cost', 'wuser', 'Production Operations'),
+ }
+
+
+production_opert_users()
+
+
+
+class mrp_production_users(osv.osv):
+ _inherit = 'mrp.production.users'
+ _name = 'mrp.production.users'
+
+ def delete_it(self, cr, uid, ids,context=None):
+ obj = self.browse(cr, uid, ids, context=context)
+ for aux in obj:
+ prod_us_op_search = self.pool.get('mrp.ops.cost').search(cr, uid,[('user', '=', aux.name.id ),('operation','=',aux.op.id)])
+
+ if prod_us_op_search:
+ raise osv.except_osv(_('The operator can not be deleted, has hours charged.'), _(aux.name.name))
+ else:
+ self.unlink(cr, uid,ids, context=context)
+ return False
+
+
+mrp_production_users()
+
+
+
+class mrp_ops_cost(osv.osv):
+ """
+ Operators cost
+ """
+ _name = 'mrp.ops.cost'
+
+ def action_done(self,cr,uid,ids,context=None):
+ total_spent_time=0
+ print "wtf?"
+ h=0
+ who_is = self.browse(cr,uid,ids)[0].wuser.id
+ user_works = self.search(cr,uid,[('wuser','=',who_is),])
+ userw = self.browse(cr,uid,user_works)
+ start = time.strptime(self.browse(cr,uid,ids)[0].date_start,"%Y-%m-%d %H:%M:%S")
+ for w in userw:
+ if w.id != ids[0]:
+ otherend = time.strptime(w.date_end,"%Y-%m-%d %H:%M:%S")
+ otherstart = time.strptime(w.date_start,"%Y-%m-%d %H:%M:%S")
+ if(start.tm_year == otherstart.tm_year) and (start.tm_yday == otherstart.tm_yday):
+ if(start.tm_hour == otherstart.tm_hour):
+ if(start.tm_min < otherend.tm_min):
+ raise osv.except_osv (('Warning!'),_('Error start minute is lower than some other task, double check your inputs...'))
+ return False
+ else:
+ if(start.tm_hour < otherstart.tm_hour):
+ raise osv.except_osv (('Warning!'),_('Error start hour is lower than some other task, you canot do stuff in the past, do you?'))
+ return False
+ for h in self.browse(cr,uid,ids):
+###################### AUTOMATIC IMPUT TIME
+ if h.date_end == False:
+ self.write(cr,uid,ids,{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ for hh in self.browse(cr,uid,ids):
+ end = time.strptime(hh.date_end,"%Y-%m-%d %H:%M:%S")
+
+##################### MANUAL IMPUT TIME
+ else:
+ stdate = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ eddate = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ if (stdate.tm_year == eddate.tm_year) and (stdate.tm_mon == eddate.tm_mon) and (stdate.tm_mday == eddate.tm_mday):
+ if (stdate.tm_hour > eddate.tm_hour):
+ raise osv.except_osv (('Warning !'),_('Error start hour is bigger than end hour, isnt it weird?'))
+ return resu
+ else:
+ if (stdate.tm_hour == eddate.tm_hour):
+ if(stdate.tm_min > eddate.tm_min):
+ raise osv.except_osv (('Warning !'),_('Error start min is biger than end min, isnt it weird?'))
+ return resu
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1 :
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'time':total_spent_time,
+ }
+ self.write(cr,uid,ids,done_values)
+ return
+
+ _columns = {
+
+ 'user':fields.many2one('res.users','Operator'),
+ 'production':fields.many2one('mrp.production','Production'),
+ 'operation':fields.many2one('mrp.production.operation', 'Operation'),
+ 'real_op': fields.many2one('mrp.production.operation.real','Real operation'),
+ 'time':fields.float('Time'),
+ 'date':fields.date('Date'),
+ 'descript':fields.text('Notes'),
+ 'wuser':fields.many2one('production.opert.users','Operator_relation'),
+ 'date_start': fields.datetime('Start time'),
+ 'date_end': fields.datetime('End time'),
+ 'state':fields.selection([('draft','Draft'),('working','Working'),('done','Done')],'Status',readonly=True,required=True,select=True),
+ 'std_descr':fields.many2one('mrp.operation.description','Standard Description'),
+ 'achievements': fields.integer('Achievements (%)'),
+ 'steps':fields.one2many('mrp.ops.cost.steps','descr_id','Steps'),
+ 'task_id':fields.many2one('project.task', 'Task', required=False),
+ }
+ _defaults={'state':'working',
+ 'date_start':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ }
+mrp_ops_cost()
+
+class mrp_ops_cost_steps(osv.osv):
+ _name = 'mrp.ops.cost.steps'
+ _columns = {
+ 'check':fields.boolean('State', required=False),
+ 'name':fields.char('Name', size=54),
+ 'descr_id':fields.many2one('mrp.ops.cost','Description'),
+ }
+mrp_ops_cost_steps()
+
+class mrp_wc_cost(osv.osv):
+ """
+ Work center cost
+ """
+ _name = 'mrp.wc.cost'
+
+ def action_done(self,cr,uid,ids,context=None):
+ total_spent_time=0
+ h=0
+ what_is = self.browse(cr,uid,ids)[0].wc.id
+ wc_works = self.search(cr,uid,[('wc.id','=',what_is),])
+ wcw = self.browse(cr,uid,wc_works)
+ start = time.strptime(self.browse(cr,uid,ids)[0].date_start,"%Y-%m-%d %H:%M:%S")
+ print wcw
+ for w in wcw:
+ if w.id != ids[0]:
+ otherend = time.strptime(w.date_end,"%Y-%m-%d %H:%M:%S")
+ otherstart = time.strptime(w.date_start,"%Y-%m-%d %H:%M:%S")
+ if(start.tm_year == otherstart.tm_year) and (start.tm_yday == otherstart.tm_yday):
+ if(start.tm_hour == otherstart.tm_hour):
+ if(start.tm_min < otherend.tm_min):
+ raise osv.except_osv (('Warning!'),_('Error start minute is lower than some other task, double check your inputs...'))
+ return False
+ else:
+ if(start.tm_hour < otherstart.tm_hour):
+ raise osv.except_osv (('Warning!'),_('Error start hour is lower than some other task, you canot do stuff in the past, do you?'))
+ return False
+ for h in self.browse(cr,uid,ids):
+###################### AUTOMATIC IMPUT TIME
+ if h.date_end == False:
+ self.write(cr,uid,ids,{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ for hh in self.browse(cr,uid,ids):
+ end = time.strptime(hh.date_end,"%Y-%m-%d %H:%M:%S")
+
+##################### MANUAL IMPUT TIME
+ else:
+ stdate = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ eddate = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ if (stdate.tm_year == eddate.tm_year) and (stdate.tm_mon == eddate.tm_mon) and (stdate.tm_mday == eddate.tm_mday):
+ if (stdate.tm_hour > eddate.tm_hour):
+ raise osv.except_osv (('Warning !'),_('Error start hour is bigger than end hour, isnt it weird?'))
+ return resu
+ else:
+ if (stdate.tm_hour == eddate.tm_hour):
+ if(stdate.tm_min > eddate.tm_min):
+ raise osv.except_osv (('Warning !'),_('Error start min is biger than end min, isnt it weird?'))
+ return resu
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1 :
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'time':total_spent_time,
+ }
+ self.write(cr,uid,ids,done_values)
+ return
+
+ _columns = {
+
+ 'wc':fields.many2one('mrp.workcenter','Work center'),
+ 'production':fields.many2one('mrp.production','Production'),
+ 'operation':fields.many2one('mrp.production.operation', 'Operation'),
+ 'real_op': fields.many2one('mrp.production.operation.real','Real operation'),
+ 'time':fields.float('Time'),
+ 'date':fields.date('Date'),
+ 'descript':fields.text('Description'),
+ 'date_start': fields.datetime('Start time'),
+ 'date_end': fields.datetime('End time'),
+ 'achievements': fields.integer('Achievements (%)'),
+ 'state':fields.selection([('draft','Draft'),('working','Working'),('done','Done')],'Status',readonly=True,required=True),
+ }
+
+mrp_wc_cost()
+class production_opert_users(osv.osv):
+ _name = 'production.opert.users'
+ _columns = {
+ 'name':fields.char('Name', size=54),
+ 'user' :fields.many2one('res.users','Operator'),
+ 'production':fields.many2one('mrp.production', 'Production'),
+ 'op':fields.many2one('mrp.production.operation', 'Operation'),
+ 'ops_times' : fields.one2many('mrp.ops.cost', 'wuser', 'Production Operations'),
+ }
+
+
+production_opert_users()
+
+class manufacturing_user_op(osv.osv):
+ _inherit = 'mrp.production.operation'
+ _name = 'mrp.production.operation'
+ _columns = {
+ 'tot':fields.float('Total hr'),
+ 'tot_ops':fields.float('Total hr operators'),
+ 'tot_mac':fields.float('Total hr machines'),
+ }
+ _defaults = {
+ 'tot': 0,
+ 'tot_ops': 0,
+ 'tot_mac': 0,
+ }
+manufacturing_user_op()
+
+class mrp_production(osv.osv):
+ _name = "mrp.production"
+ _inherit = "mrp.production"
+
+ def action_done(self,cr,uid,ids,context=None):
+ print context['wuser']
+# total_spent_time=0
+# h=0
+# who_is = self.browse(cr,uid,ids)[0].wuser.id
+# user_works = self.search(cr,uid,[('wuser','=',who_is),])
+# userw = self.browse(cr,uid,user_works)
+# start = time.strptime(self.browse(cr,uid,ids)[0].date_start,"%Y-%m-%d %H:%M:%S")
+# print userw
+# for w in userw:
+# if w.id != ids[0]:
+# otherend = time.strptime(w.date_end,"%Y-%m-%d %H:%M:%S")
+# otherstart = time.strptime(w.date_start,"%Y-%m-%d %H:%M:%S")
+# if(start.tm_year == otherstart.tm_year) and (start.tm_yday == otherstart.tm_yday):
+# if(start.tm_hour == otherstart.tm_hour):
+# if(start.tm_min < otherend.tm_min):
+# raise osv.except_osv (('Warning!'),_('Error start minute is lower than some other task, double check your inputs...'))
+# return False
+# else:
+# if(start.tm_hour < otherstart.tm_hour):
+# raise osv.except_osv (('Warning!'),_('Error start hour is lower than some other task, you canot do stuff in the past, do you?'))
+# return False
+# for h in self.browse(cr,uid,ids):
+####################### AUTOMATIC IMPUT TIME
+# if h.date_end == False:
+# self.write(cr,uid,ids,{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+# for hh in self.browse(cr,uid,ids):
+# end = time.strptime(hh.date_end,"%Y-%m-%d %H:%M:%S")
+#
+###################### MANUAL IMPUT TIME
+# else:
+# stdate = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+# eddate = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+# if (stdate.tm_year == eddate.tm_year) and (stdate.tm_mon == eddate.tm_mon) and (stdate.tm_mday == eddate.tm_mday):
+# if (stdate.tm_hour > eddate.tm_hour):
+# raise osv.except_osv (('Warning !'),_('Error start hour is bigger than end hour, isnt it weird?'))
+# return resu
+# else:
+# if (stdate.tm_hour == eddate.tm_hour):
+# if(stdate.tm_min > eddate.tm_min):
+# raise osv.except_osv (('Warning !'),_('Error start min is biger than end min, isnt it weird?'))
+# return resu
+# end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+# start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+# sum_hours = 0
+# if (end.tm_hour - start.tm_hour) < 1 :
+# sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+# else:
+# if (end.tm_min < start.tm_min):
+# sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+# else:
+# sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+#
+# total_spent_time = total_spent_time + sum_hours
+# done_values = {
+# 'state':'done',
+# 'time':total_spent_time,
+# }
+# self.write(cr,uid,ids,done_values)
+ return
+
+ _columns = {
+ 'users_cost':fields.one2many('production.opert.users', 'production', 'Users'),
+ 'ops_times' : fields.one2many('mrp.ops.cost', 'production', 'Users times'),
+ 'wc_times':fields.one2many('mrp.wc.cost', 'production', 'Work centers'),
+ 'tot':fields.float('Total'),
+ 'tot_ops':fields.float('Total Operators'),
+ 'tot_mac':fields.float('Total Machines'),
+ 'tot_cost':fields.float('Total cost'),
+ 'ops_cost':fields.float('Operators cost'),
+ 'mac_cost':fields.float('Machines cost'),
+ }
+ _defaults = {
+ 'tot': 0,
+ 'tot_ops': 0,
+ 'tot_mac': 0,
+ 'tot_cost':0,
+ 'ops_cost':0,
+ 'mac_cost':0,
+ }
+mrp_production()
+
+class mrp_production_operation_real(osv.osv):
+ _inherit = "mrp.production.operation.real"
+ _name = "mrp.production.operation.real"
+ _order = "sequence, date_planned"
+
+ _columns = {
+#ALLOCATION OF HOUR
+ 'operators_all_hours':fields.one2many('mrp.ops.cost','real_op','Operators'),
+ 'wc_all_hours':fields.one2many('mrp.wc.cost','real_op','Machines'),
+ }
+
+ def action_pause(self, cr, uid, ids):
+ """ Sets state to pause.
+ @return: True
+ """
+
+ delay = 0.0
+ date_now = time.strftime('%Y-%m-%d %H:%M:%S')
+ obj_line = self.browse(cr, uid, ids[0])
+
+ date_start = datetime.strptime(obj_line.date_start,'%Y-%m-%d %H:%M:%S')
+
+ if obj_line.date_restart:
+ date_start = datetime.strptime(obj_line.date_restart,'%Y-%m-%d %H:%M:%S')
+
+ date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
+ delay += (date_finished-date_start).days * 24
+ delay += (date_finished-date_start).seconds / float(60*60)
+
+ time_obj = self.pool.get('new.input.time')
+
+
+ time_obj.input_real_worktime(cr, uid, ids, uid, delay, obj_line.mrp_manu_op.id, date_now, 'Work in '+str(obj_line.workcenter_id.name))
+
+
+ self.write(cr, uid, ids, {'state':'pause', 'date_pause': date_now})
+
+ return True
+
+ def action_done(self, cr, uid, ids):
+ """ Sets state to done, writes finish date and calculates delay.
+ @return: True
+ """
+ tot_time = 0.0
+ date_now = time.strftime('%Y-%m-%d %H:%M:%S')
+ obj_line = self.browse(cr, uid, ids[0])
+
+ date_start = datetime.strptime(obj_line.date_start,'%Y-%m-%d %H:%M:%S')
+
+ date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
+ tot_time += (date_finished-date_start).days * 24
+ tot_time += (date_finished-date_start).seconds / float(60*60)
+
+ tot_time -= obj_line.paused_time
+
+ if obj_line.date_restart:
+ date_start = datetime.strptime(obj_line.date_restart,'%Y-%m-%d %H:%M:%S')
+
+ delay = 0.0
+
+ date_finished = datetime.strptime(date_now,'%Y-%m-%d %H:%M:%S')
+ delay += (date_finished-date_start).days * 24
+ delay += (date_finished-date_start).seconds / float(60*60)
+
+
+ time_obj = self.pool.get('new.input.time')
+
+ time_obj.input_real_worktime(cr, uid, ids, uid, delay, obj_line.mrp_manu_op.id, date_now, 'Work in '+str(obj_line.workcenter_id.name))
+
+ self.write(cr, uid, ids, {'state':'done', 'date_finished': date_now,'delay':tot_time})
+ self.modify_production_order_state(cr,uid,ids,'done')
+ return True
+mrp_production_operation_real()
+
+
=== added file 'mrp_manufacturing_cost/cost_view.xml'
--- mrp_manufacturing_cost/cost_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/cost_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,263 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="mrp_production_operation_inherit_tree_view" model="ir.ui.view">
+ <field name="name">mrp.production.operation.inherit.tree</field>
+ <field name="model">mrp.production.operation</field>
+ <field name="inherit_id" ref="mrp_master_extension.mrp_production_operation_tree_view" />
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/tree/button" position="before">
+ <button name="%(act_users_cost)d" string="Operators costs" type="action" icon="gtk-select-all" />
+ <button name="%(act_wc_cost)d" string="Machines costs" type="action" icon="terp-accessories-archiver" />
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+
+ <record id="user_allocation_group" model="ir.ui.view">
+ <field name="name">user.alocat.search</field>
+ <field name="model">mrp.ops.cost</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search>
+ <field name="user"/>
+ <field name="state"/>
+ <group expand='0' string='Group by...' groups="base.group_extended">
+ <filter string='Operation' name="operation" icon="terp-stock_symbol-selection"
+ domain="[]" context="{'group_by' : 'operation'}" />
+ <filter string='User' name="user" icon="terp-stock_symbol-selection"
+ domain="[]" context="{'group_by' : 'user'}" />
+ </group>
+ </search>
+ </field>
+ </record>
+<!-- ACCIONES -->
+ <record model="ir.actions.act_window" id="ops_cost_list_action">
+ <field name="name">Operation Time</field>
+ <field name="res_model">mrp.ops.cost</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="help">All inputs</field>
+ </record>
+
+ <record id="op_time_tree" model="ir.ui.view">
+ <field name="name">op.time.cost.tree</field>
+ <field name="model">mrp.ops.cost</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree>
+ <field name="operation" readonly="1" />
+ <field name="user" readonly="1"/>
+ <field name="time" widget="float_time" readonly="1"/>
+ <field name="date" readonly="1"/>
+ <field name="date_start" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="date_end" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="state"/>
+ <field name="std_descr" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="achievements" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="descript" attrs="{'readonly':[('state','=','done')]}" />
+
+<!-- THIS IS IT -->
+ <button string="End"
+ type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'user':user, 'operation':operation, 'time':time, 'date':date, 'date_end':date_end,'date_end':date_start,'state':state,}"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="op_time_change" model="ir.ui.view">
+ <field name="name">op.time.cost</field>
+ <field name="model">mrp.ops.cost</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field name="operation" readonly="1" />
+ <field name="user" readonly="1"/>
+ <field name="time" widget="float_time" readonly="1"/>
+ <field name="date" readonly="1"/>
+ <field name="date_start" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="date_end" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="state" invisible="1"/>
+ <field name="std_descr" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="achievements" attrs="{'readonly':[('state','=','done')]}"/>
+
+ <newline/>
+ <newline/>
+ <newline/>
+ <newline/>
+ <field name="descript" attrs="{'readonly':[('state','=','done')]}" />
+ <field name="steps" mode="tree,form" attrs="{'readonly':[('state','=','done')]}">
+ <tree string="List of stuff" editable="bottom" >
+ <field name="check"/>
+ <field name="name"/>
+ </tree>
+ <form>
+ <field name="check"/>
+ <field name="name"/>
+ </form>
+ </field>
+ <newline/>
+ <newline/>
+<!-- THIS IS IT -->
+ <button string="End"
+ type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'user':user, 'operation':operation, 'time':time, 'date':date, 'date_end':date_end,'date_end':date_start,'state':state,}"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="wc_time_change" model="ir.ui.view">
+ <field name="name">wc.time.cost</field>
+ <field name="model">mrp.wc.cost</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field name="wc" readonly="1" />
+ <field name="time" widget="float_time" readonly="1"/>
+ <field name="date" readonly="1"/>
+ <field name="date_start" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="date_end" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="state" invisible="1"/>
+ <newline/>
+ <newline/>
+ <newline/>
+ <newline/>
+ <field name="descript" readonly="1"/>
+ <button string="End"
+ type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'user':user, 'operation':operation, 'time':time, 'date':date, 'date_end':date_end,'date_end':date_star,'state':state,}"/>
+ </form>
+ </field>
+ </record>
+
+
+ <record id="mrp_production_inherit_inherit_form_view" model="ir.ui.view">
+ <field name="name">mrp.production.inherit.inherit.form</field>
+ <field name="model">mrp.production</field>
+ <field name="inherit_id" ref="mrp.mrp_production_form_view" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/notebook/page[@string='Extra Information']"
+ position="before">
+ <page string="Allocation of hours">
+ <field name="ops_times" nolabel="1" widget="one2many_list" colspan="4" context="{'group_by' : 'operation'}" >
+ <tree string="Users">
+ <field name="user" width="100" readonly="1"/>
+ <field name="operation" width="80" readonly="1"/>
+ <field name="time" width="80" widget="float_time" readonly="0"/>
+ <field name="date" width="150" readonly="1"/>
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <field name="state" invisible="1"/>
+ <field name="std_descr" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="achievements" attrs="{'readonly':[('state','=','done')]}" widget="progressbar"/>
+ <field name="descript" width="600" readonly="1"/>
+
+ <button string="Enndad" type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'wuser':wuser, 'wtime':wtime, 'work_date':work_date, 'descript':descript, 'operation':operation,'date_start':date_start,'date_end':date_end,}"/>
+ </tree>
+ </field>
+ <newline/>
+ <field name="wc_times" nolabel="1" widget="one2many_list" colspan="4" context="{'group_by' : 'operation'}" >
+ <tree string="Machine">
+ <field name="wc" width="100" readonly="1"/>
+ <field name="operation" width="100" readonly="1"/>
+ <field name="time" width="80" widget="float_time" readonly="0" />
+ <field name="date" width="150" readonly="1"/>
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <field name="state" />
+<!-- <field name="achievements" attrs="{'readonly':[('state','=','done')]}" widget="progressbar"/>-->
+ <field name="descript" width="600" readonly="1"/>
+ <button string="End" type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'wuser':wuser, 'wtime':wtime, 'work_date':work_date, 'descript':descript, 'operation':operation,'date_start':date_start,'date_end':date_end,}"/>
+ </tree>
+ </field>
+ <group colspan="4">
+ <label string="" colspan="2"/>
+ <button name="%(act_users_add_new)d" string="Allocate new operator time" type="action" icon="terp-gtk-jump-to-ltr" />
+ <button name="%(act_wc_add_new)d" string="Allocate new machine time" type="action" icon="terp-gtk-jump-to-ltr" />
+ </group>
+ <group colspan="4">
+ <field name="tot_ops" widget="float_time" colspan="1"/>
+ <field name="tot_mac" widget="float_time" colspan="1"/>
+ <field name="tot" widget="float_time" colspan="1"/>
+ <button name="%(act_show_cost)d" string="Show costs" type="action" icon="terp-dolar" />
+ </group>
+ </page>
+ </xpath>
+ </data>
+ </field>
+ </record>
+<!-- ESTA ES LA DE EL DASHBOARD -->
+ <record id="mrp_production_operation_real_inherit_form_view" model="ir.ui.view">
+ <field name="name">mrp.production.operation.real.inherit.form.view</field>
+ <field name="model">mrp.production.operation.real</field>
+ <field name="inherit_id" ref="mrp_operations_ext.mrp_production_operation_real_form_view" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/notebook/page[@string='Notes']"
+ position="before">
+ <page string="Allocation of hours">
+ <field name="operators_all_hours" nolabel="1" widget="one2many_list" colspan="4" context="{'group_by' : 'user'}" >
+ <tree string="Worker">
+ <field name="user" width="100" readonly="1"/>
+ <field name="time" width="50" widget="float_time" readonly="0" />
+ <field name="date" width="150" readonly="1"/>
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <field name="state" invisible="1"/>
+ <field name="std_descr" attrs="{'readonly':[('state','=','done')]}"/>
+ <field name="achievements" attrs="{'readonly':[('state','=','done')]}" widget="progressbar"/>
+ <field name="descript" width="600" readonly="1"/>
+ <button string="End" type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'wuser':wuser, 'wtime':wtime, 'work_date':work_date, 'descript':descript, 'operation':operation,'date_start':date_start,'date_end':date_end,}"/>
+ </tree>
+ </field>
+ <newline/>
+ <separator string="New Allocations"/>
+ <newline/>
+ <field name="mrp_manu_op" invisible="1"/>
+ <button name="%(mrp_manufacturing_cost.act_users_cost)d" string="Add Operator hours" type="action" icon="gtk-select-all" context="{'aux_op_id':mrp_manu_op}"/>
+ <button name="%(mrp_manufacturing_cost.act_wc_cost)d" string="Add Machine hours" type="action" icon="terp-accessories-archiver" context="{'aux_op_id':mrp_manu_op}"/>
+ <separator string=""/>
+ <newline/>
+ <field name="wc_all_hours" nolabel="1" widget="one2many_list" colspan="4" context="{'group_by' : 'date'}" >
+ <tree string="Machine">
+ <field name="wc" width="100" readonly="1"/>
+ <field name="time" width="50" widget="float_time" readonly="0" />
+ <field name="date" width="100" readonly="1"/>
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <field name="achievements" attrs="{'readonly':[('state','=','done')]}" widget="progressbar"/>
+ <field name="descript" width="600" readonly="1"/>
+ <field name="state" invisible="1"/>
+ <button string="End" type="object" name="action_done"
+ icon="gtk-convert" states="working"
+ context="{'wuser':wuser, 'wtime':wtime, 'work_date':work_date, 'descript':descript, 'operation':operation,'date_start':date_start,'date_end':date_end,}"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ </data>
+ </field>
+ </record>
+ <menuitem id="ops_menu"
+ name="Operation Times"
+ parent="mrp.menu_mrp_manufacturing"
+ action="ops_cost_list_action"/>
+
+ </data>
+</openerp>
=== added directory 'mrp_manufacturing_cost/i18n'
=== added file 'mrp_manufacturing_cost/i18n/es.mo'
Binary files mrp_manufacturing_cost/i18n/es.mo 1970-01-01 00:00:00 +0000 and mrp_manufacturing_cost/i18n/es.mo 2012-04-26 18:16:21 +0000 differ
=== added file 'mrp_manufacturing_cost/i18n/es.po'
--- mrp_manufacturing_cost/i18n/es.po 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/i18n/es.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,531 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_manufacturing_cost
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.1\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-06-07 11:32+0000\n"
+"PO-Revision-Date: 2011-06-07 13:52+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: mrp_manufacturing_cost
+#: field:new.input.time,production:0
+#: field:new.input.time.wc,production:0
+msgid "unknown"
+msgstr "Desconocido"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.ops.cost,wuser:0
+msgid "Operator_relation"
+msgstr "Relación de operaciones"
+
+#. module: mrp_manufacturing_cost
+#: field:users.ops.cost,workpercent:0
+msgid "Current %"
+msgstr "% Actual"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production,wc_cost:0
+#: field:mrp.production,wc_times:0
+msgid "Work centers"
+msgstr "Centros de trabajo"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:81
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:184
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:230
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:277
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:332
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:64
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:140
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:182
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:211
+#, python-format
+msgid "Unable to perform action"
+msgstr "Imposible realizar la acción"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_mrp_production
+msgid "Manufacturing Order"
+msgstr "Orden de producción"
+
+#. module: mrp_manufacturing_cost
+#: view:final.cost:0
+#: field:final.cost,dif:0
+msgid "Balance of final costs"
+msgstr "Balance de costes finales"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production:0
+#: view:mrp.production.operation.real:0
+msgid "Machine"
+msgstr "Maquina"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_users_costing
+msgid "Operation Operators"
+msgstr "Operadores de la operación"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.act_users_cost
+msgid "act.usr.cost "
+msgstr "act.usr.cost "
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.ops.cost,production:0
+#: field:mrp.wc.cost,production:0
+#: field:production.opert.users,production:0
+msgid "Production"
+msgstr "Producción"
+
+#. module: mrp_manufacturing_cost
+#: field:production.opert.users,ops_times:0
+msgid "Production Operations"
+msgstr "Operaciones de producción"
+
+#. module: mrp_manufacturing_cost
+#: field:wc.costing,wc_name:0
+msgid "Work Center"
+msgstr "Centro de trabajo"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.act_users_add_new
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.act_wc_add_new
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.action_new_time_input
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.action_new_time_input_wc
+msgid "action.new.time.input "
+msgstr "action.new.time.input "
+
+#. module: mrp_manufacturing_cost
+#: view:input.time:0
+#: view:input.time.wc:0
+#: view:new.input.time:0
+#: view:new.input.time.wc:0
+msgid "Input"
+msgstr "Entrada"
+
+#. module: mrp_manufacturing_cost
+#: field:wc.costing,time:0
+msgid "Total time"
+msgstr "Tiempo total"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:122
+#, python-format
+msgid "no hay produccion"
+msgstr "No hay produccion"
+
+#. module: mrp_manufacturing_cost
+#: field:input.time,wtime:0
+#: field:input.time.wc,wtime:0
+#: field:new.input.time,wtime:0
+#: field:new.input.time.wc,wtime:0
+msgid "time"
+msgstr "Tiempo"
+
+#. module: mrp_manufacturing_cost
+#: field:final.cost,mac_cost:0
+#: field:mrp.production,mac_cost:0
+msgid "Machines cost"
+msgstr "Costes de maquina"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production,ops_times:0
+msgid "Users times"
+msgstr "Tiempos de usuarios"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production,tot_ops:0
+msgid "Total Operators"
+msgstr "Total de operadores"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.module.module,description:mrp_manufacturing_cost.module_meta_information
+msgid "This module adds new features to the actual OpenERP manufacturing"
+msgstr "Este módulo añade nuevas características a la actual fabricación de OpenERP"
+
+#. module: mrp_manufacturing_cost
+#: field:input.time,descript:0
+#: field:input.time.wc,descript:0
+#: field:mrp.wc.cost,descript:0
+#: field:new.input.time,descript:0
+#: field:new.input.time.wc,descript:0
+msgid "Description"
+msgstr "Descripción"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production.operation,tot_ops:0
+msgid "Total hr operators"
+msgstr "Total de horas de operadores"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:184
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:277
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:332
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:140
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:211
+#, python-format
+msgid "Operation must be started to allocate hours"
+msgstr "La orden debe estar inicializada para imputar horas"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production.operation,tot_mac:0
+msgid "Total hr machines"
+msgstr "Total de horas de maquina"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production.operation.real,operators_all_hours:0
+#: field:users.costing,ops:0
+msgid "Operators"
+msgstr "Operadores"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production:0
+#: view:mrp.production.operation.real:0
+msgid "Allocation of hours"
+msgstr "Imputación de horas"
+
+#. module: mrp_manufacturing_cost
+#: field:final.cost,ec_mac:0
+msgid "Machines estimated cost"
+msgstr "Coste estimado de maquinas"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/final_cost.py:68
+#, python-format
+msgid "You must assign a product to all employers"
+msgstr "Debes asignar un producto a todos los empleados"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production.operation:0
+msgid "Operators costs"
+msgstr "Costes de operadores"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production:0
+#: field:mrp.production,users_cost:0
+msgid "Users"
+msgstr "Usuarios"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production.operation,tot:0
+msgid "Total hr"
+msgstr "Horas totales"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_mrp_production_operation
+msgid "Production Operation"
+msgstr "Operación de producción"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production.operation.real:0
+msgid "Worker"
+msgstr "Trabajador"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_input_time
+#: model:ir.model,name:mrp_manufacturing_cost.model_input_time_wc
+#: model:ir.model,name:mrp_manufacturing_cost.model_new_input_time_wc
+#: view:users.costing:0
+#: view:wc.costing:0
+msgid "Input time"
+msgstr "Tiempo imputado"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:155
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:243
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:300
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:123
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:196
+#, python-format
+msgid "The time must be greater than 0"
+msgstr "El tiempo debe superior a 0"
+
+#. module: mrp_manufacturing_cost
+#: view:input.time:0
+#: view:input.time.wc:0
+#: view:new.input.time:0
+#: view:new.input.time.wc:0
+msgid "New input time"
+msgstr "Nueva imputación de tiempo"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.ops.cost,date:0
+#: field:mrp.wc.cost,date:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production.operation:0
+msgid "Machines costs"
+msgstr "Costes de maquinas"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:81
+#: code:addons/mrp_manufacturing_cost/wizard/users.py:230
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:64
+#: code:addons/mrp_manufacturing_cost/wizard/wc.py:182
+#, python-format
+msgid "You cannot impute hours before starting the production order."
+msgstr "No puedes imputar horas antes de iniciar la orden de producción."
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production:0
+msgid "Allocate new operator time"
+msgstr "Imputar nuevo tiempo de operador"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.ops.cost:0
+msgid "User"
+msgstr "Usuario"
+
+#. module: mrp_manufacturing_cost
+#: field:final.cost,ec_ops:0
+msgid "Operators estimated cost"
+msgstr "Costes estimados de operadores"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_mrp_production_operation_real
+msgid "mrp.production.operation.real"
+msgstr "mrp.production.operation.real"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production,tot_mac:0
+msgid "Total Machines"
+msgstr "Total de maquinas"
+
+#. module: mrp_manufacturing_cost
+#: view:final.cost:0
+msgid "Ok"
+msgstr "Ok"
+
+#. module: mrp_manufacturing_cost
+#: field:production.opert.users,name:0
+#: field:users.ops.cost,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: mrp_manufacturing_cost
+#: field:final.cost,ec_tot:0
+msgid "Total estimated cost"
+msgstr "Coste total estimado"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_final_cost
+msgid "Production costs"
+msgstr "Costes de producción"
+
+#. module: mrp_manufacturing_cost
+#: field:final.cost,ops_cost:0
+#: field:mrp.production,ops_cost:0
+msgid "Operators cost"
+msgstr "Costes de operadores"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/wizard/final_cost.py:75
+#, python-format
+msgid "You must assign a product to all work centers"
+msgstr "Debes asignar un producto a todos lo centros de trabajo"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production:0
+msgid "Allocate new machine time"
+msgstr "Imputar nuevo tiempo de maquina"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_mrp_ops_cost
+msgid "mrp.ops.cost"
+msgstr "mrp.ops.cost"
+
+#. module: mrp_manufacturing_cost
+#: code:addons/mrp_manufacturing_cost/cost.py:50
+#, python-format
+msgid "The operator can not be deleted, has hours charged."
+msgstr "No se puede borrar el operador, tiene horas imputadas."
+
+#. module: mrp_manufacturing_cost
+#: field:input.time,wuser:0
+#: field:mrp.ops.cost,user:0
+#: field:new.input.time,wuser:0
+#: field:production.opert.users,user:0
+#: field:users.ops.cost,user_id:0
+msgid "Operator"
+msgstr "Operador"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.ops.cost,descript:0
+msgid "Notes"
+msgstr "Notas"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.ops.cost,time:0
+#: field:mrp.wc.cost,time:0
+msgid "Time"
+msgstr "Tiempo"
+
+#. module: mrp_manufacturing_cost
+#: field:input.time,work_date:0
+#: field:input.time.wc,work_date:0
+#: field:new.input.time,work_date:0
+#: field:new.input.time.wc,work_date:0
+msgid "Work date"
+msgstr "Fecha de trabajo"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production.operation.real:0
+msgid "New Allocations"
+msgstr "Nuevas imputaciones"
+
+#. module: mrp_manufacturing_cost
+#: field:users.ops.cost,wizard_id:0
+msgid "Wizard"
+msgstr "Asistente"
+
+#. module: mrp_manufacturing_cost
+#: field:final.cost,tot_cost:0
+#: field:mrp.production,tot_cost:0
+msgid "Total cost"
+msgstr "Costes totales"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_new_input_time
+msgid "new_Input time"
+msgstr "Nueva imputación de tiempo"
+
+#. module: mrp_manufacturing_cost
+#: field:users.ops.cost,deleteable:0
+msgid "delete"
+msgstr "Borrar"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_mrp_production_users
+msgid "mrp.production.users"
+msgstr "mrp.production.users"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_production_opert_users
+msgid "production.opert.users"
+msgstr "production.opert.users"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.ops.cost,real_op:0
+#: field:mrp.wc.cost,real_op:0
+msgid "Real operation"
+msgstr "Operación real"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production:0
+msgid "Show costs"
+msgstr "Mostrar costes"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production.operation.real:0
+msgid "Add Operator hours"
+msgstr "Añadir horas de operador"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.act_wc_cost
+msgid "act.wc.cost "
+msgstr "act.wc.cost "
+
+#. module: mrp_manufacturing_cost
+#: field:users.ops.cost,product_user:0
+msgid "prodauxuser"
+msgstr "prodauxuser"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.ops.cost:0
+msgid "Group by..."
+msgstr "Agrupar por..."
+
+#. module: mrp_manufacturing_cost
+#: view:final.cost:0
+msgid "Cost"
+msgstr "Coste"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.module.module,shortdesc:mrp_manufacturing_cost.module_meta_information
+msgid "MRP Costs"
+msgstr "Costes de fabricación"
+
+#. module: mrp_manufacturing_cost
+#: field:input.time.wc,wc:0
+#: field:input.time.wc,wc_name:0
+#: field:mrp.wc.cost,wc:0
+#: field:new.input.time.wc,wc:0
+#: field:new.input.time.wc,wc_name:0
+#: field:wc.costing,wc_id:0
+msgid "Work center"
+msgstr "Centro de trabajo"
+
+#. module: mrp_manufacturing_cost
+#: view:mrp.production.operation.real:0
+msgid "Add Machine hours"
+msgstr "Añadir horas de maquina"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_mrp_wc_cost
+msgid "mrp.wc.cost"
+msgstr "mrp.wc.cost"
+
+#. module: mrp_manufacturing_cost
+#: view:input.time:0
+#: view:input.time.wc:0
+#: view:new.input.time:0
+#: view:new.input.time.wc:0
+#: view:users.costing:0
+#: view:wc.costing:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: mrp_manufacturing_cost
+#: constraint:mrp.production:0
+msgid "Order quantity cannot be negative or zero !"
+msgstr "¡Cantidad ordenada no puede ser negativa o cero!"
+
+#. module: mrp_manufacturing_cost
+#: field:input.time,operation:0
+#: view:mrp.ops.cost:0
+#: field:mrp.ops.cost,operation:0
+#: field:mrp.wc.cost,operation:0
+#: field:new.input.time,operation:0
+#: field:new.input.time.wc,operation:0
+#: field:production.opert.users,op:0
+#: field:users.costing,operation:0
+#: field:wc.costing,operation:0
+#: field:wc.costing,operation_name:0
+msgid "Operation"
+msgstr "Operación"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production,tot:0
+msgid "Total"
+msgstr "Total"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_users_ops_cost
+msgid "Operators work"
+msgstr "Trabajo de operadores"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.model,name:mrp_manufacturing_cost.model_wc_costing
+msgid "Operation Workcenter"
+msgstr "Centro de producción de la operación"
+
+#. module: mrp_manufacturing_cost
+#: field:mrp.production.operation.real,wc_all_hours:0
+msgid "Machines"
+msgstr "Maquinas"
+
+#. module: mrp_manufacturing_cost
+#: model:ir.actions.act_window,name:mrp_manufacturing_cost.act_show_cost
+msgid "action.show.cost "
+msgstr "action.show.cost "
+
=== added directory 'mrp_manufacturing_cost/wizard'
=== added file 'mrp_manufacturing_cost/wizard/__init__.py'
--- mrp_manufacturing_cost/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import users
+import wc
+import final_cost
\ No newline at end of file
=== added file 'mrp_manufacturing_cost/wizard/final_cost.py'
--- mrp_manufacturing_cost/wizard/final_cost.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/final_cost.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,109 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+
+
+
+class final_cost(osv.osv_memory):
+
+
+ _name = "final.cost"
+ _description = "Production costs"
+
+ _columns = {
+ 'tot_cost':fields.float('Total cost'),
+ 'ops_cost':fields.float('Operators cost'),
+ 'mac_cost':fields.float('Machines cost'),
+ 'ec_ops':fields.float('Operators estimated cost'),
+ 'ec_mac':fields.float('Machines estimated cost'),
+ 'ec_tot':fields.float('Total estimated cost'),
+ 'dif':fields.float('Balance of final costs'),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ res = super(final_cost, self).default_get(cr, uid, fields, context=context)
+ aux = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'][0])
+
+ #Calculo costes reales
+
+ ops_times = aux.ops_times
+ wc_times = aux.wc_times
+
+ ops_tot = 0
+ wc_tot = 0
+ tot = 0
+
+ for t_ops in ops_times:
+ usr_obj = self.pool.get('hr.employee')
+ usr_search = usr_obj.search(cr, uid,[('user_id', '=', t_ops.user.id)])
+ usr = usr_obj.browse(cr , uid, usr_search[0])
+ if not usr.product_id:
+ raise osv.except_osv(_('You must assign a product to all employers'), _(usr.name))
+ aux_product = self.pool.get('product.product').browse(cr , uid, usr.product_id.id)
+ ops_tot = ops_tot + (t_ops.time*aux_product.standard_price)
+
+ for t_wc in wc_times:
+ aux_wc = self.pool.get('mrp.workcenter').browse(cr , uid, t_wc.wc.id)
+ if not aux_wc.product_id:
+ raise osv.except_osv(_('You must assign a product to all work centers'), _(aux_wc.name))
+ wc_tot = wc_tot + (t_wc.time * aux_wc.costs_hour)
+
+ tot = ops_tot + wc_tot
+
+ #Calculo costes estimados
+
+ prod_opert = aux.production_operation_ids
+ op_users = aux.user_ops
+
+ wc_ec = 0
+ ops_ec = 0
+ tot_ec = 0
+
+ for ops in prod_opert:
+ aux_wc = self.pool.get('mrp.workcenter').browse(cr , uid, ops.workcenter_id.id)
+ wc_ec = wc_ec + (aux_wc.costs_hour * ops.hour)
+
+ for op_usr in op_users:
+ usr_obj = self.pool.get('hr.employee')
+ usr_search = usr_obj.search(cr, uid,[('user_id', '=', op_usr.name.id)])
+ usr = usr_obj.browse(cr , uid, usr_search[0])
+ aux_product = self.pool.get('product.product').browse(cr , uid, usr.product_id.id)
+ ops_ec = ops_ec + (((op_usr.percent * op_usr.op.hour)/100)*aux_product.standard_price)
+
+ tot_ec = wc_ec + ops_ec
+
+ ####
+
+ dif = tot - tot_ec
+
+ res.update({'tot_cost': tot, 'ops_cost':ops_tot, 'mac_cost':wc_tot, 'ec_mac':wc_ec, 'ec_ops':ops_ec, 'ec_tot':tot_ec, 'dif':dif}),
+ return res
+
+final_cost()
=== added file 'mrp_manufacturing_cost/wizard/final_cost_view.xml'
--- mrp_manufacturing_cost/wizard/final_cost_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/final_cost_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="final_cost_form" model="ir.ui.view">
+ <field name="name">final.cost.form</field>
+ <field name="model">final.cost</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Cost">
+ <field name="ops_cost" readonly="1"/>
+ <field name="ec_ops" readonly="1"/>
+ <newline/>
+ <field name="mac_cost" readonly="1"/>
+ <field name="ec_mac" readonly="1"/>
+ <newline/>
+ <field name="tot_cost" readonly="1" />
+ <field name="ec_tot" readonly="1"/>
+ <newline />
+ <label string="Balance of final costs" colspan="4"/>
+ <newline/>
+ <field name="dif" readonly="1" nolabel="1" colspan="2"/>
+ <newline/>
+ <button icon='terp-camera_test' special="cancel" string="Ok" />
+ </form>
+ </field>
+ </record>
+
+ <record id="act_show_cost" model="ir.actions.act_window">
+ <field name="name">action.show.cost </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">final.cost</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'mrp_manufacturing_cost/wizard/users.py'
--- mrp_manufacturing_cost/wizard/users.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/users.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,406 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+
+
+
+class users_ops_cost(osv.osv_memory):
+
+
+ _name = "users.ops.cost"
+ _description = "Operators work"
+
+ _columns = {
+ 'user_id':fields.many2one('res.users','Operator'),
+ 'name':fields.char('Name', size = 256),
+ 'product_user':fields.many2one('production.opert.users','prodauxuser'),
+ 'workpercent':fields.float('Current %'),
+ 'deleteable':fields.boolean('delete'),
+ 'wizard_id':fields.many2one('users.costing','Wizard'),
+ }
+users_ops_cost()
+
+class users_costing(osv.osv_memory):
+ _name = "users.costing"
+ _description = "Operation Operators"
+ _columns = {
+
+ 'ops': fields.one2many('users.ops.cost','wizard_id','Operators'),
+ 'operation':fields.many2one('mrp.production.operation','Operation'),
+
+ }
+
+
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(users_costing, self).default_get(cr, uid, fields, context=context)
+
+ if 'aux_op_id' in context:
+ act_id = context['aux_op_id']
+ else:
+ act_id = context['active_ids'][0]
+
+
+ aux = self.pool.get('mrp.production.operation').browse(cr , uid, act_id)
+
+
+
+
+ op_id = aux.id
+ prod_id = aux.production_id.id
+
+ obj = self.pool.get('mrp.production').browse(cr , uid, prod_id)
+
+ if obj.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('You cannot impute hours before starting the production order.'))
+
+ result = []
+
+ prod_op_usr_ids = self.pool.get('production.opert.users').search(cr, uid,[('op', '=', op_id )])
+ prod_op_usr = self.pool.get('production.opert.users').browse(cr, uid,prod_op_usr_ids)
+ for prod in prod_op_usr:
+
+ #codigo para sacar el prod user
+
+ prod_us_id = prod.id
+ operation_time = aux.tot_ops
+ operator_time = 0
+
+ #codigo para sacar el % y si se puede borrar
+
+ costs_ids = self.pool.get('mrp.ops.cost').search(cr, uid,[('operation', '=', op_id ),('wuser', '=', prod_us_id )])
+ costs = prod_op_usr = self.pool.get('mrp.ops.cost').browse(cr, uid,costs_ids)
+ for oper in costs:
+ operator_time = operator_time + oper.time
+
+ pt = 0
+ delet = False
+ if operator_time == 0 :
+ delet= True
+ if operation_time == 0:
+ pt=0
+ else:
+ pt = ( (operator_time* 100 ) / operation_time)
+
+ values = {
+ 'user_id': prod.user.id,
+ 'name':prod.user.name,
+ 'product_user': prod_us_id,
+ 'workpercent': pt,
+ 'deleteable': delet,
+ }
+ result.append(values)
+
+
+# else:
+# raise osv.except_osv(_('no hay produccion'), _(obj))
+# res.update({'user': result , 'production':prod_id, 'operation':op_id})
+ res.update({'ops': result, 'operation':op_id})
+ return res
+
+
+
+
+
+users_costing()
+
+
+class input_time(osv.osv_memory):
+ _name = "input.time"
+ _description = "Input time"
+ _columns = {
+ 'operation':fields.many2one('mrp.production.operation','Operation'),
+ 'wuser':fields.many2one('res.users','Operator'),
+ 'wtime':fields.float('time'),
+ 'descript':fields.text('Description'),
+ 'work_date':fields.date('Work date'),
+ 'date_start': fields.datetime('Start time'),
+ 'date_end': fields.datetime('End time'),
+ 'state':fields.selection([('draft','Draft'),('working','Working'),('done','Done')],'Status',readonly=True,required=True),
+ 'std_description':fields.many2one('mrp.operation.description','Std Description'),
+ 'achievements': fields.integer('Achievements (%)'),
+ 'product':fields.many2one('product.product','Product'),
+ }
+ _defaults = {
+ 'work_date': datetime.now().strftime('%Y-%m-%d'),
+ 'date_start': datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'wtime':0.017,
+ 'state':'working',
+ }
+
+
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 0'), _(context['wtime']))
+
+ aux_prod = self.pool.get('mrp.production')
+ aux_prod_op = self.pool.get('mrp.production.operation')
+ op = aux_prod_op.browse(cr , uid, context['operation'])
+
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_us_obj = self.pool.get('mrp.ops.cost')
+
+ us_obj = self.pool.get('production.opert.users')
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ if len(us_search):
+ us = us_search[len(us_search)-1]
+ else:
+ values = {
+ 'user' :context['wuser'],
+ 'production_id':op.production_id.id,
+ 'op':op.id,
+ }
+ res = us_obj.create(cr, uid, values)
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ us = us_search[0]
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+ raise osv.except_osv(_('Unable to perform action'), _('damn!'))
+ print "dah"
+ values = {
+ 'wuser': us,
+ 'user':context['wuser'],
+ 'operation':op.id,
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start' : context['date_start'],
+ 'achievements' : context['achievements'],
+
+ }
+ res = ops_us_obj.create(cr, uid, values)
+ op_user = ops_us_obj.browse(cr,uid,[res],context)[0].user.id
+ p = ops_us_obj.search(cr,uid,[('state','=','working'),('user.id','=',op_user),])
+ for x in p:
+ if x != res:
+ total_spent_time=0
+ h=0
+ for h in ops_us_obj.browse(cr,uid,[x]):
+ ops_us_obj.write(cr,uid,[x],{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1:
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'time':total_spent_time,
+ }
+ ops_us_obj.write(cr,uid,[x],done_values)
+ return {'type': 'ir.actions.act_window_close'}
+input_time()
+
+
+class new_input_time(osv.osv_memory):
+ _name = "new.input.time"
+ _description = "new_Input time"
+
+ def get_description(self,cr,uid,ids,oid):
+ v={}
+ std_name = self.pool.get('mrp.operation.description').browse(cr,uid,[oid])[0].name
+ v['descript'] = std_name
+ return {'value':v}
+
+ def get_operation_id(self,cr,uid,ids,oid):
+ v={}
+ opid = self.pool.get('mrp.production.operation').browse(cr,uid,[oid])[0].operation_id.id
+ v['the_id'] = opid
+ return {'value':v}
+
+ _columns = {
+ 'operation':fields.many2one('mrp.production.operation','Operation'),
+ 'wuser':fields.many2one('res.users','Operator'),
+ 'wtime':fields.float('time'),
+ 'descript':fields.text('Description'),
+ 'work_date':fields.date('Work date'),
+ 'production':fields.many2one('mrp.production'),
+ 'date_start': fields.datetime('Start time'),
+ 'the_id': fields.integer('The OP ID'),
+ 'std_description':fields.many2one('mrp.operation.description','Std Description'),
+ 'achievements': fields.integer('Achievements (%)'),
+ }
+ _defaults = {
+ 'work_date': datetime.now().strftime('%Y-%m-%d'),
+ 'date_start': datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'wtime':0.017,
+ }
+
+
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(new_input_time, self).default_get(cr, uid, fields, context=context)
+
+ obj = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'][0])
+
+ if obj.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('You cannot impute hours before starting the production order.'))
+
+ res.update({'production':context['active_ids'][0]})
+ return res
+
+
+ def input_real_worktime(self, cr, uid, ids, in_wuser, in_wtime, in_op, in_date, in_desc, context=None):
+
+ print 'user '+str(in_wuser) +'\n time '+str(in_wtime) +'\n op '+str(in_op) +'\n date '+str(in_date) +'\n desc '+str(in_desc)
+ if context is None:
+ context = {}
+
+ if in_wtime<=0:
+ raise osv.except_osv(_('The time must be greater than 0'), _(in_wtime))
+
+ aux_prod = self.pool.get('mrp.production')
+ aux_prod_op = self.pool.get('mrp.production.operation')
+ op = aux_prod_op.browse(cr , uid, in_op)
+
+
+
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_us_obj = self.pool.get('mrp.ops.cost')
+
+ us_obj = self.pool.get('production.opert.users')
+ us_search = us_obj.search(cr, uid,[('user', '=', in_wuser ),('op','=',op.id)])
+ if len(us_search):
+ us = us_search[len(us_search)-1]
+ else:
+ values = {
+ 'user' :in_wuser,
+ 'production_id':op.production_id.id,
+ 'op':op.id,
+ }
+ res = us_obj.create(cr, uid, values)
+ us_search = us_obj.search(cr, uid,[('user', '=', in_wuser ),('op','=',op.id)])
+ us = us_search[0]
+
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ print str(real_id.id) + '\n '+str(op.id)
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+ print "ssts"
+ values = {
+ 'wuser': us,
+ 'user':in_wuser,
+ 'operation':op.id,
+ 'time': in_wtime,
+ 'date': in_date,
+ 'descript':in_desc,
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start':context['date_start'],
+ }
+ res = ops_us_obj.create(cr, uid, values)
+
+ return True
+
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 0'), _(context['wtime']))
+
+ aux_prod = self.pool.get('mrp.production')
+ aux_prod_op = self.pool.get('mrp.production.operation')
+ op = aux_prod_op.browse(cr , uid, context['operation'])
+
+
+
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_us_obj = self.pool.get('mrp.ops.cost')
+
+ us_obj = self.pool.get('production.opert.users')
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ if len(us_search):
+ us = us_search[len(us_search)-1]
+ else:
+ values = {
+ 'user' :context['wuser'],
+ 'production_id':op.production_id.id,
+ 'op':op.id,
+ }
+ res = us_obj.create(cr, uid, values)
+ us_search = us_obj.search(cr, uid,[('user', '=', context['wuser'] ),('op','=',op.id)])
+ us = us_search[0]
+
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+ if real_id.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+ print context['date_start']
+ values = {
+ 'wuser': us,
+ 'user':context['wuser'],
+ 'operation':op.id,
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start':context['date_start'],
+ }
+ print values
+
+ res = ops_us_obj.create(cr, uid, values)
+
+
+ return {'type': 'ir.actions.act_window_close'}
+new_input_time()
+
=== added file 'mrp_manufacturing_cost/wizard/users_view.xml'
--- mrp_manufacturing_cost/wizard/users_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/users_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+
+ <!-- New input wizard -->
+ <record id="new_time_input_form_add" model="ir.ui.view">
+ <field name="name">new.time.input.add.form</field>
+ <field name="model">new.input.time</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="New input time">
+ <field name="production" invisible="1"/>
+ <field name="operation" domain="[('production_id','=',production)]" on_change="get_operation_id(operation)"/>
+ <field name="wuser" />
+ <field name="wtime" widget="float_time"/>
+ <field name="work_date" invisible="1" />
+ <field name="date_start" />
+ <field name="the_id" invisible="1" />
+ <field name="std_description" domain="[('operation_id','=',the_id)]" attrs="{'readonly':[('operation','=',False)]}" required="True" on_change="get_description(std_description)"/>
+ <field name="achievements"/>
+ <newline/>
+ <field name="descript" colspan="4"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="input_worktime" string="Input2"
+ type="object" icon="terp-gtk-jump-to-ltr"
+ context="{'wuser':wuser, 'wtime':wtime, 'work_date':work_date, 'descript':descript, 'operation':operation,'date_start':date_start,'std_description':std_description,'achievements':achievements,}" />
+ </form>
+ </field>
+ </record>
+
+
+
+ <record id="act_users_add_new" model="ir.actions.act_window">
+ <field name="name">action.new.time.input </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">new.input.time</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+
+
+
+
+ <record id="new_time_input_form" model="ir.ui.view">
+ <field name="name">new.time.input.form</field>
+ <field name="model">input.time</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="New input time">
+ <field name="wuser" />
+ <field name="wtime" widget="float_time"/>
+ <field name="work_date" readonly="1" />
+ <field name="date_start" />
+ <field name="date_end" readonly="1"/>
+ <field name="state" />
+ <newline/>
+ <field name="std_description" on_change="get_description(std_description)"/>
+ <field name="achievements"/>
+ <field name="descript" />
+ <field name="product" />
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="input_worktime" string="Input1"
+ type="object" icon="terp-gtk-jump-to-ltr"
+ context="{'wuser':wuser, 'wtime':wtime, 'work_date':work_date, 'descript':descript,'date_start':date_start,'std_description':std_description,'achievements':achievements,'product':product}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="action_new_time_input" model="ir.actions.act_window">
+ <field name="name">action.new.time.input </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">input.time</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <!-- User cost wizard -->
+
+ <record id="users_cost" model="ir.ui.view">
+ <field name="name">users.cost</field>
+ <field name="model">users.costing</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field name="operation" readonly="1" />
+ <field colspan="4" name="ops" nolabel="1" readonly="1" widget="one2many_list">
+ <tree>
+ <field name="name" width="250"/>
+ <field name="workpercent" width="50"/>
+ </tree>
+ </field>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="%(action_new_time_input)d" string="Input time"
+ type="action" icon="terp-gnome-cpu-frequency-applet+" special="cancel"
+ context="{'operation':operation}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="act_users_cost" model="ir.actions.act_window">
+ <field name="name">act.usr.cost </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">users.costing</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'mrp_manufacturing_cost/wizard/wc.py'
--- mrp_manufacturing_cost/wizard/wc.py 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/wc.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,265 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import time
+from datetime import datetime
+
+from osv import osv, fields
+import tools
+from tools.translate import _
+
+
+
+
+
+class wc_costing(osv.osv_memory):
+ _name = "wc.costing"
+ _description = "Operation Workcenter"
+ _columns = {
+ 'wc_id':fields.many2one('mrp.workcenter','Work center'),
+ 'wc_name':fields.char('Work Center', size=256),
+ 'time':fields.float('Total time'),
+ 'operation':fields.many2one('mrp.production.operation','Operation'),
+ 'operation_name':fields.char('Operation', size = 256),
+ }
+
+
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(wc_costing, self).default_get(cr, uid, fields, context=context)
+
+ if 'aux_op_id' in context:
+ act_id = context['aux_op_id']
+ else:
+ act_id = context['active_ids'][0]
+ print 'l55 act_id = '+str(act_id)
+ aux = self.pool.get('mrp.production.operation').browse(cr , uid, act_id)
+ op_name= aux.name
+ print 'l58 aux_name = '+aux.name
+ op_id = aux.id
+ prod_id = aux.production_id.id
+ production_obj = self.pool.get('mrp.production').browse(cr , uid, prod_id)
+
+# if production_obj.state == 'draft':
+# raise osv.except_osv(_('Unable to perform action'), _('You cannot impute hours before starting the production order.'))
+#
+ wc = aux.workcenter_id.id
+ aux_wc = self.pool.get('mrp.workcenter').browse(cr , uid, wc)
+ wc_name = aux_wc.name
+
+ wc_time = 0
+
+ wc_cost_obj = self.pool.get('mrp.wc.cost')
+ print 'l74 op_id = '+str(op_id)
+ costs_ids = wc_cost_obj.search(cr, uid,[('operation', '=', op_id )])
+ costs = wc_cost_obj.browse(cr , uid, costs_ids)
+ for inputed_time in costs:
+ wc_time = wc_time + inputed_time.time
+
+ values = {
+ 'wc_id' : wc,
+ 'wc_name' : wc_name,
+ 'time' : wc_time,
+ 'operation' : op_id,
+ 'operation_name':op_name
+ }
+
+
+ res.update(values)
+ return res
+
+wc_costing()
+
+
+class input_time_wc(osv.osv_memory):
+ _name = "input.time.wc"
+ _description = "Input time"
+ _columns = {
+ 'wc':fields.many2one('mrp.workcenter','Work center'),
+ 'wtime':fields.float('time'),
+ 'descript':fields.text('Description'),
+ 'work_date':fields.date('Work date'),
+ 'wc_name':fields.char('Work center', size=256),
+ 'date_start': fields.datetime('Start time'),
+ 'date_end': fields.datetime('End time'),
+ 'state':fields.selection([('draft','Draft'),('working','Working'),('done','Done')],'Status',readonly=True,required=True),
+ }
+ _defaults = {
+ 'work_date': datetime.now().strftime('%Y-%m-%d'),
+ 'date_start': datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'wtime':0.017,
+ 'state':'working',
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ res = super(input_time_wc, self).default_get(cr, uid, fields, context=context)
+ values = {
+ 'wc': context['wc_id'],
+ 'wc_name' : context['wc_name'],
+ }
+ res.update(values)
+ return res
+
+ def input_worktime(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 01'), _(context['wtime']))
+
+ aux = self.pool.get('mrp.production.operation')
+ op = aux.browse(cr , uid, context['operation'])
+
+ aux_prod = self.pool.get('mrp.production')
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_wc_obj = self.pool.get('mrp.wc.cost')
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+
+
+# if real_id.state == 'draft':
+# raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+
+ values = {
+ 'wc': context['wc'],
+ 'operation':context['operation'],
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start': datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'state':'working',
+ }
+ print "hey arnold!"
+ res = ops_wc_obj.create(cr, uid, values)
+ op_wc = ops_wc_obj.browse(cr,uid,[res],context)[0].wc.id
+
+ p = ops_wc_obj.search(cr,uid,[('state','=','working'),('wc.id','=',op_wc),])
+ for x in p:
+ if x != res:
+ total_spent_time=0
+ h=0
+ for h in ops_wc_obj.browse(cr,uid,[x]):
+ ops_wc_obj.write(cr,uid,[x],{'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),})
+ end = time.strptime(h.date_end,"%Y-%m-%d %H:%M:%S")
+ start = time.strptime(h.date_start,"%Y-%m-%d %H:%M:%S")
+ sum_hours = 0
+ if (end.tm_hour - start.tm_hour) < 1:
+ sum_hours = float(float(end.tm_min) - float(start.tm_min))/60
+ else:
+ if (end.tm_min < start.tm_min):
+ sum_hours = ((float(end.tm_hour) - float(start.tm_hour)) + (float(end.tm_min+60) - float(start.tm_min))/60) - 1
+ else:
+ sum_hours = sum_hours + (end.tm_hour - start.tm_hour) + float((end.tm_min - start.tm_min)/60)
+ total_spent_time = total_spent_time + sum_hours
+ done_values = {
+ 'state':'done',
+ 'date_end':datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'time':total_spent_time,
+ }
+ ops_wc_obj.write(cr,uid,[x],done_values)
+
+
+ return {'type': 'ir.actions.act_window_close'}
+input_time_wc()
+
+
+class new_input_time_wc(osv.osv_memory):
+ _name = "new.input.time.wc"
+ _description = "Input time"
+ _columns = {
+ 'operation':fields.many2one('mrp.production.operation','Operation'),
+ 'wc':fields.many2one('mrp.workcenter','Work center'),
+ 'wtime':fields.float('time'),
+ 'descript':fields.text('Description'),
+ 'work_date':fields.date('Work date'),
+ 'wc_name':fields.char('Work center', size=256),
+ 'production':fields.many2one('mrp.production'),
+ 'date_start': fields.datetime('Start time'),
+ 'date_end': fields.datetime('End time'),
+ 'state':fields.selection([('draft','Draft'),('working','Working'),('done','Done')],'Status',readonly=True,required=True),
+ }
+ _defaults = {
+ 'work_date': datetime.now().strftime('%Y-%m-%d'),
+ 'date_start': datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
+ 'wtime':0.017,
+ 'state':'working',
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ res = super(new_input_time_wc, self).default_get(cr, uid, fields, context=context)
+
+ obj = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'][0])
+
+ if obj.state == 'draft':
+ raise osv.except_osv(_('Unable to perform action'), _('You cannot impute hours before starting the production order.'))
+
+ values = {
+ 'production':context['active_ids'][0],
+ }
+ res.update(values)
+ return res
+
+ def input_worktime(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+
+ if context['wtime']<=0:
+ raise osv.except_osv(_('The time must be greater than 01'), _(context['wtime']))
+ aux = self.pool.get('mrp.production.operation')
+ op = aux.browse(cr , uid, context['operation'])
+
+ aux_prod = self.pool.get('mrp.production')
+ prod = aux_prod.browse(cr , uid, op.production_id.id)
+
+ ops_wc_obj = self.pool.get('mrp.wc.cost')
+ wc = op.workcenter_id
+
+ real_op_obj = self.pool.get('mrp.production.operation.real')
+ real_op_search = real_op_obj.search(cr, uid,[('mrp_manu_op', '=', op.id )])
+ real_id = real_op_obj.browse(cr, uid, real_op_search[0])
+
+# if real_id.state == 'draft':
+# raise osv.except_osv(_('Unable to perform action'), _('Operation must be started to allocate hours'))
+
+ values = {
+ 'wc': wc.id,
+ 'operation':context['operation'],
+ 'time': context['wtime'],
+ 'date':context['work_date'],
+ 'descript':context['descript'],
+ 'production':prod.id,
+ 'real_op' : real_id.id,
+ 'date_start':context['date_start'],
+ }
+ res = ops_wc_obj.create(cr, uid, values)
+ print res
+
+ return {'type': 'ir.actions.act_window_close'}
+new_input_time_wc()
=== added file 'mrp_manufacturing_cost/wizard/wc_view.xml'
--- mrp_manufacturing_cost/wizard/wc_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_manufacturing_cost/wizard/wc_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- New input wizard -->
+
+ <record id="new_time_input_wc_add_form" model="ir.ui.view">
+ <field name="name">new.time.input.add.form</field>
+ <field name="model">new.input.time.wc</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="New input time">
+ <field name="production" invisible="1"/>
+ <field name="operation" domain="[('production_id','=',production)]"/>
+ <newline/>
+ <field name="wtime" widget="float_time"/>
+ <field name="work_date" readonly="1" />
+ <field name="date_start"/>
+ <field name="date_end" readonly="1"/>
+ <field name="state" />
+ <newline/>
+ <field name="descript" />
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="input_worktime" string="Input"
+ type="object" icon="terp-gtk-jump-to-ltr"
+ context="{'wtime':wtime, 'work_date':work_date, 'descript':descript, 'operation':operation,'date_start':date_start,}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="act_wc_add_new" model="ir.actions.act_window">
+ <field name="name">action.new.time.input </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">new.input.time.wc</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <!-- THIS IS THE WIZZARD FOR ADDING MACHINE HOURS IN DASHBOARD ON THE MO -->
+
+ <record id="new_time_input_wc_form" model="ir.ui.view">
+ <field name="name">new.time.input.form</field>
+ <field name="model">input.time.wc</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="New input time">
+ <field name="wc_name" readonly="1" />
+ <field name="wc" readonly="1" invisible="1"/>
+ <field name="wtime" widget="float_time"/>
+ <field name="work_date" readonly="1" />
+ <field name="date_start"/>
+ <field name="date_end" readonly="1"/>
+ <field name="state" />
+ <newline/>
+ <field name="descript" />
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="input_worktime" string="Inputar"
+ type="object" icon="terp-gtk-jump-to-ltr"
+ context="{'wc':wc, 'wtime':wtime, 'work_date':work_date, 'descript':descript,'date_start':date_start,'date_end':date_end,'state':state}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="action_new_time_input_wc" model="ir.actions.act_window">
+ <field name="name">action.new.time.input </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">input.time.wc</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <!-- Work center cost wizard -->
+
+ <record id="wc_cost" model="ir.ui.view">
+ <field name="name">wc.cost</field>
+ <field name="model">wc.costing</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field name="operation" readonly="1" invisible="1"/>
+ <field name="operation_name" colspan="4" readonly="1" nolabel="1" />
+ <newline/>
+ <field name="wc_id" readonly="1" invisible="1"/>
+ <field name="wc_name" readonly="1" />
+ <newline/>
+ <field name="time" readonly = "1" widget="float_time"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="%(action_new_time_input_wc)d" string="Input time"
+ type="action" icon="terp-accessories-archiver+" special="cancel"
+ context="{'operation':operation, 'wc_id':wc_id, 'wc_name':wc_name}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="act_wc_cost" model="ir.actions.act_window">
+ <field name="name">act.wc.cost </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">wc.costing</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'mrp_master_extension'
=== added file 'mrp_master_extension/__init__.py'
--- mrp_master_extension/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,31 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import mrp_factory
+import mrp_operation
+import res
+import mrp_workcenter
+import mrp_routing
+import mrp_bom
+import mrp_production
+import product
+import mrp_production
+import stock
+import wizard
\ No newline at end of file
=== added file 'mrp_master_extension/__openerp__.py'
--- mrp_master_extension/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/__openerp__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,50 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+{
+ "name" : "MRP Master Extension",
+ "version" : "0.1",
+ "description" : """This module adds new features to the actual OpenERP manufacturing""",
+ "author" : "Avanzosc & Ting! (Urtzi Odriozola and Francisco Pascual)",
+ "website" : "http://ting.es - http://www.avanzosc.com",
+ "depends" : [
+ 'stock',
+ 'mrp',
+ ],
+ "category" : "Custom Modules",
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : [
+ 'wizard/routing_assign_view.xml',
+ 'wizard/new_manufacturing_user_view.xml',
+ 'wizard/partial_production_view.xml',
+ 'wizard/prod_parcial_picking_view.xml',
+ 'mrp_factory_view.xml',
+ 'mrp_workcenter_view.xml',
+ 'mrp_operation_view.xml',
+ 'mrp_routing_view.xml',
+ 'mrp_bom_view.xml',
+ 'mrp_production_view.xml',
+ 'product/product_view.xml',
+ 'stock/stock_view_inh.xml',
+ ],
+ "active": False,
+ "installable": True
+}
=== added directory 'mrp_master_extension/i18n'
=== added file 'mrp_master_extension/i18n/es.mo'
Binary files mrp_master_extension/i18n/es.mo 1970-01-01 00:00:00 +0000 and mrp_master_extension/i18n/es.mo 2012-04-26 18:16:21 +0000 differ
=== added file 'mrp_master_extension/i18n/es.po'
--- mrp_master_extension/i18n/es.po 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/i18n/es.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,1403 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_master_extension
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.1\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-06-07 08:02+0000\n"
+"PO-Revision-Date: 2011-06-07 11:53+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,costs_cycle:0
+#: field:mrp.production.operation,costs_cycle:0
+msgid "Cost per cycle"
+msgstr "Coste por ciclo"
+
+#. module: mrp_master_extension
+#: constraint:mrp.bom:0
+msgid "Error ! You can not create recursive BoM."
+msgstr "¡Error! No puede crear Listas de Material recursivas."
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Force Reservation"
+msgstr "Forzar reservas"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:103
+#: code:addons/mrp_master_extension/stock/stock.py:103
+#, python-format
+msgid "Product "
+msgstr "Producto"
+
+#. module: mrp_master_extension
+#: field:mrp.workflow.wizard,real_ope:0
+msgid "Work Order code"
+msgstr "Codigo de orden de trabajo"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:103
+#: code:addons/mrp_master_extension/stock/stock.py:103
+#, python-format
+msgid "is consumed with"
+msgstr "Es consumido con"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,location_id:0
+#: field:mrp.production,product_def_loc:0
+#: field:mrp.production.final.product,location_id:0
+#: field:mrp.production.product.line,location_id:0
+#: field:product.product,default_location:0
+msgid "Default Location"
+msgstr "Localización por defecto"
+
+#. module: mrp_master_extension
+#: field:delete.ops,user_name:0
+msgid "Are you sure you want to decouple worker from operation :::> "
+msgstr "Estas seguro de desvincular al Operario de la operación :::> "
+
+#. module: mrp_master_extension
+#: help:mrp.bom.final.product,product_uom:0
+#: help:mrp.production.final.product,product_uom:0
+msgid "UoM (Unit of Measure) is the unit of measurement for the inventory control"
+msgstr "UdM (Unidad de Medida) es la unidad de medida para el control de inventario"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,name:0
+msgid "Nombre"
+msgstr "Nombre"
+
+#. module: mrp_master_extension
+#: field:product.product,mrp_bom_fp_id:0
+msgid "bom final products"
+msgstr "Productos finales de la lista de materiales"
+
+#. module: mrp_master_extension
+#: view:manufacturing.user:0
+#: view:manufacturing.user.op:0
+#: view:manufacturing.user.op.add:0
+msgid "Add user"
+msgstr "Añadir usuario"
+
+#. module: mrp_master_extension
+#: field:mrp.operation,workcenter:0
+msgid "Work centers"
+msgstr "Centros de trabajo"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Manufacturing operations"
+msgstr "Operaciones de fabricación"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:347
+#: code:addons/mrp_master_extension/mrp_production.py:464
+#, python-format
+msgid "External operation location must be set !"
+msgstr "La ubicación de operación externa debe ser definida !"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_operation
+#: view:mrp.production.operation:0
+#: field:stock.move,operation_id:0
+msgid "Production Operation"
+msgstr "Operación de fabricación"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.final.product:0
+msgid "Product to Produce"
+msgstr "Productos a producir"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Assign Routing"
+msgstr "Asignar proceso productivo"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,product_qty:0
+#: field:mrp.bom.operations.product,semi_prod_qty:0
+#: field:mrp.production.final.product,product_qty:0
+#: field:mrp.production.operation,semi_prod_qty:0
+msgid "Product Qty"
+msgstr "Cantidad de producto"
+
+#. module: mrp_master_extension
+#: view:assign.routing:0
+msgid "Assign"
+msgstr "Asignar"
+
+#. module: mrp_master_extension
+#: help:mrp.factory,location_id:0
+msgid "Specify the location of this plant"
+msgstr "Especifica la localización de esta fabrica"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,product_uom:0
+#: field:mrp.bom.operations.product,semi_prod_uom:0
+#: field:mrp.production.final.product,product_uom:0
+#: field:mrp.production.operation,semi_prod_uom:0
+msgid "Product UOM"
+msgstr "UdM del producto"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_prod_partial_picking
+msgid "Partial Picking"
+msgstr "Empaquetado parcial"
+
+#. module: mrp_master_extension
+#: field:parcial.picking.aux.product,product_qty:0
+#: field:parcial.picking.aux.production,product_qty:0
+msgid "Quantity"
+msgstr "Cantidad"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,op:0
+msgid "prod user"
+msgstr "Operario"
+
+#. module: mrp_master_extension
+#: field:delete.choice,ava:0
+msgid "Avatible ids"
+msgstr "Ids disponibles"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.operation_master_action
+#: model:ir.ui.menu,name:mrp_master_extension.operation_master_menu
+#: field:mrp.bom,mrp_bom_operations_product_ids:0
+#: view:mrp.bom.operations.product:0
+#: view:mrp.operation:0
+#: field:mrp.operation,operation_line_ids:0
+#: field:mrp.operation,operations_product:0
+#: field:mrp.routing,routing_line_ids:0
+#: view:mrp.workcenter:0
+#: field:mrp.workcenter,mrp_op_ids:0
+msgid "Operations"
+msgstr "Operaciones"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+msgid "Operation materials"
+msgstr "Materiales de operación"
+
+#. module: mrp_master_extension
+#: view:prod.partial.picking:0
+#: view:production.partial.picking:0
+msgid "Ok"
+msgstr "Ok"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_start:0
+#: field:mrp.production.operation,time_start:0
+msgid "Time before prod."
+msgstr "Tiempo antes de producción"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.factory:0
+#: view:mrp.operation:0
+#: view:mrp.production.operation:0
+#: view:mrp.workcenter:0
+msgid "Notes"
+msgstr "Notas"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_final_product
+msgid "Production Scheduled Final Product"
+msgstr "Productos finales de fabricación planeados"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user,percent:0
+msgid "Estimated %"
+msgstr "% Estimado"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Compute Data"
+msgstr "Calcular datos"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Alternative Work Centers"
+msgstr "Centros de trabajos alternativos"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:57
+#: code:addons/mrp_master_extension/stock/stock.py:57
+#, python-format
+msgid "Error!"
+msgstr "Error!"
+
+#. module: mrp_master_extension
+#: field:mrp.bom,mrp_bom_operations_product_id:0
+#: field:mrp.production.product.line,mrp_production_operation_id:0
+msgid "Consumed On"
+msgstr "Consumido en"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.production.workcenter.line,components:0
+#: view:prod.partial.picking:0
+#: view:production.partial.picking:0
+msgid "Components"
+msgstr "Componentes"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,hour:0
+#: field:mrp.production.operation,hour:0
+msgid "Nº Hour"
+msgstr "Nº Horas"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,warranty_date:0
+msgid "Warranty Date"
+msgstr "Fecha de garantia"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Final Products"
+msgstr "Productos finales"
+
+#. module: mrp_master_extension
+#: selection:mrp.bom.operations.product,type:0
+#: selection:mrp.production.operation,type:0
+msgid "Fixed"
+msgstr "Fijos"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,components_used_ids:0
+#: field:mrp.production.operation,components_used_ids:0
+msgid "Components used"
+msgstr "Componentes usados"
+
+#. module: mrp_master_extension
+#: view:product.product:0
+msgid "Default Localization"
+msgstr "Localización por defecto"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:347
+#: code:addons/mrp_master_extension/mrp_production.py:464
+#, python-format
+msgid "External Operation"
+msgstr "Operación externa"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Scheduled Operations"
+msgstr "Operaciones planificadas"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Reference"
+msgstr "Referencia"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_stock_move
+msgid "Stock Move"
+msgstr "Movimiento de stock"
+
+#. module: mrp_master_extension
+#: field:bom.fixed.cost,estimated:0
+#: field:mrp.fixed.cost,estimated:0
+#: field:routing.fixed.cost,estimated:0
+msgid "Estimated amount"
+msgstr "Cantidad estimada"
+
+#. module: mrp_master_extension
+#: field:mrp.production,user_ops:0
+msgid "Users asignments"
+msgstr "Asignación de usuarios"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,maintain_notes:0
+msgid "Maintain Notes"
+msgstr "Notas de mantenimiento"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,est_time:0
+#: field:manufacturing.user,est_time:0
+#: field:manufacturing.user.op.add,est_time:0
+msgid "Estimated time"
+msgstr "Tiempo estimado"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/wizard/work_wizard.py:40
+#, python-format
+msgid "No records found for your Id"
+msgstr "No se han encontrado registros para el identificador"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:52
+#: code:addons/mrp_master_extension/stock/stock.py:52
+#, python-format
+msgid "Warning!"
+msgstr "Alerta!"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Costing Information"
+msgstr "Información de costes"
+
+#. module: mrp_master_extension
+#: constraint:res.users:0
+msgid "The chosen company is not in the allowed companies for this user"
+msgstr "La compañía seleccionada no está en las compañías permitidas para este usuario"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op,operation:0
+#: field:mrp.bom.operations.product,operation_id:0
+#: field:mrp.production.operation,operation_id:0
+#: field:mrp.production.users,op:0
+#: field:mrp.production.workcenter.line,operation_id:0
+msgid "Operation"
+msgstr "Operación"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+#: field:mrp.factory,workcenter_ids:0
+msgid "Work Centers"
+msgstr "Centros de trabajo"
+
+#. module: mrp_master_extension
+#: view:mrp.production.operation:0
+msgid "Production Operation Lines"
+msgstr "Lineas de operaciones de fabricación"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Consume wizard"
+msgstr "Asistente de consumo"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_delete_choice
+msgid "Choice user to delete"
+msgstr "Seleccione operario a borrar"
+
+#. module: mrp_master_extension
+#: selection:mrp.operation,type:0
+msgid "Maintenance Operation"
+msgstr "Operación de mantenimiento"
+
+#. module: mrp_master_extension
+#: sql_constraint:res.users:0
+msgid "You can not have two users with the same login !"
+msgstr "¡No puede tener dos usuarios con el mismo identificador de usuario!"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_bom_operations_product
+msgid "materials used to produce"
+msgstr "Materiales usados para producir"
+
+#. module: mrp_master_extension
+#: selection:stock.picking,internal_type:0
+msgid "Production Output"
+msgstr "Salida de produción"
+
+#. module: mrp_master_extension
+#: field:mrp.production.users,est_time:0
+msgid "Time Estimated"
+msgstr "Tiempo estimado"
+
+#. module: mrp_master_extension
+#: field:mrp.factory,location_id:0
+#: field:mrp.workcenter,location_id:0
+#: field:parcial.picking.aux.product,location_id:0
+#: field:parcial.picking.aux.production,location_id:0
+msgid "Location"
+msgstr "Localización"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_stock_picking
+msgid "Picking List"
+msgstr "Albarán"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_workcenter_line
+#: field:mrp.production.operation,production_id:0
+msgid "Work Order"
+msgstr "Orden de trabajo"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Operation list"
+msgstr "Lista de operaciones"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:535
+#, python-format
+msgid "Semi-elaborated Product"
+msgstr "Producto semi-elaborado"
+
+#. module: mrp_master_extension
+#: field:stock.move,bom_prop:0
+msgid "BOM Proportion"
+msgstr "Proporción de la lista de materiales"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_new_production_user
+#: model:ir.actions.act_window,name:mrp_master_extension.action_new_production_user_op_add
+msgid "Production user"
+msgstr "Usuario de producción"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Possible Operators"
+msgstr "Posibles operadores"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_workflow_wizard
+msgid "Workflow"
+msgstr "Flujo de trabajo"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_product_line
+msgid "Production Scheduled Product"
+msgstr "Producto de fabricación planificado"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,location_id:0
+#: field:mrp.production.operation,location_id:0
+#: field:mrp.production.workcenter.line,location_id:0
+msgid "Operation Location"
+msgstr "Localización de operación"
+
+#. module: mrp_master_extension
+#: view:mrp.workflow.wizard:0
+msgid "Start/Pause"
+msgstr "Empezar / Pausar"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,percent:0
+#: field:manufacturing.user.op.add,percent:0
+#: field:mrp.production.users,percent:0
+msgid "% Estimated"
+msgstr "% Estimado"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:281
+#: code:addons/mrp_master_extension/mrp_production.py:391
+#, python-format
+msgid "Couldn't find bill of material for product"
+msgstr "No se encuentra lista de materiales para este producto"
+
+#. module: mrp_master_extension
+#: view:mrp.production.final.product:0
+msgid "Scheduled Final Products"
+msgstr "Productos finales planificados"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,final_products_ids:0
+#: field:mrp.production.operation,final_products_ids:0
+msgid "Final products"
+msgstr "Productos finales"
+
+#. module: mrp_master_extension
+#: view:mrp.production.workcenter.line:0
+msgid "Routing Operation"
+msgstr "Operaciones del proceso productivo"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:103
+#: code:addons/mrp_master_extension/stock/stock.py:103
+#, python-format
+msgid "quantity."
+msgstr "Cantidad."
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,costs_hour:0
+#: help:mrp.production.operation,costs_hour:0
+msgid "Specify Cost of Workcenter per hour when using this material."
+msgstr "Especifica el coste/hora del centro de trabajo cuando esta usando este material"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/wizard/new_manufacturing_user.py:133
+#: code:addons/mrp_master_extension/wizard/new_manufacturing_user.py:132
+#, python-format
+msgid "You must select Operator"
+msgstr "Debes seleccionar un trabajador"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,cycle:0
+#: field:mrp.production.operation,cycle:0
+msgid "Nº Cycles"
+msgstr "Nº de ciclos"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_stop:0
+#: field:mrp.production.operation,time_stop:0
+msgid "Time after prod."
+msgstr "Tiempo de post-producción"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+msgid "Search for mrp factories"
+msgstr "Busqueda de factorias de fabricación"
+
+#. module: mrp_master_extension
+#: view:assign.routing:0
+#: view:delete.choice:0
+#: view:delete.ops:0
+#: view:manufacturing.user:0
+#: view:manufacturing.user.op:0
+#: view:manufacturing.user.op.add:0
+#: view:mrp.production:0
+#: view:mrp.workflow.wizard:0
+#: view:prod.partial.picking:0
+#: view:production.partial.picking:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: mrp_master_extension
+#: field:bom.fixed.cost,bom_id:0
+#: field:mrp.fixed.cost,production_id:0
+msgid "Bom"
+msgstr "LdM"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_new_production_user_op
+msgid "Production operations user "
+msgstr "Operario de producción"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Produce wizard"
+msgstr "Asistente de producción"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Capacity Information"
+msgstr "Información de capacidad"
+
+#. module: mrp_master_extension
+#: field:mrp.production.workcenter.line,routing_id:0
+msgid "Parent Routing"
+msgstr "Proceso productivo padre"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.act_make_work_wizard
+msgid "Work wizard"
+msgstr "Asistente de trabajo"
+
+#. module: mrp_master_extension
+#: view:delete.choice:0
+#: model:ir.model,name:mrp_master_extension.model_delete_ops
+#: view:manufacturing.user.op:0
+msgid "Delete"
+msgstr "Borrar"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,mrp_bom_operations_product_id:0
+#: field:mrp.production.final.product,mrp_production_operation_id:0
+msgid "Produced On"
+msgstr "Produccir en"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_operation
+msgid "MRP Operation"
+msgstr "Operación de fabricación"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/wizard/work_wizard.py:40
+#, python-format
+msgid "No Data Available"
+msgstr "No hay datos disponibles"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_parcial_picking_aux_production
+msgid "parcial.picking.aux.production"
+msgstr "parcial.picking.aux.production "
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+#: view:mrp.production.operation:0
+msgid "Add Operator"
+msgstr "Añadir operario"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/wizard/new_manufacturing_user.py:133
+#: code:addons/mrp_master_extension/wizard/new_manufacturing_user.py:132
+#, python-format
+msgid "Unable to perform action"
+msgstr "Imposible realizar esta acción"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+msgid "Product to Consume"
+msgstr "Productos a consumir"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_bom.py:148
+#: code:addons/mrp_master_extension/mrp_production.py:151
+#, python-format
+msgid "This is not a valid product. Please, select a product with 'production' location type."
+msgstr "Este no es un producto valido. Por favor seleccione un producto con localización de tipo producción"
+
+#. module: mrp_master_extension
+#: field:mrp.production.operation,product_id:0
+msgid "Semi-Finished Product"
+msgstr "Producto semi-elaborado"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,sequence:0
+#: field:mrp.production.operation,sequence:0
+msgid "Sequence"
+msgstr "Orden"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Operator List"
+msgstr "Lista de operarios"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_production_partial_picking
+msgid "Partial Production"
+msgstr "Producción parcial"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op.add,op:0
+#: field:mrp.workcenter,user_ids:0
+#: field:res.users,workcenter_ids:0
+msgid "unknown"
+msgstr "Desconocido"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_bom_fixed_cost
+msgid "Bom fixed costs"
+msgstr "Costes fijos de la LdM"
+
+#. module: mrp_master_extension
+#: view:delete.ops:0
+msgid "Yes"
+msgstr "Sí"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Revisions"
+msgstr "Revisiones"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,alter_workcenter_ids:0
+msgid "Alternative Work center"
+msgstr "Centro de trabajo alternativo"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,wizard_id:0
+#: field:parcial.picking.aux.product,wizard_id:0
+#: field:parcial.picking.aux.production,wizard_id:0
+msgid "wizard"
+msgstr "Asistente"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Calculate"
+msgstr "Calcular"
+
+#. module: mrp_master_extension
+#: view:mrp.operation:0
+msgid "Associated Machines"
+msgstr "Maquinas asociadas"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production
+msgid "Manufacturing Order"
+msgstr "Órden de producción"
+
+#. module: mrp_master_extension
+#: help:mrp.operation,descript:0
+msgid "Description of the operation"
+msgstr "Descripcción del a operación"
+
+#. module: mrp_master_extension
+#: view:mrp.routing:0
+msgid "Operation Sequence"
+msgstr "Secuencia de operaciones"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op,user:0
+msgid "Users added"
+msgstr "Usuario añadido"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_partial_production_picking
+msgid "Production Picking"
+msgstr "Selección de producción"
+
+#. module: mrp_master_extension
+#: view:aux.res.users:0
+msgid "Estimated time(hs)"
+msgstr "Tiempo estimado (hs)"
+
+#. module: mrp_master_extension
+#: field:mrp.production,production_operation_ids:0
+msgid "Production Operations"
+msgstr "Operaciones de producción"
+
+#. module: mrp_master_extension
+#: selection:mrp.operation,type:0
+msgid "Manufacturing Operation"
+msgstr "Operaciones de fabricación"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:343
+#: code:addons/mrp_master_extension/mrp_production.py:460
+#, python-format
+msgid "All components must have a default location !"
+msgstr "Todos los componentes deben tener una ubicación por defecto !"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Destination Loc."
+msgstr "Ubicación de destino"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_delete_user
+#: model:ir.actions.act_window,name:mrp_master_extension.action_delete_user_ops
+msgid "action.new.time.input "
+msgstr "action.new.time.input"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.final.product:0
+#: view:mrp.bom.operations.product:0
+msgid "Aditional Product to Produce"
+msgstr "Producto adicional a producir"
+
+#. module: mrp_master_extension
+#: view:aux.res.users:0
+msgid "Operators assignment"
+msgstr "Asignación de operarios"
+
+#. module: mrp_master_extension
+#: model:ir.module.module,description:mrp_master_extension.module_meta_information
+msgid "This module adds new features to the actual OpenERP manufacturing"
+msgstr "Este modulo añade funcionalidades al modulo actual de OpenERP"
+
+#. module: mrp_master_extension
+#: view:mrp.production.workcenter.line:0
+msgid "Routing Operations"
+msgstr "Operaciones del proceso productivo"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_assign_routing
+msgid "Assign routing"
+msgstr "Asignar proceso productivo"
+
+#. module: mrp_master_extension
+#: field:parcial.picking.aux.product,stock_move_id:0
+#: field:parcial.picking.aux.production,stock_move_id:0
+msgid "Stock move"
+msgstr "Movimiento de stock"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Maintain Information"
+msgstr "Información de mantenimiento"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Operators"
+msgstr "Operadores"
+
+#. module: mrp_master_extension
+#: field:bom.fixed.cost,amount:0
+#: field:mrp.fixed.cost,amount:0
+#: field:routing.fixed.cost,amount:0
+msgid "Ammount"
+msgstr "Cantidad"
+
+#. module: mrp_master_extension
+#: field:delete.choice,op_us:0
+#: field:delete.ops,op_us:0
+msgid "User to delete"
+msgstr "Usuario a borrar"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user,user:0
+#: field:manufacturing.user.op.add,user:0
+msgid "User to add"
+msgstr "Usuario a añadir"
+
+#. module: mrp_master_extension
+#: field:mrp.fixed.cost,created:0
+msgid "created"
+msgstr "Creado"
+
+#. module: mrp_master_extension
+#: field:mrp.production.users,name:0
+msgid "User"
+msgstr "Usuario"
+
+#. module: mrp_master_extension
+#: field:mrp.factory,active:0
+#: field:mrp.operation,active:0
+msgid "Active"
+msgstr "Activo"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Properties"
+msgstr "Propiedades"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Maintaining"
+msgstr "Mantenimiento"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_fixed_cost
+msgid "MRP fixed costs"
+msgstr "Costes fijos de fabricación"
+
+#. module: mrp_master_extension
+#: sql_constraint:mrp.bom:0
+msgid ""
+"All product quantities must be greater than 0.\n"
+"You should install the mrp_subproduct module if you want to manage extra products on BoMs !"
+msgstr ""
+"Todas las cantidades de producto deben de ser superiores a cero.\n"
+"¡Debe instalar el módulo mrp_subproduct si quiere gestionar productos extra en las LdM!"
+
+#. module: mrp_master_extension
+#: help:mrp.workcenter,warranty_date:0
+msgid "Warranty limit date of the Work Center"
+msgstr "Fecha de garantia del centro de producción"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_partial_product_picking
+msgid "Process Picking"
+msgstr "Procesar albarán"
+
+#. module: mrp_master_extension
+#: constraint:stock.move:0
+msgid "You must assign a production lot for this product"
+msgstr "Debe asignar un lote de producción para este producto"
+
+#. module: mrp_master_extension
+#: selection:mrp.bom.operations.product,type:0
+#: selection:mrp.production.operation,type:0
+msgid "Variable"
+msgstr "Variable"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,user_id:0
+msgid "user id"
+msgstr "Id de usuario"
+
+#. module: mrp_master_extension
+#: help:mrp.operation,active:0
+msgid "If the active field is set to False, it will allow you to hide the resource record without removing it."
+msgstr "Si el campo activo esta desactivado, te va a permitir ocultar el registro del campo sin borrarlo"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:281
+#: code:addons/mrp_master_extension/mrp_production.py:391
+#, python-format
+msgid "Error"
+msgstr "Error"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,help:mrp_master_extension.mrp_factory_action
+msgid "Factories held many Work Centers which are located in the same plant."
+msgstr "Las fabricas tienen varios centros de trabajo localizados en la misma sección"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,bom_id:0
+msgid "Parent BOM"
+msgstr "LdM padre"
+
+#. module: mrp_master_extension
+#: help:mrp.production,product_def_loc:0
+#: help:product.product,default_location:0
+msgid "Default real location of the product"
+msgstr "Ubicación real por defecto del producto"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Produce all"
+msgstr "Producir todos"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:340
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:345
+#: code:addons/mrp_master_extension/mrp_production.py:457
+#: code:addons/mrp_master_extension/mrp_production.py:462
+#, python-format
+msgid "All final products must have a default location !"
+msgstr "Todos los productos finales deben tener una ubicación por defecto"
+
+#. module: mrp_master_extension
+#: view:manufacturing.user:0
+#: view:mrp.production:0
+msgid "Operator Assignment"
+msgstr "Asignación de operarios"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,type:0
+#: field:mrp.production.operation,type:0
+#: field:stock.picking,internal_type:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: mrp_master_extension
+#: field:mrp.operation,cod:0
+msgid "Code"
+msgstr "Codigo"
+
+#. module: mrp_master_extension
+#: view:mrp.operation:0
+msgid "Search for Operations"
+msgstr "Busqueda de operadores"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,time_start:0
+#: help:mrp.production.operation,time_start:0
+msgid "Time in hours for the setup for the material."
+msgstr "Tiempo en horas para la configuración de materiales"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Confirm Production"
+msgstr "Confirmar producción"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Alternatives"
+msgstr "Alternativas"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_factory
+msgid "Manufacturing Factory"
+msgstr "Factoria de fabricación"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+#: view:mrp.operation:0
+#: view:mrp.production.workcenter.line:0
+msgid "General Information"
+msgstr "Información general"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+#: view:mrp.operation:0
+msgid "Inactive"
+msgstr "Inactivo"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Consume all"
+msgstr "Consumir todo"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_res_users
+msgid "res.users"
+msgstr "res.usuarios"
+
+#. module: mrp_master_extension
+#: field:prod.partial.picking,move_lines:0
+#: field:production.partial.picking,production_lines:0
+msgid "Moves"
+msgstr "Movimientos"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,costs_hour:0
+#: field:mrp.production.operation,costs_hour:0
+msgid "Cost per hour"
+msgstr "Coste por hora"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,bom_id:0
+#: view:mrp.bom.operations.product:0
+#: field:mrp.production.final.product,production_id:0
+msgid "Final Product"
+msgstr "Producto final"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,purchase_date:0
+msgid "Purchase Date"
+msgstr "Fecha de compra"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_bom.py:262
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_bom.py:207
+#, python-format
+msgid "Save the record first !"
+msgstr "Gaurda el registro primero!"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_assign_routing
+#: model:ir.model,name:mrp_master_extension.model_manufacturing_user
+#: model:ir.model,name:mrp_master_extension.model_manufacturing_user_op
+#: model:ir.model,name:mrp_master_extension.model_manufacturing_user_op_add
+msgid "Manufacturing new user"
+msgstr "Nuevo operario de fabricación"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_routing_fixed_cost
+msgid "Routing fixed costs"
+msgstr "Costes fijos de proceso productivo"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_bom.py:147
+#: code:addons/mrp_master_extension/mrp_production.py:150
+#, python-format
+msgid "Wrong Product"
+msgstr "Producto erroneo"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Product Information"
+msgstr "Información de producto"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.mrp_factory_action
+#: model:ir.ui.menu,name:mrp_master_extension.menu_view_resource_search_mrp
+#: view:mrp.factory:0
+#: field:mrp.factory,name:0
+#: field:mrp.workcenter,factory_id:0
+msgid "Factory"
+msgstr "Factoria"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,maintain_op_id:0
+msgid "Maintain Operation"
+msgstr "Operación de mantenimiento"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:340
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:343
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:345
+#: code:addons/mrp_master_extension/mrp_production.py:457
+#: code:addons/mrp_master_extension/mrp_production.py:460
+#: code:addons/mrp_master_extension/mrp_production.py:462
+#, python-format
+msgid "Product Default Location"
+msgstr "Ubicación por defecto del rpoducto"
+
+#. module: mrp_master_extension
+#: model:ir.module.module,shortdesc:mrp_master_extension.module_meta_information
+msgid "MRP Master Extension"
+msgstr "MRP Master Extension"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_workcenter
+#: field:mrp.bom.operations.product,workcenter_id:0
+#: view:mrp.factory:0
+#: field:mrp.production.operation,workcenter_id:0
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.workcenter,operations_product_ids:0
+msgid "Work Center"
+msgstr "Centro de producción"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:754
+#, python-format
+msgid "There is no product assigned for the external workcenter !"
+msgstr "No existe producto asignado para el centro de trabajo externo !"
+
+#. module: mrp_master_extension
+#: field:mrp.bom,final_product_line_ids:0
+msgid "Final Product Lines"
+msgstr "Lineas finales de producción"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_aux_res_users
+msgid "Operation users"
+msgstr "Trabajadores de la operación"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/wizard/new_manufacturing_user.py:221
+#: code:addons/mrp_master_extension/wizard/new_manufacturing_user.py:216
+#, python-format
+msgid "no hay produccion"
+msgstr "no hay produccion"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,capacity_per_cycle:0
+#: field:mrp.production.operation,capacity_per_cycle:0
+msgid "Capacity per Cycle"
+msgstr "Capacidad por ciclo"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,time_cycle:0
+#: help:mrp.production.operation,time_cycle:0
+msgid "Time in hours for doing one cycle of the material."
+msgstr "Tiempo en horas para completar un ciclo del material."
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,semi_prod_qty_fact:0
+#: field:mrp.production.operation,semi_prod_qty_fact:0
+msgid "Quantity Factor"
+msgstr "Factor de cantidad"
+
+#. module: mrp_master_extension
+#: help:mrp.workcenter,purchase_date:0
+msgid "The machine's purchase date"
+msgstr "FEcha de compra de la maquina"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_product_product
+#: field:mrp.bom.final.product,product_id:0
+#: field:mrp.bom.operations.product,product_id:0
+#: field:mrp.production.final.product,product_id:0
+#: field:parcial.picking.aux.product,product_id:0
+#: field:parcial.picking.aux.production,product_id:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: mrp_master_extension
+#: field:bom.fixed.cost,name:0
+#: field:mrp.bom.operations.product,descript:0
+#: view:mrp.factory:0
+#: field:mrp.factory,description:0
+#: field:mrp.fixed.cost,name:0
+#: view:mrp.operation:0
+#: field:mrp.operation,descript:0
+#: view:mrp.production.operation:0
+#: field:mrp.production.operation,descript:0
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.production.workcenter.line,descript:0
+#: field:routing.fixed.cost,name:0
+msgid "Description"
+msgstr "Descripción"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+#: field:mrp.bom,fixed_costs:0
+#: view:mrp.production:0
+#: field:mrp.production,fixed_costs:0
+#: field:mrp.routing,fixed_costs:0
+msgid "Fixed costs"
+msgstr "Costes fijos"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:52
+#: code:addons/mrp_master_extension/stock/stock.py:52
+#, python-format
+msgid "Please provide Proper Quantity !"
+msgstr "Por favor inserta la cantidad correcta !"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_product_bom_structure
+msgid "Product BoM Structure"
+msgstr "Estructura LdM del producto"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+msgid "Operation Lines"
+msgstr "Lineas de operación"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Consume Products"
+msgstr "Consumir productos"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Produce"
+msgstr "Producir"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_production.py:582
+#: code:addons/mrp_master_extension/mrp_production.py:717
+#, python-format
+msgid "Manufacturing order '%s' is scheduled for the %s."
+msgstr "Orden de fabricación '%s' esta programada para %s."
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Estimated Information"
+msgstr "Información estimada"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op,production:0
+#: field:mrp.production.users,prod:0
+msgid "Production"
+msgstr "Producción"
+
+#. module: mrp_master_extension
+#: field:mrp.production,production_final_product_ids:0
+msgid "Production Final Products"
+msgstr "Producción de productos finales"
+
+#. module: mrp_master_extension
+#: view:manufacturing.user.op:0
+msgid "Operators assigned"
+msgstr "Operadores asignados"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.mrp_bom_tree_action
+#: model:ir.ui.menu,name:mrp_master_extension.menu_bom_tree
+msgid "Bill of Material Structure"
+msgstr "Estructura de la lista de materiales"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: field:mrp.bom.operations.product,name:0
+#: field:mrp.operation,name:0
+#: field:mrp.production.final.product,name:0
+#: field:mrp.production.operation,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: mrp_master_extension
+#: view:mrp.routing:0
+msgid "Fixed Costs"
+msgstr "Costes fijos"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_parcial_picking_aux_product
+msgid "parcial.picking.aux.product"
+msgstr "parcial.picking.aux.product"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:535
+#, python-format
+msgid "A semi-elaborated product is missing in the %s operation !"
+msgstr "Falta el semi-elaborado en la operación %s !"
+
+#. module: mrp_master_extension
+#: model:ir.ui.menu,name:mrp_master_extension.menu_mrp_routing_action_inherit
+msgid "Routings"
+msgstr "Procesos productivos"
+
+#. module: mrp_master_extension
+#: field:assign.routing,routing:0
+#: model:ir.model,name:mrp_master_extension.model_mrp_routing
+#: field:mrp.bom,routing_id_name:0
+#: field:routing.fixed.cost,routing_id:0
+msgid "Routing"
+msgstr "Proceso productivo"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,costs_cycle:0
+#: help:mrp.production.operation,costs_cycle:0
+msgid "Specify Cost of Workcenter per cycle when using this material."
+msgstr "Introduce el coste/hora del centro de trabajo cuando esta usndo este material"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_bom.py:262
+#: code:addons/mrp_master_extension/mrp_master_extensionv/mrp_bom.py:207
+#: code:addons/mrp_master_extension/mrp_production.py:754
+#, python-format
+msgid "User error"
+msgstr "Error de usuario"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_master_extensionv/stock/stock.py:57
+#: code:addons/mrp_master_extension/stock/stock.py:57
+#, python-format
+msgid "Can not produce a move with negative or zero quantity !"
+msgstr "No se puede producir con cantidad negativa o cero !"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,time_stop:0
+#: help:mrp.production.operation,time_stop:0
+msgid "Time in hours for the cleaning."
+msgstr "Tiempo en horas para la limpieza."
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Start Production"
+msgstr "Empezar producción"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_cycle:0
+#: field:mrp.production.operation,time_cycle:0
+msgid "Time for 1 cycle (hour)"
+msgstr "Tiempo para un ciclo (horas)"
+
+#. module: mrp_master_extension
+#: constraint:stock.move:0
+msgid "You try to assign a lot which is not from the same product"
+msgstr "Está intentando asignar un lote que no es del mismo producto"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_users
+msgid "mrp.production.users"
+msgstr "mrp.production.users"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Recreate Picking"
+msgstr "Volver a crear albarán"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_bom
+#: model:ir.model,name:mrp_master_extension.model_mrp_bom_final_product
+#: view:mrp.bom:0
+msgid "Bill of Material"
+msgstr "Lista de material"
+
+#. module: mrp_master_extension
+#: selection:stock.picking,internal_type:0
+msgid "Production Input"
+msgstr "Entrada de producción"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+#: view:mrp.production.operation:0
+#: view:mrp.production.product.line:0
+msgid "Scheduled Products"
+msgstr "Productos planificados"
+
+#. module: mrp_master_extension
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr "Error: Código EAN erróneo"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_efficiency:0
+#: field:mrp.production.operation,time_efficiency:0
+msgid "Efficiency factor"
+msgstr "Factor de eficiencia"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+#: field:mrp.production.workcenter.line,product_id:0
+msgid "Semi Product"
+msgstr "Semi Producto"
+
+#. module: mrp_master_extension
+#: view:mrp.production.final.product:0
+#: view:mrp.production.operation:0
+msgid "Products to Produce"
+msgstr "Productos a producir"
+
+#. module: mrp_master_extension
+#: constraint:mrp.production:0
+msgid "Order quantity cannot be negative or zero !"
+msgstr "¡Cantidad ordenada no puede ser negativa o cero!"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+#: view:mrp.production:0
+#: view:mrp.routing:0
+msgid "Total"
+msgstr "Total"
+
+#. module: mrp_master_extension
+#: view:manufacturing.user.op.add:0
+msgid "Assign Operator"
+msgstr "Asignar operador"
+
+#. module: mrp_master_extension
+#: field:mrp.operation,type:0
+msgid "Operation type"
+msgstr "Tipo de operación"
+
=== added file 'mrp_master_extension/i18n/es_EC.po'
--- mrp_master_extension/i18n/es_EC.po 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/i18n/es_EC.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,1091 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_master_extension
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0.1\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2011-04-07 16:49+0000\n"
+"PO-Revision-Date: 2011-06-09 21:27-0500\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,costs_cycle:0
+#: field:mrp.production.operation,costs_cycle:0
+msgid "Cost per cycle"
+msgstr "Costo por Ciclo"
+
+#. module: mrp_master_extension
+#: constraint:mrp.bom:0
+msgid "Error ! You can not create recursive BoM."
+msgstr "¡Error! No puede crear Listas de Material recursivas"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Force Reservation"
+msgstr "Forzar reservas"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:93
+#, python-format
+msgid "Product "
+msgstr "Producto"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,location_id:0
+#: field:mrp.production,product_def_loc:0
+#: field:mrp.production.final.product,location_id:0
+#: field:mrp.production.product.line,location_id:0
+#: field:product.product,default_location:0
+msgid "Default Location"
+msgstr "Ubicacion por Defecto"
+
+#. module: mrp_master_extension
+#: field:delete.ops,user_name:0
+msgid "Are you sure you want to decouple worker from operation :::> "
+msgstr "Esta seguro que quiere desvincular los trabajadores de la operacion?"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.final.product,product_uom:0
+#: help:mrp.production.final.product,product_uom:0
+msgid "UoM (Unit of Measure) is the unit of measurement for the inventory control"
+msgstr "UdM es la unidad de medida para el control de inventario"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,name:0
+msgid "Nombre"
+msgstr "Nombre"
+
+#. module: mrp_master_extension
+#: view:manufacturing.user:0
+#: view:manufacturing.user.op:0
+#: view:manufacturing.user.op.add:0
+msgid "Add user"
+msgstr "Agregar usuario"
+
+#. module: mrp_master_extension
+#: field:mrp.operation,workcenter:0
+msgid "Work centers"
+msgstr "Centros de Trabajo"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Manufacturing operations"
+msgstr "Operaciones de Fabricacion"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+#: field:mrp.factory,workcenter_ids:0
+msgid "Work Centers"
+msgstr "Centros de Trabajo"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_operation
+#: view:mrp.production.operation:0
+#: field:stock.move,operation_id:0
+msgid "Production Operation"
+msgstr "Produccion de Operacion"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.final.product:0
+msgid "Product to Produce"
+msgstr "Producto a Producir"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Assign Routing"
+msgstr "Asignar Ruta"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,product_qty:0
+#: field:mrp.bom.operations.product,semi_prod_qty:0
+#: field:mrp.production.final.product,product_qty:0
+#: field:mrp.production.operation,semi_prod_qty:0
+msgid "Product Qty"
+msgstr "Cant. Producto"
+
+#. module: mrp_master_extension
+#: view:assign.routing:0
+msgid "Assign"
+msgstr "Asignar"
+
+#. module: mrp_master_extension
+#: help:mrp.factory,location_id:0
+msgid "Specify the location of this plant"
+msgstr "Especificar la ubicacion de esta planta"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,product_uom:0
+#: field:mrp.bom.operations.product,semi_prod_uom:0
+#: field:mrp.production.final.product,product_uom:0
+#: field:mrp.production.operation,semi_prod_uom:0
+msgid "Product UOM"
+msgstr "UdM de Producto"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_prod_partial_picking
+msgid "Partial Picking"
+msgstr "Movimientos parciales"
+
+#. module: mrp_master_extension
+#: field:parcial.picking.aux.product,product_qty:0
+#: field:parcial.picking.aux.production,product_qty:0
+msgid "Quantity"
+msgstr "Cantidad"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,op:0
+msgid "prod user"
+msgstr "prod user"
+
+#. module: mrp_master_extension
+#: field:delete.choice,ava:0
+msgid "Avatible ids"
+msgstr "Avatible ids"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_bom.py:194
+#, python-format
+msgid "Save the record first !"
+msgstr "Guardar este registro primero !"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+msgid "Operation materials"
+msgstr "Materiales de Operacion"
+
+#. module: mrp_master_extension
+#: view:prod.partial.picking:0
+#: view:production.partial.picking:0
+msgid "Ok"
+msgstr "Ok"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_start:0
+#: field:mrp.production.operation,time_start:0
+msgid "Time before prod."
+msgstr "Tiempo antes de producir"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.factory:0
+#: view:mrp.operation:0
+#: view:mrp.production.operation:0
+#: view:mrp.workcenter:0
+msgid "Notes"
+msgstr "Notas"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_final_product
+msgid "Production Scheduled Final Product"
+msgstr "Produccion programada del Producto Final"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Compute Data"
+msgstr "Calcular datos"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Alternative Work Centers"
+msgstr "Centros de trabajo alternativos"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:47
+#, python-format
+msgid "Error!"
+msgstr "Error!"
+
+#. module: mrp_master_extension
+#: field:mrp.bom,mrp_bom_operations_product_id:0
+#: field:mrp.production.product.line,mrp_production_operation_id:0
+msgid "Consumed On"
+msgstr "Consumidos en"
+
+#. module: mrp_master_extension
+#: view:prod.partial.picking:0
+#: view:production.partial.picking:0
+msgid "Components"
+msgstr "Componentes"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,hour:0
+#: field:mrp.production.operation,hour:0
+msgid "Nº Hour"
+msgstr "Nº Horas"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,warranty_date:0
+msgid "Warranty Date"
+msgstr "Fecha de Garantia"
+
+#. module: mrp_master_extension
+#: view:mrp.bom:0
+msgid "Final Products"
+msgstr "Productos Finales"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,components_used_ids:0
+#: field:mrp.production.operation,components_used_ids:0
+msgid "Components used"
+msgstr "Componentes utilizados"
+
+#. module: mrp_master_extension
+#: view:product.product:0
+msgid "Default Localization"
+msgstr "Ubicacion por defecto"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.operation_master_action
+#: model:ir.ui.menu,name:mrp_master_extension.operation_master_menu
+#: field:mrp.bom,mrp_bom_operations_product_ids:0
+#: view:mrp.bom.operations.product:0
+#: view:mrp.operation:0
+#: field:mrp.operation,operation_line_ids:0
+#: field:mrp.operation,operations_product:0
+#: field:mrp.routing,routing_line_ids:0
+#: view:mrp.workcenter:0
+#: field:mrp.workcenter,mrp_op_ids:0
+msgid "Operations"
+msgstr "Operaciones"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Scheduled Operations"
+msgstr "Operaciones Programadas"
+
+#. module: mrp_master_extension
+#: constraint:stock.move:0
+msgid "You try to assign a lot which is not from the same product"
+msgstr "Está intentando asignar un lote que no es del mismo producto"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_stock_move
+msgid "Stock Move"
+msgstr "Movimiento stock"
+
+#. module: mrp_master_extension
+#: field:mrp.production,user_ops:0
+msgid "Users asignments"
+msgstr "Users asignments"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,maintain_notes:0
+msgid "Maintain Notes"
+msgstr "Maintain Notes"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Operation list"
+msgstr "Operation list"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:42
+#, python-format
+msgid "Warning!"
+msgstr "Aviso!"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Costing Information"
+msgstr "Informacion de Costos"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op,operation:0
+#: field:mrp.bom.operations.product,operation_id:0
+#: field:mrp.production.operation,operation_id:0
+#: field:mrp.production.users,op:0
+#: field:mrp.production.workcenter.line,operation_id:0
+msgid "Operation"
+msgstr "Operacion"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Consume wizard"
+msgstr "Asistente de Consumo"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_delete_choice
+msgid "Choice user to delete"
+msgstr "Choice user to delete"
+
+#. module: mrp_master_extension
+#: selection:mrp.operation,type:0
+msgid "Maintenance Operation"
+msgstr "Operaciones de Mantenimiento"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_bom_operations_product
+msgid "materials used to produce"
+msgstr "Materiales usados para producir"
+
+#. module: mrp_master_extension
+#: field:mrp.factory,location_id:0
+#: field:mrp.workcenter,location_id:0
+#: field:parcial.picking.aux.product,location_id:0
+#: field:parcial.picking.aux.production,location_id:0
+msgid "Location"
+msgstr "Ubicacion"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_workcenter_line
+#: field:mrp.production.operation,production_id:0
+msgid "Work Order"
+msgstr "Orden de entrega"
+
+#. module: mrp_master_extension
+#: field:product.product,mrp_bom_fp_id:0
+msgid "bom final products"
+msgstr "BoM de Productos finales"
+
+#. module: mrp_master_extension
+#: field:stock.move,bom_prop:0
+msgid "BOM Proportion"
+msgstr "BoM Parcial"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_new_production_user
+#: model:ir.actions.act_window,name:mrp_master_extension.action_new_production_user_op_add
+msgid "Production user"
+msgstr "Production user"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_product_line
+msgid "Production Scheduled Product"
+msgstr "Fabricación planificada producto"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,location_id:0
+#: field:mrp.production.operation,location_id:0
+#: field:mrp.production.workcenter.line,location_id:0
+msgid "Operation Location"
+msgstr "Operation Location"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,percent:0
+#: field:manufacturing.user,percent:0
+#: field:manufacturing.user.op.add,percent:0
+#: field:mrp.production.users,percent:0
+msgid "% Estimated"
+msgstr "% Estimado"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:263
+#, python-format
+msgid "Couldn't find bill of material for product"
+msgstr "Couldn't find bill of material for product"
+
+#. module: mrp_master_extension
+#: view:mrp.production.final.product:0
+msgid "Scheduled Final Products"
+msgstr "Scheduled Final Products"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,final_products_ids:0
+#: field:mrp.production.operation,final_products_ids:0
+msgid "Final products"
+msgstr "Final products"
+
+#. module: mrp_master_extension
+#: view:mrp.production.workcenter.line:0
+msgid "Routing Operation"
+msgstr "Routing Operation"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:93
+#, python-format
+msgid "quantity."
+msgstr "Cantidad"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,costs_hour:0
+#: help:mrp.production.operation,costs_hour:0
+msgid "Specify Cost of Workcenter per hour when using this material."
+msgstr "Specify Cost of Workcenter per hour when using this material."
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,cycle:0
+#: field:mrp.production.operation,cycle:0
+msgid "Nº Cycles"
+msgstr "Nº Ciclos"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_stop:0
+#: field:mrp.production.operation,time_stop:0
+msgid "Time after prod."
+msgstr "Tiempo despues de prod."
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+msgid "Search for mrp factories"
+msgstr "Buscar por Fábricas"
+
+#. module: mrp_master_extension
+#: view:assign.routing:0
+#: view:delete.choice:0
+#: view:delete.ops:0
+#: view:manufacturing.user:0
+#: view:manufacturing.user.op:0
+#: view:manufacturing.user.op.add:0
+#: view:mrp.production:0
+#: view:prod.partial.picking:0
+#: view:production.partial.picking:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_new_production_user_op
+msgid "Production operations user "
+msgstr "Operadores"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Produce wizard"
+msgstr "Asistente de Producción"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Capacity Information"
+msgstr "Información de Capacidad"
+
+#. module: mrp_master_extension
+#: field:mrp.production.workcenter.line,routing_id:0
+msgid "Parent Routing"
+msgstr "Ruta padre"
+
+#. module: mrp_master_extension
+#: view:aux.res.users:0
+#: view:delete.choice:0
+#: model:ir.model,name:mrp_master_extension.model_delete_ops
+#: view:manufacturing.user.op:0
+msgid "Delete"
+msgstr "Borrar"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,mrp_bom_operations_product_id:0
+#: field:mrp.production.final.product,mrp_production_operation_id:0
+msgid "Produced On"
+msgstr "Producido en"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_operation
+msgid "MRP Operation"
+msgstr "Operación MRP"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_parcial_picking_aux_production
+msgid "parcial.picking.aux.production"
+msgstr "parcial.picking.aux.production"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+#: view:mrp.production.operation:0
+msgid "Add Operator"
+msgstr "Agregar Operador"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+msgid "Product to Consume"
+msgstr "Productos a Consumir"
+
+#. module: mrp_master_extension
+#: field:mrp.production.operation,product_id:0
+msgid "Semi-Finished Product"
+msgstr "Productos Semi-Terminados"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,sequence:0
+#: field:mrp.production.operation,sequence:0
+msgid "Sequence"
+msgstr "Secuencia"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Operator List"
+msgstr "Lista de Operadores"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_production_partial_picking
+msgid "Partial Production"
+msgstr "Producción Parcial"
+
+#. module: mrp_master_extension
+#: view:delete.ops:0
+msgid "Yes"
+msgstr "Si"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,alter_workcenter_ids:0
+msgid "Alternative Work center"
+msgstr "Centro de Trabajo Alternativo"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,wizard_id:0
+#: field:parcial.picking.aux.product,wizard_id:0
+#: field:parcial.picking.aux.production,wizard_id:0
+msgid "wizard"
+msgstr "Asistente"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Calculate"
+msgstr "Calcular"
+
+#. module: mrp_master_extension
+#: view:mrp.operation:0
+msgid "Associated Machines"
+msgstr "Maquinas Asociadas"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production
+msgid "Manufacturing Order"
+msgstr "Órden de producción"
+
+#. module: mrp_master_extension
+#: help:mrp.operation,descript:0
+msgid "Description of the operation"
+msgstr "Descripcion de Operación"
+
+#. module: mrp_master_extension
+#: view:mrp.routing:0
+msgid "Operation Sequence"
+msgstr "Secuencia"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op,user:0
+msgid "Users added"
+msgstr "Usuario Agregado"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_partial_production_picking
+msgid "Production Picking"
+msgstr "Picking de Producción"
+
+#. module: mrp_master_extension
+#: field:mrp.production,production_operation_ids:0
+msgid "Production Operations"
+msgstr "Operaciones de Producción"
+
+#. module: mrp_master_extension
+#: view:mrp.production.operation:0
+msgid "Production Operation Lines"
+msgstr "Detalle de Operaciones"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:324
+#, python-format
+msgid "All components must have a default location !"
+msgstr "Todos los componentes deben tener una ubicación por defecto !"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Destination Loc."
+msgstr "Ubic. destino"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_delete_user
+#: model:ir.actions.act_window,name:mrp_master_extension.action_delete_user_ops
+msgid "action.new.time.input "
+msgstr "action.new.time.input "
+
+#. module: mrp_master_extension
+#: view:mrp.bom.final.product:0
+#: view:mrp.bom.operations.product:0
+msgid "Aditional Product to Produce"
+msgstr "Productos adicionales a Producir"
+
+#. module: mrp_master_extension
+#: view:mrp.production.workcenter.line:0
+msgid "Routing Operations"
+msgstr "Operaciones de Ruta"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_assign_routing
+msgid "Assign routing"
+msgstr "Asignar Ruta"
+
+#. module: mrp_master_extension
+#: field:parcial.picking.aux.product,stock_move_id:0
+#: field:parcial.picking.aux.production,stock_move_id:0
+msgid "Stock move"
+msgstr "Movimiento de Inventario"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Maintain Information"
+msgstr "Información de Mantenimiento"
+
+#. module: mrp_master_extension
+#: selection:mrp.operation,type:0
+msgid "Manufacturing Operation"
+msgstr "Operación de Producción"
+
+#. module: mrp_master_extension
+#: field:delete.choice,op_us:0
+#: field:delete.ops,op_us:0
+msgid "User to delete"
+msgstr "Usuario a Borrar"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user,user:0
+#: field:manufacturing.user.op.add,user:0
+msgid "User to add"
+msgstr "Usuario a Agregar"
+
+#. module: mrp_master_extension
+#: field:mrp.production.users,name:0
+msgid "User"
+msgstr "Usuario"
+
+#. module: mrp_master_extension
+#: field:mrp.factory,active:0
+#: field:mrp.operation,active:0
+msgid "Active"
+msgstr "Activo"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Properties"
+msgstr "Propiedades"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Maintaining"
+msgstr "Mantenimiento"
+
+#. module: mrp_master_extension
+#: sql_constraint:mrp.bom:0
+msgid "All product quantities must be greater than 0.\n"
+"You should install the mrp_subproduct module if you want to manage extra products on BoMs !"
+msgstr "Todas las cantidades de producto deben de ser superiores a cero.\n"
+"¡Debe instalar el módulo mrp_subproduct si quiere gestionar productos extra en las LdM!"
+
+#. module: mrp_master_extension
+#: help:mrp.workcenter,warranty_date:0
+msgid "Warranty limit date of the Work Center"
+msgstr "Fecha límite de garantía del Centro de Trabajo"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_partial_product_picking
+msgid "Process Picking"
+msgstr "Procesar Productos"
+
+#. module: mrp_master_extension
+#: constraint:stock.move:0
+msgid "You must assign a production lot for this product"
+msgstr "Debe asignar un lote de producción para este producto"
+
+#. module: mrp_master_extension
+#: field:aux.res.users,user_id:0
+msgid "user id"
+msgstr "ID de Usuario"
+
+#. module: mrp_master_extension
+#: help:mrp.operation,active:0
+msgid "If the active field is set to False, it will allow you to hide the resource record without removing it."
+msgstr "If the active field is set to False, it will allow you to hide the resource record without removing it."
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:263
+#, python-format
+msgid "Error"
+msgstr "Error"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,help:mrp_master_extension.mrp_factory_action
+msgid "Factories held many Work Centers which are located in the same plant."
+msgstr "Fabricas manejan varios centros de trabajo que estan ubicados en la misma planta"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,bom_id:0
+msgid "Parent BOM"
+msgstr "LdM Padre"
+
+#. module: mrp_master_extension
+#: help:mrp.production,product_def_loc:0
+#: help:product.product,default_location:0
+msgid "Default real location of the product"
+msgstr "Ubicación por defecto real del Producto"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Produce all"
+msgstr "Producir Todo"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:321
+#: code:addons/mrp_master_extension/mrp_production.py:326
+#, python-format
+msgid "All final products must have a default location !"
+msgstr "Todos los productos finales deben tener una ubicación por defecto !"
+
+#. module: mrp_master_extension
+#: view:manufacturing.user:0
+#: view:mrp.production:0
+msgid "Operator Assignment"
+msgstr "Asignar Operador"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:93
+#, python-format
+msgid "is consumed with"
+msgstr "Es consumido con"
+
+#. module: mrp_master_extension
+#: field:mrp.operation,cod:0
+msgid "Code"
+msgstr "Código"
+
+#. module: mrp_master_extension
+#: view:mrp.operation:0
+msgid "Search for Operations"
+msgstr "Buscar por Operaciones"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,time_start:0
+#: help:mrp.production.operation,time_start:0
+msgid "Time in hours for the setup for the material."
+msgstr "Tiempo en horas para configurar el material"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Confirm Production"
+msgstr "Confirmar producción"
+
+#. module: mrp_master_extension
+#: view:mrp.workcenter:0
+msgid "Alternatives"
+msgstr "Alternativas"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_factory
+msgid "Manufacturing Factory"
+msgstr "Fábrica de Producción"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+#: view:mrp.operation:0
+#: view:mrp.production.workcenter.line:0
+msgid "General Information"
+msgstr "Info General"
+
+#. module: mrp_master_extension
+#: view:mrp.factory:0
+#: view:mrp.operation:0
+msgid "Inactive"
+msgstr "Inactivo"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Consume all"
+msgstr "Consumir Todo"
+
+#. module: mrp_master_extension
+#: field:prod.partial.picking,move_lines:0
+#: field:production.partial.picking,production_lines:0
+msgid "Moves"
+msgstr "Movimiento"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,costs_hour:0
+#: field:mrp.production.operation,costs_hour:0
+msgid "Cost per hour"
+msgstr "Costo por Hora"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.final.product,bom_id:0
+#: view:mrp.bom.operations.product:0
+#: field:mrp.production.final.product,production_id:0
+msgid "Final Product"
+msgstr "Producto Final"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,purchase_date:0
+msgid "Purchase Date"
+msgstr "Fecha de Compra"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_assign_routing
+#: model:ir.model,name:mrp_master_extension.model_manufacturing_user
+#: model:ir.model,name:mrp_master_extension.model_manufacturing_user_op
+#: model:ir.model,name:mrp_master_extension.model_manufacturing_user_op_add
+msgid "Manufacturing new user"
+msgstr "Nuevo usuario de producción"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Product Information"
+msgstr "Información de Producto"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.mrp_factory_action
+#: model:ir.ui.menu,name:mrp_master_extension.menu_view_resource_search_mrp
+#: view:mrp.factory:0
+#: field:mrp.factory,name:0
+#: field:mrp.workcenter,factory_id:0
+msgid "Factory"
+msgstr "Fábrica"
+
+#. module: mrp_master_extension
+#: field:mrp.workcenter,maintain_op_id:0
+msgid "Maintain Operation"
+msgstr "Operación de Mantenimiento"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:321
+#: code:addons/mrp_master_extension/mrp_production.py:324
+#: code:addons/mrp_master_extension/mrp_production.py:326
+#, python-format
+msgid "Product Default Location"
+msgstr "Ubicación por defecto"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_workcenter
+#: field:mrp.bom.operations.product,workcenter_id:0
+#: view:mrp.factory:0
+#: field:mrp.production.operation,workcenter_id:0
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.workcenter,operations_product_ids:0
+msgid "Work Center"
+msgstr "Centro de producción"
+
+#. module: mrp_master_extension
+#: field:mrp.bom,final_product_line_ids:0
+msgid "Final Product Lines"
+msgstr "Detalle de Productos Finales"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_aux_res_users
+msgid "Operation users"
+msgstr "Usuarios Operadores"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/wizard/new_manufacturing_user.py:204
+#, python-format
+msgid "no hay produccion"
+msgstr "no hay produccion"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+msgid "Operation Lines"
+msgstr "Detalle de Operaciones"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,time_cycle:0
+#: help:mrp.production.operation,time_cycle:0
+msgid "Time in hours for doing one cycle of the material."
+msgstr "Tiempo en horas para hacer un ciclo"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,semi_prod_qty_fact:0
+#: field:mrp.production.operation,semi_prod_qty_fact:0
+msgid "Quantity Factor"
+msgstr "Factor"
+
+#. module: mrp_master_extension
+#: help:mrp.workcenter,purchase_date:0
+msgid "The machine's purchase date"
+msgstr "Fecha de compra de la maquina"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_product_product
+#: field:mrp.bom.final.product,product_id:0
+#: field:mrp.bom.operations.product,product_id:0
+#: field:mrp.production.final.product,product_id:0
+#: field:parcial.picking.aux.product,product_id:0
+#: field:parcial.picking.aux.production,product_id:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,descript:0
+#: view:mrp.factory:0
+#: field:mrp.factory,description:0
+#: view:mrp.operation:0
+#: field:mrp.operation,descript:0
+#: view:mrp.production.operation:0
+#: field:mrp.production.operation,descript:0
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.production.workcenter.line,descript:0
+msgid "Description"
+msgstr "Descripción"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:42
+#, python-format
+msgid "Please provide Proper Quantity !"
+msgstr "Por favor ingrese una cantidad correcta !"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.action_product_bom_structure
+msgid "Product BoM Structure"
+msgstr "Estructura LdM del producto"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,capacity_per_cycle:0
+#: field:mrp.production.operation,capacity_per_cycle:0
+msgid "Capacity per Cycle"
+msgstr "Capacidad por Ciclo"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Produce"
+msgstr "Producir"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_production.py:461
+#, python-format
+msgid "Manufacturing order '%s' is scheduled for the %s."
+msgstr "Orden de Producción '%s' está programada para %s."
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Estimated Information"
+msgstr "Info Estimada"
+
+#. module: mrp_master_extension
+#: field:manufacturing.user.op,production:0
+#: field:mrp.production.users,prod:0
+msgid "Production"
+msgstr "Producción"
+
+#. module: mrp_master_extension
+#: field:mrp.production,production_final_product_ids:0
+msgid "Production Final Products"
+msgstr "Productos Finales"
+
+#. module: mrp_master_extension
+#: model:ir.actions.act_window,name:mrp_master_extension.mrp_bom_tree_action
+#: model:ir.ui.menu,name:mrp_master_extension.menu_bom_tree
+msgid "Bill of Material Structure"
+msgstr "Estructura de Lista de Materiales"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: field:mrp.bom.operations.product,name:0
+#: field:mrp.operation,name:0
+#: field:mrp.production.final.product,name:0
+#: field:mrp.production.operation,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_parcial_picking_aux_product
+msgid "parcial.picking.aux.product"
+msgstr "parcial.picking.aux.product"
+
+#. module: mrp_master_extension
+#: model:ir.ui.menu,name:mrp_master_extension.menu_mrp_routing_action_inherit
+msgid "Routings"
+msgstr "Procesos productivos"
+
+#. module: mrp_master_extension
+#: field:assign.routing,routing:0
+#: model:ir.model,name:mrp_master_extension.model_mrp_routing
+#: field:mrp.bom,routing_id_name:0
+msgid "Routing"
+msgstr "Ruta de Producción"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,costs_cycle:0
+#: help:mrp.production.operation,costs_cycle:0
+msgid "Specify Cost of Workcenter per cycle when using this material."
+msgstr "Costo Especifico de Centro de trabajo por ciclo cuando usa este material"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/mrp_bom.py:194
+#, python-format
+msgid "User error"
+msgstr "Error de usuario"
+
+#. module: mrp_master_extension
+#: code:addons/mrp_master_extension/stock/stock.py:47
+#, python-format
+msgid "Can not produce a move with negative or zero quantity !"
+msgstr "No puede producir un movimiento con negativo o cant. cero !"
+
+#. module: mrp_master_extension
+#: help:mrp.bom.operations.product,time_stop:0
+#: help:mrp.production.operation,time_stop:0
+msgid "Time in hours for the cleaning."
+msgstr "Tiempo en horas despues de limpieza "
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Start Production"
+msgstr "Empezar producción"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_cycle:0
+#: field:mrp.production.operation,time_cycle:0
+msgid "Time for 1 cycle (hour)"
+msgstr "Tiempo para 1 ciclo"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_production_users
+msgid "mrp.production.users"
+msgstr "Usuarios"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+msgid "Recreate Picking"
+msgstr "Volver a crear picking"
+
+#. module: mrp_master_extension
+#: model:ir.model,name:mrp_master_extension.model_mrp_bom
+#: model:ir.model,name:mrp_master_extension.model_mrp_bom_final_product
+msgid "Bill of Material"
+msgstr "Lista de materiales"
+
+#. module: mrp_master_extension
+#: view:mrp.production:0
+#: view:mrp.production.operation:0
+#: view:mrp.production.product.line:0
+msgid "Scheduled Products"
+msgstr "Productos planificados"
+
+#. module: mrp_master_extension
+#: constraint:product.product:0
+msgid "Error: Invalid ean code"
+msgstr "Error: Código EAN erróneo"
+
+#. module: mrp_master_extension
+#: field:mrp.bom.operations.product,time_efficiency:0
+#: field:mrp.production.operation,time_efficiency:0
+msgid "Efficiency factor"
+msgstr "Factor de Eficiencia"
+
+#. module: mrp_master_extension
+#: view:mrp.bom.operations.product:0
+#: view:mrp.production.operation:0
+msgid "Semi Product"
+msgstr "Producto Intermedio"
+
+#. module: mrp_master_extension
+#: view:mrp.production.final.product:0
+#: view:mrp.production.operation:0
+msgid "Products to Produce"
+msgstr "Productos a Producir"
+
+#. module: mrp_master_extension
+#: constraint:mrp.production:0
+msgid "Order quantity cannot be negative or zero !"
+msgstr "¡Cantidad ordenada no puede ser negativa o cero!"
+
+#. module: mrp_master_extension
+#: field:mrp.operation,type:0
+msgid "Operation type"
+msgstr "Tipo de Operación"
+
=== added file 'mrp_master_extension/mrp_bom.py'
--- mrp_master_extension/mrp_bom.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_bom.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,412 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+import tools
+import math
+from tools.translate import _
+
+class bom_fixed_cost(osv.osv):
+ _name = 'bom.fixed.cost'
+ _description = 'Bom fixed costs'
+ _columns = {
+ 'name':fields.char('Description', size = 256),
+ 'amount':fields.float('Ammount', digits=(16, 2)),
+ 'estimated':fields.float('Estimated amount', digits=(16, 2)),
+ 'bom_id':fields.many2one('mrp.bom','Bom')
+ }
+
+bom_fixed_cost()
+
+class mrp_bom_operations_product(osv.osv):
+ _name = 'mrp.bom.operations.product'
+ _description = 'materials used to produce'
+
+ def _calculate_time(self, cr, uid, ids, field_name, arg, context=None):
+ res = {}
+ operation = self.pool.get('mrp.bom.operations.product').browse(cr, uid, ids)[0]
+ if operation:
+ if operation.semi_prod_qty:
+ cycle = (operation.semi_prod_qty/operation.capacity_per_cycle)
+ else:
+ cycle = (operation.bom_id.product_qty/operation.capacity_per_cycle)
+ res[operation.id] = {
+ 'cycle': cycle,
+ 'hour': float(((operation.time_cycle * cycle) + operation.time_start + operation.time_stop) / operation.time_efficiency)
+ }
+ return res
+
+ def _compute_qty(self, cr, uid, ids, field_name, arg, context=None):
+ id = ids[0]
+ bom_objs = self.pool.get('mrp.bom')
+ operation = self.pool.get('mrp.bom.operations.product').browse(cr, uid, id)
+ bom = bom_objs.browse(cr, uid, bom_objs.search(cr, uid, [('mrp_bom_operations_product_ids', 'in', id)]))[0]
+ if operation.type == 'variable' and operation.semi_prod_qty > 0:
+ return {id: 1 / float(bom.product_qty / operation.semi_prod_qty)}
+ else:
+ return {id: float(operation.semi_prod_qty)}
+
+ def create(self, cr, uid, data, context=None):
+ if 'name' not in data:
+ op = self.pool.get('mrp.operation').browse(cr, uid, data['operation_id'])
+ wc = self.pool.get('mrp.workcenter').browse(cr, uid, data['workcenter_id'])
+ data['name'] = '%s -> %s' % (op.name, wc.name)
+ return super(mrp_bom_operations_product, self).create(cr, uid, data, context)
+
+ _columns = {
+ 'name': fields.char('Name', size = 64, required= True),
+ 'sequence': fields.integer('Sequence', required= True),
+ 'descript': fields.text('Description', size= 64),
+ 'product_id': fields.many2one('product.product', 'Product'),
+ 'semi_prod_qty': fields.float('Product Qty', digits=(16, 2)),
+ 'semi_prod_uom': fields.many2one('product.uom', 'Product UOM'),
+ 'semi_prod_qty_fact': fields.function(_compute_qty, string='Quantity Factor', method=True, type='float',
+ store={'mrp.bom.operations.product': (lambda self, cr, uid, ids, c={}: ids, None, 20)}, digits=(16, 2)),
+ 'operation_id': fields.many2one('mrp.operation', 'Operation', required=True),
+ 'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', required=True),
+ 'location_id': fields.many2one('stock.location', 'Operation Location', required= True, domain=[('usage','in',('internal','supplier'))]),
+ 'capacity_per_cycle': fields.float('Capacity per Cycle', digits=(16, 2)),
+ 'time_efficiency' : fields.float('Efficiency factor', required=True, digits=(16, 2)),
+ 'time_cycle': fields.float('Time for 1 cycle (hour)', help="Time in hours for doing one cycle of the material.", digits=(16, 2)),
+ 'time_start': fields.float('Time before prod.', help="Time in hours for the setup for the material.", digits=(16, 2)),
+ 'time_stop': fields.float('Time after prod.', help="Time in hours for the cleaning.", digits=(16, 2)),
+ 'costs_hour': fields.float('Cost per hour', help="Specify Cost of Workcenter per hour when using this material.", digits=(16, 2)),
+ 'costs_cycle': fields.float('Cost per cycle', help="Specify Cost of Workcenter per cycle when using this material.", digits=(16, 2)),
+ 'cycle': fields.function(_calculate_time, string='Nº Cycles', method=True, type='float',
+ store={'mrp.bom.operations.product': (lambda self, cr, uid, ids, c={}: ids, None, 20)}, multi="All", digits=(16, 2)),
+ 'hour': fields.function(_calculate_time, string='Nº Hour', method=True, type='float',
+ store={'mrp.bom.operations.product': (lambda self, cr, uid, ids, c={}: ids, None, 20)}, multi="All", digits=(16, 2)),
+ 'final_products_ids': fields.one2many('mrp.bom.final.product', 'mrp_bom_operations_product_id', 'Final products'),
+ 'components_used_ids': fields.one2many('mrp.bom', 'mrp_bom_operations_product_id', 'Components used'),
+ 'bom_id': fields.many2one('mrp.bom', 'Parent BOM', required=True),
+ 'type': fields.selection([('fixed','Fixed'),('variable','Variable')],'Type'),
+
+ }
+
+ _defaults = {
+ 'sequence': lambda *a: 1,
+ 'time_efficiency': lambda *a: 1,
+ 'cycle': lambda *a: 1.0,
+ 'hour': lambda *a: 0.0,
+ 'type': lambda *a: 'variable',
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ res = super(mrp_bom_operations_product, self).default_get(cr, uid, fields, context)
+ if 'routing_id' in context.keys():
+ id = self.pool.get('mrp.bom').search(cr, uid, [('name', '=', context['name']), ('routing_id', '=', context['routing_id'])])[0]
+ res.update({'bom_id': id})
+ return res
+
+ def wc_onchange(self, cr, uid, ids, workcenter_id, operation_id):
+ value = {}
+ if workcenter_id:
+ wc = self.pool.get('mrp.workcenter').browse(cr, uid, workcenter_id)
+ op = self.pool.get('mrp.operation').browse(cr, uid, operation_id)
+ value['location_id'] = wc.location_id.id
+ value['capacity_per_cycle'] = wc.capacity_per_cycle
+ value['time_efficiency'] = wc.time_efficiency
+ value['time_cycle'] = wc.time_cycle
+ value['time_start'] = wc.time_start
+ value['time_stop'] = wc.time_stop
+ value['costs_hour'] = wc.costs_hour
+ value['costs_cycle'] = wc.costs_cycle
+ value['name'] = '%s -> %s' % (op.name, wc.name)
+ return {'value': value}
+
+ def prod_onchange(self, cr, uid, ids, product_id):
+ value = {}
+ warning = {}
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+ if prod.default_location.usage != 'production':
+ value.update({
+ 'product_id': self.browse(cr, uid, ids[0]).product_id.id,
+ })
+ warning = {
+ 'title': _("Wrong Product"),
+ 'message': _("This is not a valid product. Please, select a product with 'production' location type."),
+ }
+ else:
+ value.update({
+ 'semi_prod_qty_fact': 1,
+ 'semi_prod_uom': prod.product_tmpl_id.uom_id.id or False,
+ })
+ return {'value': value, 'warning': warning}
+
+ def cycle_onchange(self, cr, uid, ids, time_cycle, costs_hour):
+ value = {}
+ costh = costs_hour * time_cycle
+ value['costs_cycle'] = costh
+ return {'value':value}
+
+ def button_dummy(self, cr, uid, ids, *args):
+ self.pool.get('mrp.bom.operations.product').write(cr, uid, ids, {})
+ return True
+mrp_bom_operations_product()
+
+class mrp_bom_final_product(osv.osv):
+ _name = 'mrp.bom.final.product'
+ _description = 'Bill of Material'
+
+ _columns = {
+ 'product_id': fields.many2one('product.product', 'Product', required=True),
+ 'product_qty': fields.float('Product Qty', required=True, digits=(16, 2)),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, help="UoM (Unit of Measure) is the unit of measurement for the inventory control"),
+ 'mrp_bom_operations_product_id': fields.many2one('mrp.bom.operations.product','Produced On'),
+ 'location_id': fields.related('product_id', 'default_location', type='many2one', relation='stock.location', string='Default Location', required=True),
+ 'bom_id': fields.many2one('mrp.bom', 'Final Product'),
+ }
+
+ _defaults = {
+ 'product_qty': lambda *a: 1,
+ 'product_uom': lambda *a: 1,
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ res = super(mrp_bom_final_product, self).default_get(cr, uid, fields, context)
+ if 'routing_id' in context.keys():
+ id = self.pool.get('mrp.bom').search(cr, uid, [('name', '=', context['name']), ('routing_id', '=', context['routing_id'])])
+ res.update({'bom_id': id})
+ if 'bom_id' in context.keys():
+ res.update({'bom_id': context['bom_id']})
+ return res
+
+ def prod_onchange(self, cr, uid, ids, product_id):
+ value = {}
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+ value['location_id'] = prod.default_location.id
+ value['product_uom'] = prod.product_tmpl_id.uom_id.id or False
+ return {'value': value}
+
+mrp_bom_final_product()
+
+def rounding(f, r):
+ if not r:
+ return f
+ return round(f / r) * r
+
+class mrp_bom(osv.osv):
+ _description = 'Bill of Material'
+ _inherit = 'mrp.bom'
+
+# def write(self, cr, uid, ids, value, context=None):
+# id = ids[0]
+# for line in value['bom_lines']:
+# print id, line
+# if line[2] != False:
+# line[2]['bom_id'] = id
+# if line[0] == 0:
+# find_bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, line[2]['product_id'], line[2]['product_uom'])
+# print find_bom_id
+# if find_bom_id:
+# return super(mrp_bom, self).write(cr, uid, find_bom_id, line[2], context)
+# else:
+# return self.pool.get('mrp.bom').create(cr, uid, line[2])
+# return True
+
+ def copy(self, cr, uid, id, default=None, context=None):
+ if default is None:
+ default = {}
+
+ bom_super = super(mrp_bom, self).copy(cr, uid, id, default, context)
+
+ original_bom = self.browse(cr, uid, id)
+ copy_bom_id = self.search(cr, uid, [('name','=',(original_bom.name+' Copy'))])[0]
+ copy_bom = self.browse(cr, uid, copy_bom_id)
+ for bom_aux in copy_bom.bom_lines:
+ aux_bom_op = self.pool.get('mrp.bom.operations.product').browse(cr, uid, bom_aux.mrp_bom_operations_product_id)[0]
+ for aux_op in bom_aux.mrp_bom_operations_product_ids:
+ if aux_op.name == aux_bom_op.name:
+ bom_aux.write({'mrp_bom_operations_product_id':aux_op.id})
+ return bom_super
+
+
+ _columns = {
+ 'mrp_bom_operations_product_ids': fields.one2many('mrp.bom.operations.product', 'bom_id', 'Operations'),
+ 'mrp_bom_operations_product_id': fields.many2one('mrp.bom.operations.product','Consumed On'),
+ 'final_product_line_ids': fields.one2many('mrp.bom.final.product', 'bom_id', 'Final Product Lines'),
+ 'routing_id_name': fields.char('Routing',size=64),
+ 'fixed_costs':fields.one2many('bom.fixed.cost','bom_id','Fixed costs')
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ res = super(mrp_bom, self).default_get(cr, uid, fields, context)
+ if 'routing_id' in context.keys():
+ id = self.search(cr, uid, [('name', '=', context['name']), ('routing_id', '=', context['routing_id'])])
+ res.update({'bom_id': id})
+ if 'bom_id' in context.keys():
+ res.update({'bom_id': context['bom_id']})
+ return res
+
+ def prod_onchange(self, cr, uid, ids, product_id):
+ value = {}
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+# value['location_id'] = prod.default_location.id
+ value['name'] = prod.name
+ value['product_uom'] = prod.product_tmpl_id.uom_id.id or False
+ return {'value': value}
+
+ def onchange_routingField(self, cr, uid, ids, routing_id):
+ operations_product_obj = self.pool.get('mrp.bom.operations.product')
+ if not self.browse(cr, uid, ids):
+ raise osv.except_osv(_('User error'), _('Save the record first !'))
+ mrp_bom_id = self.browse(cr, uid, ids)[0]
+ workcenter_lines_obj = self.pool.get('mrp.production.workcenter.line')
+ workcenter_line_ids = workcenter_lines_obj.search(cr, uid, [('id', '=', routing_id)])
+ workcenter_line_objs = []
+
+ if len(workcenter_line_ids):
+ workcenter_line_objs = workcenter_lines_obj.browse(cr, uid, workcenter_line_ids)
+
+ for operation_product_id in mrp_bom_id.mrp_bom_operations_product_ids:
+ operations_product_obj.unlink(cr, uid, [operation_product_id.id])
+
+ values = {
+ 'sequence': 0,
+ 'descript': '',
+ 'operation_id': None,
+ 'location_id': None,
+ 'workcenter_id': None,
+ 'bom_id': mrp_bom_id.id,
+ 'capacity_per_cycle': 0,
+ 'time_efficiency': 1,
+ 'time_cycle': 0,
+ 'time_start': 0,
+ 'time_stop': 0,
+ 'costs_hour': 0,
+ 'costs_cycle': 0,
+ }
+
+ for workcenter_line in workcenter_line_objs:
+ values['sequence'] = workcenter_line.sequence
+ values['descript'] = workcenter_line.descript
+ values['operation_id'] = workcenter_line.operation_id.id
+ values['location_id'] = workcenter_line.workcenter_id.location_id.id
+ values['workcenter_id'] = workcenter_line.workcenter_id.id
+ values['capacity_per_cycle'] = workcenter_line.workcenter_id.capacity_per_cycle
+ values['time_efficiency'] = workcenter_line.workcenter_id.time_efficiency
+ values['time_cycle'] = workcenter_line.workcenter_id.time_cycle
+ values['time_start'] = workcenter_line.workcenter_id.time_start
+ values['time_stop'] = workcenter_line.workcenter_id.time_stop
+ values['costs_hour'] = workcenter_line.workcenter_id.costs_hour
+ values['costs_cycle'] = workcenter_line.workcenter_id.costs_cycle
+ values['name'] = '%s -> %s' % (workcenter_line.operation_id.name, workcenter_line.workcenter_id.name)
+ res = operations_product_obj.create(cr, uid, values)
+
+ return {}
+
+ def _bom_explode(self, cr, uid, bom, factor, properties=[], addthis=False, level=0):
+ """ Finds Products and Workcenters for related BoM for manufacturing order.
+ @param bom: BoM of particular product.
+ @param factor: Factor of product UoM.
+ @param properties: A List of properties Ids.
+ @param addthis: If BoM found then True else False.
+ @param level: Depth level to find BoM lines starts from 10.
+ @return: result: List of dictionaries containing product details.
+ result2: List of dictionaries containing workcenter details.
+ """
+ factor = factor / (bom.product_efficiency or 1.0)
+ factor = rounding(factor, bom.product_rounding)
+ if factor < bom.product_rounding:
+ factor = bom.product_rounding
+ result = []
+ phantom = False
+ if bom.type == 'phantom' and not bom.bom_lines:
+ newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties)
+ if newbom:
+ res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty, properties, addthis=True, level=level+10)
+ result = result + res[0]
+ phantom = True
+ else:
+ phantom = False
+ if not phantom:
+ if bom.routing_id:
+ for op_use in bom.mrp_bom_operations_product_ids:
+ products = []
+ finals = []
+ for product in op_use.components_used_ids:
+ if product.product_uom.name == 'PCE':
+ qty = math.ceil(product.product_qty )
+ else:
+ qty = product.product_qty
+ if op_use.type == 'variable':
+ qty = qty * factor
+
+ products.append({
+ 'name': product.product_id.name,
+ 'product_id': product.product_id.id,
+ 'product_qty': qty,
+ 'product_uom': product.product_uom.id,
+ 'product_uos_qty': product.product_uos and bom.product_uos_qty * factor or False,
+ 'product_uos': product.product_uos and bom.product_uos.id or False,
+ })
+ for final in op_use.final_products_ids:
+ if final.product_uom.name == 'PCE':
+ qty = math.ceil(final.product_qty )
+ else:
+ qty = final.product_qty
+ if op_use.type == 'variable':
+ qty = qty * factor
+
+ finals.append({
+ 'name': final.product_id.name,
+ 'product_id': final.product_id.id,
+ 'product_qty': qty,
+ 'product_uom': final.product_uom.id,
+ 'location_id': final.location_id.id,
+ })
+ result.append({
+ 'name': tools.ustr(op_use.name),
+ 'workcenter_id': op_use.workcenter_id.id,
+ 'operation_id': op_use.operation_id.id,
+ 'location_id': op_use.location_id.id,
+ 'type': op_use.type,
+ 'product_id': op_use.product_id.id,
+ 'semi_prod_uom': op_use.semi_prod_uom.id,
+ 'semi_prod_qty_fact': op_use.semi_prod_qty_fact or 0,
+ 'sequence': level+(op_use.sequence or 0),
+ 'capacity_per_cycle': op_use.capacity_per_cycle,
+ 'time_efficiency': op_use.time_efficiency,
+ 'time_cycle': op_use.time_cycle,
+ 'time_start': op_use.time_start,
+ 'time_stop': op_use.time_stop,
+ 'costs_hour': op_use.costs_hour,
+ 'costs_cycle': op_use.costs_cycle,
+ 'hour': op_use.hour,
+ 'cycle': op_use.cycle,
+ 'products': products,
+ 'finals': finals,
+ })
+ for bom2 in bom.bom_lines:
+ res = self._bom_explode(cr, uid, bom2, factor, properties, addthis=True, level=level+10)
+ if res != []:
+ result = result + res[0]
+ return result
+
+mrp_bom()
=== added file 'mrp_master_extension/mrp_bom_view.xml'
--- mrp_master_extension/mrp_bom_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_bom_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ BOM
+ -->
+
+ <record id="mrp_bom_inherit_onchange_form_view" model="ir.ui.view">
+ <field name="name">mrp.bom.form</field>
+ <field name="model">mrp.bom</field>
+ <field name="inherit_id" ref="mrp.mrp_bom_form_view" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/group/field[@name='routing_id']" position="replace" />
+ <xpath expr="/form/notebook/page[@string='Components']/field" position="replace">
+ <field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list" default_get="{'name': name, 'routing_id': routing_id}">
+ <tree string="Components" editable="bottom">
+ <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+ <field name="product_qty"/>
+ <field name="product_uom"/>
+ <field name="name" invisible="1"/>
+ <field name="date_start"/>
+ <field name="date_stop"/>
+ </tree>
+ <form string="Bill of Material">
+ <group colspan="4" col="6">
+ <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+ <field name="name" select="1"/>
+ <field name="code" select="1" string="Reference" groups="base.group_extended"/>
+ <newline/>
+ <field name="product_qty"/>
+ <field name="product_uom"/>
+ <field name="routing_id" groups="base.group_extended"/>
+ <newline/>
+ <field name="product_uos_qty" groups="product.group_uos" />
+ <field name="product_uos" groups="product.group_uos"/>
+ <newline/>
+ <field name="type" groups="base.group_extended"/>
+ <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ </group>
+ <group groups="base.group_extended">
+ <notebook colspan="4">
+ <page string="Components">
+ <field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list">
+ <tree string="Components" editable="bottom">
+ <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+ <field name="product_qty"/>
+ <field name="product_uom"/>
+ <field name="name" invisible="1"/>
+ <field name="date_start"/>
+ <field name="date_stop"/>
+ </tree>
+ </field>
+ </page>
+ <page string="Revisions" groups="base.group_extended" attrs="{'invisible': [('bom_id','!=',False)]}">
+ <field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
+ </page>
+ <page string="Properties" groups="base.group_extended">
+ <field name="position"/>
+ <field name="active"/>
+ <field name="sequence"/>
+ <field name="bom_id"/>
+
+ <field name="date_start"/>
+ <field name="date_stop"/>
+ <field name="product_rounding"/>
+ <field name="product_efficiency" groups="base.group_extended"/>
+ <field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
+ </page>
+ </notebook>
+ </group>
+ </form>
+ </field>
+ </xpath>
+ <xpath expr="/form/notebook/page/field/tree/field[@name='product_id']"
+ position="after">
+ <field name="bom_id" invisible="1" />
+ <field name="mrp_bom_operations_product_id" domain="[('bom_id', '=', bom_id)]" />
+ </xpath>
+ <xpath expr="/form/group/field[@name='product_uom']" position="after">
+ <field name="active" />
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Components']"
+ position="after">
+ <page string="Final Products">
+ <field name="final_product_line_ids" nolabel="1" default_get="{'name': name, 'routing_id': routing_id}"/>
+ </page>
+ <page string="Manufacturing operations">
+ <field name="mrp_bom_operations_product_ids" nolabel="1" default_get="{'name': name, 'routing_id': routing_id}"/>
+ </page>
+ <page string="Fixed costs">
+ <field name="fixed_costs" nolabel="1" widget="one2many_list">
+ <tree string="" editable="true">
+ <field name="name" width="700" />
+ <field name="amount" width="100" sum="Total"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ <xpath expr="/form/notebook" position="after">
+ <group>
+ <field name="routing_id" readonly="1" />
+ <button name="%(action_assign_routing)d" string="Assign Routing"
+ type="action" icon="terp-stock_zoom" />
+ </group>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <!--
+ Operations Product
+ -->
+
+ <record id="mrp_bom_operations_product_view" model="ir.ui.view">
+ <field name="name">mrp.bom.operations.product.form</field>
+ <field name="model">mrp.bom.operations.product</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Operation materials">
+ <group colspan="4">
+ <field name="sequence" />
+ <field name="operation_id" select="1" />
+ <field name="workcenter_id" domain="[('mrp_op_ids', 'in', [operation_id])]"
+ on_change="wc_onchange(workcenter_id,operation_id)" />
+ <field name="location_id" />
+ <field name="bom_id" invisible="1" />
+ </group>
+ <notebook colspan="4">
+ <page string="Product Information">
+ <group colspan="4">
+ <separator string="Semi Product" colspan="4" />
+ <field name="product_id" select="1"
+ on_change="prod_onchange(product_id)" />
+ <field name="semi_prod_uom" />
+ <field name="semi_prod_qty" />
+ <field name="semi_prod_qty_fact" />
+ <field name="type" />
+ <label string="" colspan="1" />
+ <button name="button_dummy" string="Calculate" type="object"
+ icon="gtk-ok" />
+ </group>
+ <newline />
+ <field colspan="4" name="components_used_ids" nolabel="1" default_get="{'bom_id': bom_id}">
+ <tree string="Product to Consume" editable="bottom">
+ <!-- on_change="onchange_product_id(product_id, name) -->
+ <field name="product_id" select="1" on_change="prod_onchange(product_id)"/>
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="name" invisible="1" />
+ <field name="date_start" />
+ <field name="date_stop" />
+ <field name="bom_id" invisible="1" />
+ </tree>
+ <form>
+ <field name="product_id" select="1" on_change="prod_onchange(product_id)"/>
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="name" invisible="1" />
+ <field name="date_start" />
+ <field name="date_stop" />
+ </form>
+ </field>
+ <newline />
+ <field name="final_products_ids" colspan="4" nolabel="1" default_get="{'bom_id': bom_id}">
+ <tree string="Aditional Product to Produce" editable="bottom">
+ <field name="product_id" select="1" on_change="prod_onchange(product_id)"/>
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" />
+ <field name="bom_id" invisible="1" />
+ </tree>
+ <form>
+ <field name="product_id" select="1" on_change="prod_onchange(product_id)" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" />
+ </form>
+ </field>
+ </page>
+ <page string="Properties">
+ <group col="2" colspan="2">
+ <separator string="Capacity Information" colspan="4" />
+ <field name="time_efficiency" />
+ <field name="capacity_per_cycle" />
+ <field name="time_cycle" widget="float_time" on_change="cycle_onchange(time_cycle, costs_hour)"/>
+ <field name="time_start" widget="float_time" />
+ <field name="time_stop" widget="float_time" />
+ </group>
+ <group col="2" colspan="2">
+ <separator string="Costing Information" colspan="4" />
+ <field name="costs_hour" on_change="cycle_onchange(time_cycle, costs_hour)"/>
+ <field name="costs_cycle" />
+ </group>
+ <group colspan="4">
+ <separator string="Estimated Information" colspan="4" />
+ <field name="cycle" />
+ <field name="hour" widget="float_time" />
+ <label string="" colspan="3" />
+ <button name="button_dummy" states="draft" string="Calculate"
+ type="object" icon="gtk-ok" />
+ </group>
+ </page>
+ <page string="Notes">
+ <field name="descript" colspan="4" nolabel="1" />
+ </page>
+ </notebook>
+ </form>
+ </field>
+ </record>
+
+ <record id="mrp_bom_operations_product_tree_view" model="ir.ui.view">
+ <field name="name">mrp.bom.operations.product.tree</field>
+ <field name="model">mrp.bom.operations.product</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Operation Lines">
+ <field name="sequence" select="1" />
+ <field name="operation_id" />
+ <field name="workcenter_id" />
+ <field name="product_id" />
+ <field name="semi_prod_qty" />
+ <field name="semi_prod_uom" />
+ <field name="location_id" />
+ <field name="cycle" />
+ <field name="hour" widget="float_time" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="operation_products_search_form_view" model="ir.ui.view">
+ <field name="name">mrp.bom.operations.product.search</field>
+ <field name="model">mrp.bom.operations.product</field>
+ <field name="type">search</field>
+ <field eval="1" name="priority" />
+ <field name="arch" type="xml">
+ <search string="Operations">
+ <group>
+ <field name="name" string="Name" />
+ <field name="product_id" string="Final Product" />
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <!--
+ Final Product
+ -->
+
+ <record id="mrp_bom_final_product_form_view" model="ir.ui.view">
+ <field name="name">mrp.bom.final.product.form</field>
+ <field name="model">mrp.bom.final.product</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Product to Produce">
+ <field name="product_id" select="1" on_change="prod_onchange(product_id)" />
+ <field name="bom_id" invisible="1" />
+ <field name="mrp_bom_operations_product_id" domain="[('bom_id', '=', bom_id)]" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" />
+ </form>
+ </field>
+ </record>
+
+ <record id="mrp_bom_final_product_tree_view" model="ir.ui.view">
+ <field name="name">mrp.bom.final.product.tree</field>
+ <field name="model">mrp.bom.final.product</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Aditional Product to Produce" editable="bottom">
+ <field name="product_id" select="1" on_change="prod_onchange(product_id)"/>
+ <field name="bom_id" invisible="1" />
+ <field name="mrp_bom_operations_product_id" domain="[('bom_id', '=', bom_id)]" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="mrp_bom_tree_action" model="ir.actions.act_window">
+ <field name="name">Bill of Material Structure</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">mrp.bom</field>
+ <field name="view_type">tree</field>
+ <field name="view_id" ref="mrp.mrp_bom_tree_view" />
+ </record>
+
+ <menuitem action="mrp_bom_tree_action" id="menu_bom_tree"
+ parent="mrp.menu_mrp_bom" />
+
+ <act_window id="action_product_bom_structure"
+ name="Product BoM Structure"
+ domain="[('product_id', '=', active_id),('bom_id','=',False)]"
+ view_type="tree"
+ view_id="mrp.mrp_bom_tree_view"
+ res_model="mrp.bom"
+ src_model="product.product" />
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'mrp_master_extension/mrp_factory.py'
--- mrp_master_extension/mrp_factory.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_factory.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,42 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields,osv
+from tools.translate import _
+
+class mrp_factory(osv.osv):
+
+ _name = 'mrp.factory'
+ _description = 'Manufacturing Factory'
+
+ _columns = {
+ 'name':fields.char('Factory', size=64, required=True, readonly=False),
+ 'active': fields.boolean('Active'),
+ 'description':fields.text('Description', required=False, readonly=False),
+ 'location_id': fields.many2one('stock.location', 'Location', size= 64, required= True, help='Specify the location of this plant'),
+ 'workcenter_ids': fields.one2many('mrp.workcenter', 'factory_id', 'Work Centers', required= False),
+ 'company_id': fields.many2one('res.company', 'Company'),
+ }
+
+ _defaults = {
+ 'active': lambda *a: True,
+ 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.routing', context=context)
+ }
+mrp_factory()
\ No newline at end of file
=== added file 'mrp_master_extension/mrp_factory_view.xml'
--- mrp_master_extension/mrp_factory_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_factory_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ Factory
+ -->
+
+ <record id="mrp_factory_tree_view" model="ir.ui.view">
+ <field name="name">mrp.factory.tree</field>
+ <field name="model">mrp.factory</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Work Center">
+ <field name="name" />
+ <field name="description" />
+ <field name="location_id" />
+ <field name="company_id" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="mrp_factory_view" model="ir.ui.view">
+ <field name="name">mrp.factory.form</field>
+ <field name="model">mrp.factory</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Factory">
+ <group col="4" colspan="4">
+ <field name="name" />
+ <field name="company_id" />
+ <field name="location_id" />
+ <field name="active" />
+ </group>
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Work Centers" />
+ <field colspan="4" name="workcenter_ids" nolabel="1" default_get="{'factory': name}"/>
+ </page>
+ <page string="Notes">
+ <separator colspan="4" string="Description" />
+ <field colspan="4" name="description" nolabel="1" />
+ </page>
+ </notebook>
+ </form>
+ </field>
+ </record>
+
+ <!-- Search Views -->
+
+ <record id="view_mrp_factory_search" model="ir.ui.view">
+ <field name="name">mrp.factory.search</field>
+ <field name="model">mrp.factory</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search for mrp factories">
+ <group col='15' colspan='4'>
+ <filter string="Inactive" icon="terp-gdu-smart-failing"
+ domain="[('active','=',False)]" />
+ <separator orientation="vertical" />
+ <field name="name" />
+ <field name="location_id" />
+ <field name="company_id" />
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <!-- Action Views -->
+
+ <record id="mrp_factory_action" model="ir.actions.act_window">
+ <field name="name">Factory</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">mrp.factory</field>
+ <field name="view_type">form</field>
+ <field name="view_id" ref="mrp_factory_tree_view" />
+ <field name="search_view_id" ref="view_mrp_factory_search" />
+ <field name="help">Factories held many Work Centers which are located in the same plant.</field>
+ </record>
+
+ <!-- Menus -->
+
+ <menuitem action="mrp_factory_action" id="menu_view_resource_search_mrp"
+ parent="mrp.menu_pm_resources_config" sequence="1" />
+ </data>
+</openerp>
=== added file 'mrp_master_extension/mrp_operation.py'
--- mrp_master_extension/mrp_operation.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_operation.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,85 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+
+class steps_std_descr(osv.osv):
+ """
+ Standard Description for input operator time
+ """
+ _name = 'mrp.operation.description.steps'
+ _columns = {
+ 'descr_id':fields.many2one('mrp.operation.description','Operation'),
+ 'check':fields.boolean('State', required=False),
+ 'name':fields.text('Requirement'),
+ 'sequence': fields.integer('Sequence', size = 64, required= False),
+ }
+steps_std_descr()
+
+
+
+
+class mrp_operation(osv.osv):
+ _name = 'mrp.operation'
+ _description = 'MRP Operation'
+
+ _columns = {
+ 'cod': fields.char('Code', size = 64, required=True),
+ 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the resource record without removing it."),
+ 'name': fields.char('Name', size=64, required=True),
+ 'workcenter': fields.many2many('mrp.workcenter','mrp_operations_workcenter', 'operation_id', 'workcenter_id','Work centers'),
+ 'descript': fields.text('Description', help="Description of the operation"),
+ 'type': fields.selection([
+ ('mfo','Manufacturing Operation'),
+ ('mto', 'Maintenance Operation')], 'Operation type', size=64, required=True),
+ 'operation_line_ids': fields.one2many('mrp.production.workcenter.line', 'operation_id', 'Operations'),
+ 'operations_product': fields.one2many('mrp.bom.operations.product', 'operation_id', 'Operations'),
+ 'std_description':fields.one2many('mrp.operation.description','operation_id','Standard Descriptions')
+ }
+
+ _defaults = {
+ 'type': lambda *a: 'mfo',
+ 'active': lambda *a: True,
+ }
+
+mrp_operation()
+
+class std_descr(osv.osv):
+ """
+ Standard Description for input operator time
+ """
+ _name = 'mrp.operation.description'
+ _columns = {
+ 'operation_id':fields.many2one('mrp.operation','Operation'),
+ 'name':fields.text('Standard description'),
+ 'sequence': fields.integer('Sequence', size = 64, required= False),
+ 'time_todo' : fields.float('Estimated Time', required=False, digits=(16, 2)),
+ 'qty': fields.integer('Qty', size = 64, required= False),
+ 'steps':fields.one2many('mrp.operation.description.steps','descr_id','Steps')
+
+ }
+ def create(self, cr, uid, vals, *args, **kwargs):
+
+ return super(std_descr,self).create(cr, uid, vals, *args, **kwargs)
+std_descr()
+
+
=== added file 'mrp_master_extension/mrp_operation_view.xml'
--- mrp_master_extension/mrp_operation_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_operation_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ Operation master
+ -->
+
+ <record id="operation_master_tree_view" model="ir.ui.view">
+ <field name="name">mrp.operation.tree</field>
+ <field name="model">mrp.operation</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Operations">
+ <field name="cod" />
+ <field name="name" />
+ <field name="type" />
+ <field name="workcenter" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="operation_master_form_view" model="ir.ui.view">
+ <field name="name">mrp.operation.form</field>
+ <field name="model">mrp.operation</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Operations">
+ <group colspan="4">
+ <field name="cod" />
+ <field name="name" />
+ <field name="type" />
+ <field name="active" />
+ </group>
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Associated Machines" />
+ <field name="workcenter" nolabel="1" />
+ </page>
+ <page string="Descriptions">
+ <field name="std_description">
+ <tree string="Standard Descriptions for Operation" editable="bottom">
+ <field name="sequence"/>
+ <field name="name" nolabel="1"/>
+ <field name="qty"/>
+ <field name="time_todo"/>
+ </tree>
+ </field>
+ </page>
+ <page string="Notes">
+ <separator colspan="4" string="Description" />
+ <field name="descript" nolabel="1" />
+ </page>
+
+ </notebook>
+ </form>
+ </field>
+ </record>
+
+ <record id="operation_description_master_tree_view" model="ir.ui.view">
+ <field name="name">mrp.operation.description.tree</field>
+ <field name="model">mrp.operation.description</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Standard Descriptions" >
+ <field name="operation_id" />
+ <field name="sequence" />
+ <field name="name" />
+ <field name="qty" />
+ <field name="time_todo" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="operation_description_master_form_view" model="ir.ui.view">
+ <field name="name">mrp.operation.description.form</field>
+ <field name="model">mrp.operation.description</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Standard Descriptions">
+ <group colspan="2">
+ <field name="sequence" />
+ <field name="name" />
+ <field name="qty" />
+ <field name="time_todo" />
+ </group>
+ <notebook>
+ <page string="Steps">
+ <field name="steps" nolabel="1" mode="tree,form">
+ <tree string="Common steps for standar description" editable="bottom">
+ <field name="check"/>
+ <field name="sequence"/>
+ <field name="name"/>
+ </tree>
+ <form string="Common steps for standar description">
+ <field name="check"/>
+ <field name="sequence"/>
+ <field name="name"/>
+ </form>
+ </field>
+ </page>
+ </notebook>
+ </form>
+ </field>
+ </record>
+
+
+ <!-- Search Views -->
+
+ <record id="view_operation_master_search" model="ir.ui.view">
+ <field name="name">mrp.operation.search</field>
+ <field name="model">mrp.operation</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search for Operations">
+ <group col='15' colspan='4'>
+ <filter string="Inactive" icon="terp-gdu-smart-failing"
+ domain="[('active','=',False)]" />
+ <separator orientation="vertical" />
+ <field name="cod" />
+ <field name="name" />
+ <field name="type" />
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="view_operation_description_search_form" model="ir.ui.view">
+ <field name="name">operation.description.search.form</field>
+ <field name="model">mrp.operation.description</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search>
+ <group expand="1" string="Group By..." colspan="4" col="20">
+ <filter string="Operation" name="group_operation_id" icon="terp-stage" domain="[]" context="{'group_by':'operation_id'}"/>
+ <separator orientation="vertical"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <!-- Action Views -->
+ <record id="operation_description_master_action" model="ir.actions.act_window">
+ <field name="name">Std Descriptions</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">mrp.operation.description</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_operation_description_search_form"/>
+ <field name="context">{'group_by':'operation_id'}</field>
+ </record>
+
+ <record id="operation_master_action" model="ir.actions.act_window">
+ <field name="name">Operations</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">mrp.operation</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="view_id" ref="operation_master_tree_view" />
+ </record>
+
+ <!-- Menus -->
+
+ <delete model="ir.ui.menu" id="mrp.menu_mrp_routing_action"/>
+
+ <menuitem action="mrp.mrp_routing_action" id="menu_mrp_routing_action_inherit"
+ parent="mrp.menu_mrp_configuration" groups="base.group_extended" sequence="1" />
+
+ <menuitem action="operation_master_action" id="operation_master_menu"
+ parent="mrp.menu_mrp_configuration" sequence="2" />
+
+ <menuitem action="operation_description_master_action" id="operation_description_master_menu"
+ parent="mrp.menu_mrp_configuration" sequence="3" />
+
+
+ </data>
+</openerp>
=== added file 'mrp_master_extension/mrp_production.py'
--- mrp_master_extension/mrp_production.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_production.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,803 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+
+from osv import osv, fields
+from tools.translate import _
+import netsvc
+
+
+class mrp_fixed_cost(osv.osv):
+ _name = 'mrp.fixed.cost'
+ _description = 'MRP fixed costs'
+ _columns = {
+ 'name':fields.char('Description', size = 256),
+ 'amount':fields.float('Ammount', digits=(16, 2)),
+ 'estimated':fields.float('Estimated amount', digits=(16, 2)),
+ 'production_id':fields.many2one('mrp.production','Bom'),
+ 'created':fields.boolean ('created')
+ }
+ _defaults = {
+ 'created': False
+ }
+
+mrp_fixed_cost()
+
+class mrp_production_operation(osv.osv):
+ _name = 'mrp.production.operation'
+ _description = 'Production Operation'
+
+ def _calculate_time(self, cr, uid, ids, field_name, arg, context=None):
+ res = {}
+ operation = self.pool.get('mrp.production.operation').browse(cr, uid, ids)[0]
+# production = self.pool.get('mrp.production').browse(cr, uid, operation.production_id.id)
+ if operation:
+ if operation.semi_prod_qty:
+ cycle = (operation.semi_prod_qty/operation.capacity_per_cycle)
+ else:
+ cycle = (operation.production_id.product_qty/operation.capacity_per_cycle)
+ res[operation.id] = {
+ 'cycle': cycle,
+ 'hour': float(((operation.time_cycle * cycle) + operation.time_start + operation.time_stop) / operation.time_efficiency)
+ }
+ return res
+
+ def _compute_qty(self, cr, uid, ids, field_name, arg, context=None):
+ id = ids[0]
+ production_objs = self.pool.get('mrp.production')
+ operation = self.pool.get('mrp.production.operation').browse(cr, uid, id)
+ production = production_objs.browse(cr, uid, production_objs.search(cr, uid, [('production_operation_ids', 'in', id)]))[0]
+ if operation.type == 'variable':
+ return {id: float(production.product_qty * operation.semi_prod_qty_fact)}
+ else:
+ return {id: float(operation.semi_prod_qty_fact)}
+
+ _columns = {
+ 'name': fields.char('Name', size = 64, required= True),
+ 'sequence': fields.integer('Sequence', size = 64, required= True),
+ 'descript': fields.text('Description', size= 64),
+ 'product_id': fields.many2one('product.product', 'Semi-Finished Product'),
+ 'semi_prod_qty': fields.function(_compute_qty, string='Product Qty', method=True, type='float',
+ store={'mrp.production.operation': (lambda self, cr, uid, ids, c={}: ids, None, 20)}, digits=(16, 2)),
+ 'semi_prod_uom': fields.many2one('product.uom', 'Product UOM'),
+ 'semi_prod_qty_fact': fields.float('Quantity Factor', size = 64, digits=(16, 2)),
+ 'operation_id': fields.many2one('mrp.operation', 'Operation', required=True),
+ 'location_id': fields.many2one('stock.location', 'Operation Location', required= True, domain=[('usage','in',('internal', 'supplier'))]),
+ 'workcenter_id': fields.many2one('mrp.workcenter', 'Work Center', required=True),
+ 'production_id': fields.many2one('mrp.production', 'Work Order', required=True),
+ 'capacity_per_cycle': fields.float('Capacity per Cycle', digits=(16, 2)),
+ 'time_efficiency' : fields.float('Efficiency factor', required=True, digits=(16, 2)),
+ 'time_cycle': fields.float('Time for 1 cycle (hour)', help="Time in hours for doing one cycle of the material.", digits=(16, 2)),
+ 'time_start': fields.float('Time before prod.', help="Time in hours for the setup for the material.", digits=(16, 2)),
+ 'time_stop': fields.float('Time after prod.', help="Time in hours for the cleaning.", digits=(16, 2)),
+ 'costs_hour': fields.float('Cost per hour', help="Specify Cost of Workcenter per hour when using this material.", digits=(16, 2)),
+ 'costs_cycle': fields.float('Cost per cycle', help="Specify Cost of Workcenter per cycle when using this material.", digits=(16, 2)),
+ 'cycle': fields.function(_calculate_time, string='Nº Cycles', method=True, type='float',
+ store={'mrp.production.operation': (lambda self, cr, uid, ids, c={}: ids, None, 20)}, multi="All", digits=(16, 2)),
+ 'hour': fields.function(_calculate_time, string='Nº Hour', method=True, type='float',
+ store={'mrp.production.operation': (lambda self, cr, uid, ids, c={}: ids, None, 20)}, multi="All", digits=(16, 2)),
+ 'final_products_ids': fields.one2many('mrp.production.final.product', 'mrp_production_operation_id', 'Final products'),
+ 'components_used_ids': fields.one2many('mrp.production.product.line', 'mrp_production_operation_id', 'Components used'),
+ 'type':fields.selection([('fixed','Fixed'),('variable','Variable')],'Type'),
+
+
+ }
+
+ _defaults = {
+ 'sequence': lambda *a: 1,
+ 'semi_prod_qty_fact': lambda *a: 1,
+ 'time_efficiency': lambda *a: 0,
+ 'cycle': lambda *a: 1.0,
+ 'hour': lambda *a: 0.0,
+ 'type': lambda *a: 'variable',
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ res = super(mrp_production_operation, self).default_get(cr, uid, fields, context)
+ if 'name' in context.keys():
+ production_id = self.pool.get('mrp.production').search(cr, uid, [('name', '=', context['name'])])[0]
+ res.update({'production_id': production_id})
+ return res
+
+ def wc_onchange(self, cr, uid, ids, workcenter_id, operation_id):
+ value = {}
+ if workcenter_id:
+ wc = self.pool.get('mrp.workcenter').browse(cr, uid, workcenter_id)
+ op = self.pool.get('mrp.operation').browse(cr, uid, operation_id)
+ value['location_id'] = wc.location_id.id
+ value['capacity_per_cycle'] = wc.capacity_per_cycle
+ value['time_efficiency'] = wc.time_efficiency
+ value['time_cycle'] = wc.time_cycle
+ value['time_start'] = wc.time_start
+ value['time_stop'] = wc.time_stop
+ value['costs_hour'] = wc.costs_hour
+ value['costs_cycle'] = wc.costs_cycle
+ value['name'] = '%s -> %s' % (op.name, wc.name)
+ return {'value': value}
+
+ def prod_onchange(self, cr, uid, ids, product_id):
+ value = {}
+ warning = {}
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+ if prod.default_location.usage != 'production':
+ value.update({
+ 'product_id': self.browse(cr, uid, ids[0]).product_id.id,
+ })
+ warning = {
+ 'title': _("Wrong Product"),
+ 'message': _("This is not a valid product. Please, select a product with 'production' location type."),
+ }
+ else:
+ value.update({
+ 'semi_prod_qty_fact': 1,
+ 'semi_prod_uom': prod.product_tmpl_id.uom_id.id or False,
+ })
+ return {'value': value, 'warning': warning}
+
+ def cycle_onchange(self, cr, uid, ids, time_cycle, costs_hour):
+ value = {}
+ costh = costs_hour * time_cycle
+ value['costs_cycle'] = costh
+ return {'value':value}
+
+ def button_dummy(self, cr, uid, ids, *args):
+ self.pool.get('mrp.production.operation').write(cr, uid, ids, {})
+ return True
+mrp_production_operation()
+
+class mrp_production_product_line(osv.osv):
+ _description = 'Production Scheduled Product'
+ _inherit = 'mrp.production.product.line'
+
+ _columns = {
+ 'mrp_production_operation_id': fields.many2one('mrp.production.operation', 'Consumed On'),
+ 'location_id': fields.related('product_id', 'default_location', type='many2one', relation='stock.location', string='Default Location'),
+ }
+
+ _default = {
+ 'product_qty': lambda *a: 1,
+ }
+
+ def prod_onchange(self, cr, uid, ids, product_id):
+ value = {}
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+ value['name'] = prod.name
+ value['product_qty'] = 1
+ value['product_uom'] = prod.product_tmpl_id.uom_id.id or False
+ value['location_id'] = prod.default_location.id
+ return {'value': value}
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ if 'production_id' in context.keys():
+ return {'production_id': context['production_id']}
+ if 'name' in context.keys():
+ production_id = self.pool.get('mrp.production').search(cr, uid, [('name', '=', context['name'])])
+ return {'production_id': production_id}
+ return {}
+mrp_production_product_line()
+
+class mrp_production_final_product(osv.osv):
+ _name = 'mrp.production.final.product'
+ _description = 'Production Scheduled Final Product'
+
+ _columns = {
+ 'name': fields.char('Name', size = 64, required= True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True),
+ 'product_qty': fields.float('Product Qty', required=True, digits=(16, 2)),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, help="UoM (Unit of Measure) is the unit of measurement for the inventory control"),
+ 'mrp_production_operation_id': fields.many2one('mrp.production.operation','Produced On'),
+ 'location_id': fields.related('product_id', 'default_location', type='many2one', relation='stock.location', string='Default Location'),
+ 'production_id': fields.many2one('mrp.production', 'Final Product'),
+ }
+
+ def prod_onchange(self, cr, uid, ids, product_id):
+ value = {}
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+ value['name'] = prod.name
+ value['product_qty'] = 1
+ value['product_uom'] = prod.product_tmpl_id.uom_id.id or False
+ value['location_id'] = prod.default_location.id
+ return {'value': value}
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ if 'production_id' in context.keys():
+ return {'production_id': context['production_id']}
+ if 'name' in context.keys():
+ production_id = self.pool.get('mrp.production').search(cr, uid, [('name', '=', context['name'])])
+ return {'production_id': production_id}
+ return {}
+
+mrp_production_final_product()
+
+class mrp_production_users(osv.osv):
+ _name = 'mrp.production.users'
+
+ def delete_it(self, cr, uid, ids, context=None):
+ self.unlink(cr, uid,ids, context=context)
+ return False
+
+ _columns = {
+ 'name': fields.many2one('res.users','User'),
+ 'op': fields.many2one('mrp.production.operation','Operation'),
+ 'prod': fields.many2one('mrp.production','Production'),
+ 'percent': fields.float('% Estimated', digits=(16, 2)),
+ 'est_time':fields.float('Time Estimated', digits=(16, 2)),
+ }
+
+ _default= {
+ 'percent': 0
+ }
+
+ def name_get(self, cr, uid, ids, context=None):
+ if not ids:
+ return []
+ result = []
+ for line in self.browse(cr, uid, ids, context=context):
+ if line.name:
+ result.append((line.id, (line.name.name or '')))
+ else:
+ result.append((line.id, line.name))
+ return result
+
+
+mrp_production_users()
+
+class mrp_production(osv.osv):
+ _inherit = "mrp.production"
+ _columns = {
+ 'bom_id': fields.many2one('mrp.bom', 'Bill of Material', readonly=True, states={'draft': [('readonly', False)]}, domain=[('bom_id','=',False)]),
+ 'routing_id': fields.many2one('mrp.routing', 'Routing', on_delete='set null', readonly=True, help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production plannification."),
+ 'production_operation_ids': fields.one2many('mrp.production.operation', 'production_id', 'Production Operations', readonly=True, states={'draft': [('readonly', False)]}),
+ 'product_lines': fields.one2many('mrp.production.product.line', 'production_id', 'Scheduled goods', readonly=True, states={'draft': [('readonly', False)]}),
+ 'production_final_product_ids': fields.one2many('mrp.production.final.product', 'production_id', 'Production Final Products', readonly=True, states={'draft': [('readonly', False)]}),
+ 'user_ops': fields.one2many('mrp.production.users', 'prod', 'Users asignments', readonly=True, states={'draft': [('readonly', False)]}),
+ 'product_def_loc': fields.many2one('stock.location', 'Default Location', required=True, readonly=True, states={'draft': [('readonly', False)]}, help='Default real location of the product'),
+ 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=False,),
+ 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=False,),
+ 'fixed_costs':fields.one2many('mrp.fixed.cost','production_id','Fixed costs'),
+ 'company_id': fields.many2one('res.company', 'Company'),
+ }
+
+ _defaults = {
+ 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.routing', context=context)
+ }
+
+ def write(self, cr, uid, ids, vals, context=None):
+ res = {}
+ if 'bom_id' in vals:
+ for order in self.browse(cr, uid, ids):
+ if vals['bom_id']:
+ bom_id = self.pool.get('mrp.bom').browse(cr, uid, vals['bom_id'])
+ vals.update({'routing_id': bom_id.routing_id.id})
+ else:
+ del vals['bom_id']
+ res = super(mrp_production, self).write(cr, uid, ids, vals, context)
+ else:
+ res = super(mrp_production, self).write(cr, uid, ids, vals, context)
+ return res
+
+ def create(self, cr, uid, vals, context={}):
+
+ if 'bom_id' in vals:
+ if not 'product_def_loc' in vals:
+ prod = self.pool.get('product.product').browse(cr, uid, vals['product_id'])
+ vals.update({'product_def_loc': prod.default_location.id})
+ if vals['bom_id']:
+ bom_id = self.pool.get('mrp.bom').browse(cr, uid, vals['bom_id'])
+ vals.update({'routing_id': bom_id.routing_id.id})
+ else:
+ del vals['bom_id']
+ res = super(mrp_production, self).create(cr, uid, vals, context)
+ else:
+ res = super(mrp_production, self).create(cr, uid, vals, context)
+ return res
+
+ def onchange_bom(self, cr, uid, ids, bom_id, context=None):
+ val = {}
+ if bom_id:
+ bom = self.pool.get('mrp.bom').browse(cr, uid, bom_id)
+ val = {
+ 'routing_id': bom.routing_id.id
+ }
+ return {'value': val}
+
+ def product_id_change_inh(self, cr, uid, ids, product_id, context=None):
+ value = super(mrp_production, self).product_id_change(cr, uid, ids, product_id, context=None)
+ val = value['value']
+ if product_id:
+ prod = self.pool.get('product.product').browse(cr, uid, product_id)
+ val['product_def_loc'] = prod.default_location.id
+ return {'value': val}
+
+ def do_full_move_consume(self, cr, uid, ids, context=None):
+ objs = self.pool.get('mrp.production').browse(cr , uid, ids)
+ con_prod = []
+ for obj in objs:
+ for prod in obj.move_lines:
+ con_prod.append(prod.id)
+ for prod_id in con_prod:
+ if context is None:
+ context = {}
+ move_obj = self.pool.get('stock.move')
+ line = self.pool.get('stock.move').browse(cr , uid, prod_id)
+ prod_qty = line.product_qty
+ prod_loc = line.location_id
+ move_obj.action_consume(cr, uid, [prod_id] ,prod_qty,prod_loc.id,context=context)
+ return True
+
+ def do_full_produce(self, cr, uid, ids, context=None):
+ objs = self.pool.get('mrp.production').browse(cr , uid, ids)
+ con_prod = []
+ for obj in objs:
+ for prod in obj.move_created_ids:
+ con_prod.append(prod.id)
+ for prod_id in con_prod:
+ if context is None:
+ context = {}
+ move_obj = self.pool.get('stock.move')
+ line = self.pool.get('stock.move').browse(cr , uid, prod_id)
+ prod_qty = line.product_qty
+ prod_loc = line.location_id
+ move_obj.action_consume(cr, uid, [prod_id] ,prod_qty,prod_loc.id,context=context)
+ return True
+
+
+
+ def action_compute(self, cr, uid, ids, properties=[]):
+ """ Computes bills of material of a product.
+ @param properties: List containing dictionaries of properties.
+ @return: No. of products.
+ """
+ results = []
+ bom_obj = self.pool.get('mrp.bom')
+ prod_line_obj = self.pool.get('mrp.production.product.line')
+ operation_line_obj = self.pool.get('mrp.production.operation')
+ user_obj = self.pool.get('mrp.production.users')
+ final_product_obj = self.pool.get('mrp.production.final.product')
+ for production in self.browse(cr, uid, ids):
+ prod_line_obj.unlink(cr, uid, prod_line_obj.search(cr, uid, [('production_id', '=', production.id)]))
+ operation_line_obj.unlink(cr, uid, operation_line_obj.search(cr, uid, [('production_id', '=', production.id)]))
+ final_product_obj.unlink(cr, uid, final_product_obj.search(cr, uid, [('production_id', '=', production.id)]))
+
+ bom_point = production.bom_id
+ bom_id = production.bom_id.id
+ if not bom_point:
+ bom_id = bom_obj._bom_find(cr, uid, production.product_id.id, production.product_uom.id, properties)
+ if bom_id:
+ bom_point = bom_obj.browse(cr, uid, bom_id)
+ routing_id = bom_point.routing_id.id or False
+ self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
+
+ if not bom_id:
+ raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
+
+ factor = production.product_qty * production.product_uom.factor / bom_point.product_uom.factor
+
+ res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
+
+ fix_obj = self.pool.get('mrp.fixed.cost')
+
+ for del_it in production.fixed_costs:
+ context = {'borrar':True}
+ fix_obj.unlink(cr, uid, del_it.id, context=context)
+
+ for aux in bom_point.fixed_costs:
+ values = {
+ 'name':aux.name,
+ 'amount':aux.amount,
+ 'production_id':production.id,
+ 'estimated':aux.amount
+ }
+ fix_obj.create(cr, uid, values)
+
+ for user in user_obj.search(cr, uid, [('prod', '=', production.id)]):
+ user_obj.unlink(cr, uid, user)
+ for line in res:
+ line['production_id'] = production.id
+ line_products = line['products']
+ del line['products']
+ line_finals = line['finals']
+ del line['finals']
+ operation_id = operation_line_obj.create(cr, uid, line)
+ for component in line_products:
+ component['mrp_production_operation_id'] = operation_id
+ component['production_id'] = production.id
+ prod_line_obj.create(cr, uid, component)
+ for final_prod in line_finals:
+ final_prod['mrp_production_operation_id'] = operation_id
+ final_prod['production_id'] = production.id
+ final_product_obj.create(cr, uid, final_prod)
+ self.create_operator(cr, uid, operation_line_obj.browse(cr, uid, operation_id))
+ return len(results)
+
+ def action_confirm(self, cr, uid, ids):
+ """ Confirms production order.
+ @return: Newly generated picking Id.
+ """
+ res_final_ids = []
+ picking_id = False
+ proc_ids = []
+ move_obj = self.pool.get('stock.move')
+ proc_obj = self.pool.get('procurement.order')
+ wf_service = netsvc.LocalService("workflow")
+ for production in self.browse(cr, uid, ids):
+ if not production.product_lines:
+ self.action_compute(cr, uid, [production.id])
+ production = self.browse(cr, uid, [production.id])[0]
+ pick_type = 'internal'
+ moves = []
+ for i in range(len(production.production_operation_ids)):
+ move_id = False
+ next_operation = False
+ newdate = production.date_planned
+ operation = production.production_operation_ids[i]
+ if i < len(production.production_operation_ids)-1:
+ next_operation = production.production_operation_ids[i+1]
+ for line in operation.final_products_ids:
+ if not line.product_id.default_location:
+ raise osv.except_osv(_('Product Default Location'), _('All final products must have a default location !'))
+ for line in operation.components_used_ids:
+ if not line.product_id.default_location:
+ raise osv.except_osv(_('Product Default Location'), _('All components must have a default location !'))
+ if not production.product_id.default_location:
+ raise osv.except_osv(_('Product Default Location'), _('All final products must have a default location !'))
+ if (next_operation) and (next_operation.location_id.usage == 'supplier') and (not next_operation.location_id.address_id):
+ raise osv.except_osv(_('External Operation'), _('External operation location must be set !'))
+ if (next_operation) and (next_operation.location_id.usage == 'supplier'):
+ picking_id = self.create_picking(cr, uid, 'out', 'direct', production, next_operation)
+ self.create_purchase(cr, uid, next_operation)
+ for line in next_operation.components_used_ids:
+ move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': line.product_id.id,
+ 'picking_id': picking_id,
+ 'product_qty': line.product_qty,
+ 'bom_prop': line.product_qty / production.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'location_id': line.product_id.default_location.id,
+ 'location_dest_id': next_operation.location_id.id,
+ 'state': 'confirmed',
+ 'company_id': production.company_id.id,
+ })
+ proc_id = proc_obj.create(cr, uid, {
+ 'name': (production.origin or '').split(':')[0] + ':' + production.name + '/' + next_operation.name,
+ 'origin': (production.origin or '').split(':')[0] + ':' + production.name + '/' + next_operation.name,
+ 'date_planned': newdate,
+ 'product_id': line.product_id.id,
+ 'product_qty': line.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': line.product_uos and production.product_qty or False,
+ 'product_uos': line.product_uos and production.product_uos.id or False,
+ 'location_id': line.product_id.default_location.id,
+ 'procure_method': line.product_id.procure_method,
+# 'move_id': move_id,
+ 'company_id': production.company_id.id,
+ })
+ wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
+ proc_ids.append(proc_id)
+ move_pick_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ next_operation.name,
+ 'date': production.date_planned,
+ 'picking_id': picking_id,
+ 'product_id': operation.product_id.id,
+ 'product_qty': operation.semi_prod_qty,
+ 'product_uom': operation.product_id.product_tmpl_id.uom_id.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'date': newdate,
+ 'location_id': operation.location_id.id,
+ 'location_dest_id': next_operation.location_id.id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ })
+ data = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': operation.product_id.id,
+ 'product_qty': operation.semi_prod_qty,
+ 'bom_prop': line.product_qty / production.product_qty,
+ 'product_uom': operation.product_id.product_tmpl_id.uom_id.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'date': newdate,
+ 'location_id': operation.product_id.product_tmpl_id.property_stock_production.id,
+ 'location_dest_id': operation.location_id.id,
+ 'move_dest_id': move_pick_id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ 'operation_id': operation.id,
+ })
+ res_final_ids.append(data)
+ wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
+ elif (next_operation) and (next_operation.location_id.usage == 'internal'):
+ if not operation.product_id:
+ raise osv.except_osv(_('Semi-elaborated Product'), _('A semi-elaborated product is missing in the %s operation !') %(operation.name))
+ semi_product_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'product_id': operation.product_id.id,
+ 'product_qty': operation.semi_prod_qty,
+ 'bom_prop': operation.semi_prod_qty / production.product_qty,
+ 'product_uom': operation.product_id.product_tmpl_id.uom_id.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'date': newdate,
+ 'location_id': next_operation.location_id.id or False,
+ 'location_dest_id': operation.product_id.product_tmpl_id.property_stock_production.id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ 'operation_id': next_operation.id or False,
+ })
+ moves.append(semi_product_id)
+ if not operation.location_id.usage == 'supplier':
+ data = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': operation.product_id.id,
+ 'product_qty': operation.semi_prod_qty,
+ 'bom_prop': operation.semi_prod_qty / production.product_qty,
+ 'product_uom': operation.product_id.product_tmpl_id.uom_id.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'date': newdate,
+ 'location_id': operation.product_id.product_tmpl_id.property_stock_production.id,
+ 'location_dest_id': next_operation.location_id.id,
+ 'move_dest_id': semi_product_id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ 'operation_id': operation.id,
+ })
+ res_final_ids.append(data)
+ if operation.location_id.usage == 'supplier':
+ picking_id = self.create_picking(cr, uid, 'in', 'direct', production, operation)
+ move_pick_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'picking_id': picking_id,
+ 'product_id': operation.product_id.id,
+ 'product_qty': operation.semi_prod_qty,
+ 'product_uom': operation.product_id.product_tmpl_id.uom_id.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'date': newdate,
+ 'location_id': operation.location_id.id,
+ 'location_dest_id': next_operation.location_id.id,
+ 'move_dest_id': semi_product_id,
+ 'state': 'draft',
+ 'company_id': production.company_id.id,
+ })
+ wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
+ else:
+ if operation.components_used_ids:
+ picking_id = self.create_picking(cr, uid, pick_type, 'direct', production, operation, 'input')
+ for line in operation.components_used_ids:
+ if line.product_id.type in ('product', 'consu'):
+ move_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': line.product_id.id,
+ 'product_qty': line.product_qty,
+ 'bom_prop': line.product_qty / production.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': line.product_uos and line.product_uos_qty or False,
+ 'product_uos': line.product_uos and line.product_uos.id or False,
+ 'location_id': operation.location_id.id,
+ 'location_dest_id': line.product_id.product_tmpl_id.property_stock_production.id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ 'operation_id': operation.id,
+ })
+ moves.append(move_id)
+ move_pick_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': line.product_id.id,
+ 'picking_id': picking_id,
+ 'product_qty': line.product_qty,
+ 'bom_prop': line.product_qty / production.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': line.product_uos and line.product_uos_qty or False,
+ 'product_uos': line.product_uos and line.product_uos.id or False,
+ 'location_id': line.product_id.default_location.id,
+ 'location_dest_id': operation.location_id.id,
+ 'move_dest_id': move_id,
+ 'state': 'confirmed',
+ 'company_id': production.company_id.id,
+ })
+ wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
+ ##TODO: Create procurements for each consumed product
+ proc_id = proc_obj.create(cr, uid, {
+ 'name': (production.origin or '').split(':')[0] + ':' + production.name + '/' + operation.name,
+ 'origin': (production.origin or '').split(':')[0] + ':' + production.name + '/' + operation.name,
+ 'date_planned': newdate,
+ 'product_id': line.product_id.id,
+ 'product_qty': line.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': line.product_uos and production.product_qty or False,
+ 'product_uos': line.product_uos and production.product_uos.id or False,
+ 'location_id': line.product_id.default_location.id,
+ 'procure_method': line.product_id.procure_method,
+# 'move_id': move_id,
+ 'company_id': production.company_id.id,
+ })
+ wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
+ proc_ids.append(proc_id)
+ if operation.final_products_ids:
+ picking_id = self.create_picking(cr, uid, pick_type, 'direct', production, operation, 'output')
+ for line in operation.final_products_ids:
+ move_pick_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': line.product_id.id,
+ 'picking_id': picking_id,
+ 'product_qty': line.product_qty,
+ 'bom_prop': line.product_qty / production.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'location_id': operation.location_id.id,
+ 'location_dest_id': line.product_id.default_location.id,
+ 'state': 'confirmed',
+ 'company_id': production.company_id.id,
+ })
+ data = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': line.product_id.id,
+ 'product_qty': line.product_qty,
+ 'bom_prop': line.product_qty / production.product_qty,
+ 'product_uom': line.product_uom.id,
+ 'product_uos_qty': False,
+ 'product_uos': False,
+ 'location_id': line.product_id.product_tmpl_id.property_stock_production.id,
+ 'location_dest_id': operation.location_id.id,
+# 'move_dest_id': move_pick_id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ 'operation_id': operation.id,
+ })
+ res_final_ids.append(data)
+ wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
+ if not next_operation:
+ if not operation.final_products_ids:
+ picking_id = self.create_picking(cr, uid, pick_type, 'direct', production, operation, 'output')
+ move_pick_id = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'picking_id': picking_id,
+ 'product_id': production.product_id.id,
+ 'product_qty': production.product_qty,
+ 'product_uom': production.product_uom.id,
+ 'product_uos_qty': production.product_uos and production.product_uos_qty or False,
+ 'product_uos': production.product_uos and production.product_uos.id or False,
+ 'location_id': operation.location_id.id,
+ 'location_dest_id': production.product_id.default_location.id,
+ 'state': 'confirmed',
+ 'company_id': production.company_id.id,
+ })
+ wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
+ product_bom = move_obj.create(cr, uid, {
+ 'name':'PROD:' + production.name + '/'+ operation.name,
+ 'date': production.date_planned,
+ 'product_id': production.product_id.id,
+ 'product_qty': production.product_qty,
+ 'product_uom': production.product_uom.id,
+ 'product_uos_qty': production.product_uos and production.product_uos_qty or False,
+ 'product_uos': production.product_uos and production.product_uos.id or False,
+ 'location_id': production.product_id.product_tmpl_id.property_stock_production.id,
+ 'location_dest_id': operation.location_id.id,
+# 'move_dest_id': move_pick_id,
+ 'state': 'waiting',
+ 'company_id': production.company_id.id,
+ 'operation_id': operation.id,
+ })
+ res_final_ids.append(product_bom)
+ self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, res_final_ids)]})
+
+ self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6, 0, moves)], 'state':'confirmed'})
+ message = _("Manufacturing order '%s' is scheduled for the %s.") % (
+ production.name,
+ datetime.strptime(production.date_planned,'%Y-%m-%d %H:%M:%S').strftime('%m/%d/%Y'),
+ )
+ self.log(cr, uid, production.id, message)
+
+ return True
+
+ def create_picking(self, cr, uid, pick_type, move_type, production, operation, internal_type=False):
+ pick_obj = self.pool.get('stock.picking')
+ seq_obj = self.pool.get('ir.sequence')
+ pick_name = seq_obj.get(cr, uid, 'stock.picking.' + pick_type)
+ picking_id = pick_obj.create(cr, uid, {
+ 'name': pick_name,
+ 'origin': (production.origin or '').split(':')[0] + ':' + production.name + '/' + operation.name,
+ 'type': pick_type,
+ 'move_type': move_type,
+ 'address_id': operation.location_id.address_id.id,
+ 'internal_type': internal_type,
+ 'state': 'confirmed',
+ 'company_id': production.company_id.id,
+ })
+ return picking_id
+
+ def create_purchase(self, cr, uid, next_operation):
+ po_obj = self.pool.get('purchase.order')
+ po_lines_obj =self.pool.get('purchase.order.line')
+ notes = ''
+
+ notes += _('Products delivered:') + '\n\n'
+ for prod in next_operation.components_used_ids:
+ notes += prod.name + ' ' + str(prod.product_qty) + ' ' + prod.product_uom.name + '\n'
+ notes += next_operation.product_id.name + ' ' + str(next_operation.semi_prod_qty) + ' ' + next_operation.semi_prod_uom.name
+
+ po_id = po_obj.create(cr, uid, {
+ 'origin': next_operation.production_id.name + '/' + next_operation.name,
+ 'partner_id': next_operation.location_id.address_id.partner_id.id,
+ 'partner_address_id': next_operation.location_id.address_id.partner_id.address[0].id,
+ 'location_id': next_operation.location_id.id,
+ 'pricelist_id': next_operation.location_id.address_id.partner_id.property_product_pricelist_purchase.id,
+ 'notes': notes,
+ 'state': 'draft',
+ })
+
+
+ if not next_operation.workcenter_id.product_id:
+ raise osv.except_osv(_('User error'), _('There is no product assigned for the external workcenter !'))
+
+ seller_delay = 0
+ if next_operation.workcenter_id.product_id.seller_ids:
+ for s in next_operation.workcenter_id.product_id.seller_ids:
+ if s.name.id == next_operation.location_id.address_id.partner_id:
+ seller_delay = s.delay
+
+ po_lines_obj.create(cr, uid, {
+ 'name': next_operation.workcenter_id.product_id.name,
+ 'product_id': next_operation.workcenter_id.product_id.id,
+ 'product_uom': next_operation.workcenter_id.product_id.uom_id.id,
+ 'product_qty': next_operation.semi_prod_qty,
+ 'price_unit': next_operation.workcenter_id.product_id.standard_price,
+ 'date_planned': (datetime.now() + relativedelta(days=int(seller_delay) or 0.0)).strftime('%Y-%m-%d %H:%M:%S'),
+ 'order_id': po_id,
+ })
+ return True
+
+ def create_operator(self, cr, uid, operation):
+ user_obj = self.pool.get('mrp.production.users')
+ for user in operation.workcenter_id.user_ids:
+ user_obj.create(cr, uid, {
+ 'name': user.id,
+ 'op': operation.id,
+ 'prod': operation.production_id.id,
+ 'percent': 100,
+ })
+ return True
+mrp_production()
=== added file 'mrp_master_extension/mrp_production_view.xml'
--- mrp_master_extension/mrp_production_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_production_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ Inherit Production Tree View
+ -->
+
+ <record id="mrp_production_tree_view_inh" model="ir.ui.view">
+ <field name="name">mrp.production.tree.inh</field>
+ <field name="model">mrp.production</field>
+ <field name="type">tree</field>
+ <field name="inherit_id" ref="mrp.mrp_production_tree_view" />
+ <field name="arch" type="xml">
+ <field name="state" position="after">
+ <field name="company_id"/>
+ </field>
+ </field>
+ </record>
+
+ <!--
+ Inherit Production Form View
+ -->
+
+ <record id="mrp_production_inherit_form_view" model="ir.ui.view">
+ <field name="name">mrp.production.inherit.form</field>
+ <field name="model">mrp.production</field>
+ <field name="inherit_id" ref="mrp.mrp_production_form_view" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/group/field[@name='product_uos']" position="after">
+ <field name="product_def_loc" domain="[('usage','=','internal')]" />
+ <newline/>
+ <field name="company_id" />
+ </xpath>
+ <xpath expr="/form/group/button[@string='Change Qty']" position="replace">
+ </xpath>
+ <xpath expr="/form/group/field[@name='product_id']" position="replace">
+ <field name="product_id" on_change="product_id_change_inh(product_id)" />
+ </xpath>
+ <xpath expr="/form/group/label[@string='']" position="replace">
+ <newline/>
+ </xpath>
+ <xpath expr="/form/notebook/page/field[@name='bom_id']"
+ position="replace" />
+ <xpath expr="/form/notebook/page/field[@name='routing_id']"
+ position="replace" />
+ <xpath expr="/form/notebook/page/field[@name='location_src_id']"
+ position="replace" />
+ <xpath expr="/form/notebook/page/field[@name='location_dest_id']"
+ position="replace" />
+ <xpath expr="/form/notebook/page/separator" position="replace" />
+ <xpath
+ expr="/form/notebook/page/field/tree[@string='Products to Consume']/field[@name='state']"
+ position="replace">
+ <field name="location_dest_id" readonly="1" string="Destination Loc."
+ widget="selection" />
+ <field name="state" />
+ </xpath>
+ <xpath
+ expr="/form/notebook/page/field/tree[@string='Products to Consume']/button[@string='Consume Products']"
+ position="replace">
+ <button name="%(stock.move_consume)d"
+ string="Consume Products" type="action"
+ icon="gtk-go-forward" context="{'consume': True}"
+ states="assigned" />
+ </xpath>
+ <xpath
+ expr="/form/notebook/page/field/tree[@string='Consumed Products']/field[@name='state']"
+ position="replace">
+ <field name="location_dest_id" readonly="1" string="Destination Loc."
+ widget="selection" />
+ <field name="state" />
+ </xpath>
+ <xpath
+ expr="/form/notebook/page/field/tree[@string='Products to Finish']/field[@name='state']"
+ position="replace">
+ <field name="location_dest_id" readonly="1" string="Destination Loc."
+ widget="selection" />
+ <field name="state" />
+ </xpath>
+ <xpath
+ expr="/form/notebook/page/field/tree[@string='Finished Products']/field[@name='state']"
+ position="replace">
+ <field name="location_dest_id" readonly="1" string="Destination Loc."
+ widget="selection" />
+ <field name="state" />
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Consumed Products']/separator"
+ position="replace">
+ <newline />
+ <button name="%(action_partial_product_picking)d" string="Consume wizard"
+ colspan="2" type="action" icon="gtk-ok" />
+ <button name="do_full_move_consume" string="Consume all"
+ colspan="2" type="object" icon="gtk-ok" />
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Consumed Products']/group"
+ position="replace" />
+ <xpath expr="/form/notebook/page/field[@name='move_created_ids2']"
+ position="after">
+ <newline />
+ <button name="%(action_partial_production_picking)d"
+ string="Produce wizard" colspan="2" type="action" icon="gtk-ok" />
+ <button name="do_full_produce" string="Produce all"
+ colspan="2" type="object" icon="gtk-ok" />
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Work Orders']"
+ position="replace" />
+ <xpath expr="/form/notebook/page[@string='Scheduled Products']"
+ position="replace" />
+ <xpath expr="/form/notebook/page[@string='Consumed Products']"
+ position="before">
+ <page string="Scheduled Operations">
+ <field name="production_operation_ids" nolabel="1" colspan="4" default_get="{'name': name}"/>
+ </page>
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Scheduled Operations']"
+ position="after">
+ <page string="Scheduled Products">
+ <field colspan="4" name="product_lines" nolabel="1" default_get="{'name': name}"/>
+ <newline />
+ <field colspan="4" name="production_final_product_ids"
+ nolabel="1" default_get="{'name': name}"/>
+ </page>
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Scheduled Products']"
+ position="after">
+ <page string="Operator Assignment">
+ <field name="user_ops" nolabel="1" widget="one2many_list"
+ readonly="1" colspan="4">
+ <tree string="Operator List">
+ <field name="name" />
+ <field name="op" />
+ <field name="percent" />
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='Extra Information']"
+ position="before">
+ <page string="Fixed costs">
+ <field name="fixed_costs" nolabel="1" widget="one2many_list">
+ <tree string="" editable="true">
+ <field name="created" invisible="1" />
+ <field name="name" width="700"/>
+ <field name="amount" width="100" sum="Total"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ <xpath expr="/form/notebook" position="after">
+ <group col="9" colspan="4">
+ <field name="bom_id" on_change="onchange_bom(bom_id)"/>
+ <field name="routing_id" />
+ <button name="%(action_new_production_user)d" states="draft,ready,confirmed,in_production"
+ string="Add Operator" type="action" icon="terp-stock_zoom" />
+ <button name="action_compute" states="draft" string="Compute Data"
+ type="object" icon="terp-stock_format-scientific" />
+ <newline />
+ <field name="state" colspan="4" />
+ <button name="button_cancel"
+ states="draft,ready,confirmed,in_production,picking_except"
+ string="Cancel" icon="gtk-stop" />
+ <button name="button_confirm" states="draft" string="Confirm Production"
+ icon="gtk-apply" />
+ <button name="button_produce" states="ready" string="Start Production"
+ icon="terp-gtk-jump-to-ltr" />
+ <button name="%(mrp.act_mrp_product_produce)d" states="in_production"
+ string="Produce" icon="gtk-ok" type="action" />
+ <button name="force_production" states="confirmed,picking_except"
+ string="Force Reservation" type="object" icon="gtk-jump-to" />
+ <button name="button_recreate" states="picking_except"
+ string="Recreate Picking" icon="terp-document-new" />
+ </group>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <!--
+ Production Search Inheritance
+ -->
+
+ <record id="view_mrp_production_filter_inh" model="ir.ui.view">
+ <field name="name">mrp.production.select.inh</field>
+ <field name="model">mrp.production</field>
+ <field name="type">search</field>
+ <field name="inherit_id" ref="mrp.view_mrp_production_filter" />
+ <field name="arch" type="xml">
+ <xpath expr="/search/group/field[@name='origin']"
+ position="after">
+ <field name="company_id" />
+ </xpath>
+ </field>
+ </record>
+
+ <!--
+ Production Operation
+ -->
+
+ <record id="mrp_production_operation_tree_view" model="ir.ui.view">
+ <field name="name">mrp.production.operation.tree</field>
+ <field name="model">mrp.production.operation</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Production Operation Lines">
+ <field name="sequence" />
+ <field name="operation_id" />
+ <field name="workcenter_id" />
+ <field name="product_id" />
+ <field name="semi_prod_qty" />
+ <field name="semi_prod_uom" />
+ <field name="location_id" />
+ <field name="cycle" />
+ <field name="hour" widget="float_time" />
+ <button name="%(action_new_production_user_op)d" string="Add Operator"
+ type="action" icon="terp-personal" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="mrp_production_operation_view" model="ir.ui.view">
+ <field name="name">mrp.production.operation.form</field>
+ <field name="model">mrp.production.operation</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Production Operation">
+ <group col="4" colspan="4">
+ <field name="name" invisible="1" />
+ <field name="sequence" />
+ <field name="operation_id" />
+ <field name="workcenter_id" domain="[('mrp_op_ids', 'in', [operation_id])]"
+ on_change="wc_onchange(workcenter_id,operation_id)"/>
+ <field name="location_id" />
+ <field name="production_id" invisible="1" />
+ </group>
+ <notebook colspan="4">
+ <page string="Product Information">
+ <group col="4" colspan="4">
+ <separator string="Semi Product" colspan="4" />
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="semi_prod_uom" />
+ <field name="semi_prod_qty" />
+ <field name="semi_prod_qty_fact" />
+ <field name="type" />
+ <label string="" colspan="1" />
+ <button name="button_dummy" string="Calculate" type="object"
+ icon="gtk-ok" />
+ </group>
+ <group col="4" colspan="4">
+ <field colspan="4" name="components_used_ids" nolabel="1"
+ default_get="{'production_id': production_id}">
+ <tree string="Scheduled Products" editable="bottom">
+ <field name="name" invisible="1" />
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" required="1" />
+ <field name="product_uos_qty" groups="product.group_uos" />
+ <field name="product_uos" groups="product.group_uos" />
+ <field name="production_id" invisible="1" />
+ </tree>
+ </field>
+ <newline />
+ <field colspan="4" name="final_products_ids" nolabel="1"
+ default_get="{'production_id': production_id}">
+ <tree string="Products to Produce" editable="bottom">
+ <field name="name" invisible="1" />
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" required="1" />
+ <field name="production_id" invisible="1" />
+ </tree>
+ </field>
+ </group>
+ </page>
+ <page string="Properties">
+ <group col="2" colspan="2">
+ <separator string="Capacity Information" colspan="4" />
+ <field name="time_efficiency" />
+ <field name="capacity_per_cycle" />
+ <field name="time_cycle" widget="float_time" on_change="cycle_onchange(time_cycle, costs_hour)"/>
+ <field name="time_start" widget="float_time" />
+ <field name="time_stop" widget="float_time" />
+ </group>
+ <group col="2" colspan="2">
+ <separator string="Costing Information" colspan="4" />
+ <field name="costs_hour" on_change="cycle_onchange(time_cycle, costs_hour)"/>
+ <field name="costs_cycle" />
+ </group>
+ <group colspan="4">
+ <separator string="Estimated Information" colspan="4" />
+ <field name="cycle" />
+ <field name="hour" widget="float_time" />
+ <label string="" colspan="3" />
+ <button name="button_dummy" states="draft" string="Calculate"
+ type="object" icon="gtk-ok" />
+ </group>
+ </page>
+ <page string="Notes">
+ <separator colspan="4" string="Description" />
+ <field colspan="4" name="descript" nolabel="1" />
+ </page>
+ </notebook>
+ </form>
+ </field>
+ </record>
+
+ <!--
+ Production Product Line
+ -->
+
+ <record id="mrp_production_product_line_form_view" model="ir.ui.view">
+ <field name="name">mrp.production.product.line.form</field>
+ <field name="model">mrp.production.product.line</field>
+ <field name="inherit_id" ref="mrp.mrp_production_product_form_view" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/field[@name='name']" position="replace">
+ <field name="name" invisible="1" />
+ </xpath>
+ <xpath expr="/form/field[@name='product_id']" position="replace">
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ </xpath>
+ <xpath expr="/form/field[@name='product_uos']" position="after">
+ <field name="production_id" invisible="1" />
+ <field name="mrp_production_operation_id" domain="[('production_id', '=', production_id)]" />
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <record id="mrp_production_product_line_tree_view" model="ir.ui.view">
+ <field name="name">mrp.production.product.line.tree</field>
+ <field name="model">mrp.production.product.line</field>
+ <field name="inherit_id" ref="mrp.mrp_production_product_tree_view" />
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <xpath expr="/tree" position="replace">
+ <tree string="Scheduled Products" editable="bottom">
+ <field name="name" invisible="1" />
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="mrp_production_operation_id" domain="[('production_id', '=', production_id)]" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" required="1" />
+ <field name="product_uos_qty" groups="product.group_uos" />
+ <field name="product_uos" groups="product.group_uos" />
+ <field name="production_id" invisible="1" />
+ </tree>
+ </xpath>
+ </field>
+ </record>
+
+ <!--
+ Production Final Product Line
+ -->
+
+ <record id="mrp_production_final_product_tree_view" model="ir.ui.view">
+ <field name="name">mrp.production.final.product.tree</field>
+ <field name="model">mrp.production.final.product</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Products to Produce" editable="bottom">
+ <field name="name" invisible="1" />
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="mrp_production_operation_id" domain="[('production_id', '=', production_id)]" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" required="1" />
+ <field name="production_id" invisible="1" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="mrp_production_final_product_form_view" model="ir.ui.view">
+ <field name="name">mrp.production.final.product.form</field>
+ <field name="model">mrp.production.final.product</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Scheduled Final Products">
+ <field name="name" invisible="1" />
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="product_qty" />
+ <field name="product_uom" />
+ <field name="location_id" required="1" />
+ <field name="production_id" invisible="1" />
+ <field name="mrp_production_operation_id" domain="[('production_id', '=', production_id)]" />
+ </form>
+ </field>
+ </record>
+
+
+
+ </data>
+</openerp>
=== added file 'mrp_master_extension/mrp_routing.py'
--- mrp_master_extension/mrp_routing.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_routing.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,96 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+
+class routing_fixed_cost(osv.osv):
+ _name = 'routing.fixed.cost'
+ _description = 'Routing fixed costs'
+ _columns = {
+ 'name':fields.char('Description', size = 256),
+ 'amount':fields.float('Ammount', digits=(16, 2)),
+ 'estimated':fields.float('Estimated amount', digits=(16, 2)),
+ 'routing_id':fields.many2one('mrp.routing','Routing')
+ }
+routing_fixed_cost()
+
+
+class mrp_routing(osv.osv):
+ _description = 'Routing'
+ _inherit = 'mrp.routing'
+
+ _columns = {
+ 'routing_line_ids': fields.one2many('mrp.production.workcenter.line', 'routing_id', 'Operations', required= True),
+ 'fixed_costs':fields.one2many('routing.fixed.cost','routing_id','Fixed costs'),
+ }
+
+mrp_routing()
+
+
+# The name of this class has to be changed!! This class is not related with production but routing.
+class mrp_production_workcenter_line(osv.osv):
+ _inherit='mrp.production.workcenter.line'
+ _description = 'Work Order'
+
+ _columns = {
+ 'name': fields.char('Code', size= 64),
+ 'descript': fields.text('Description', size = 64),
+ 'operation_id': fields.many2one('mrp.operation', 'Operation', required=True),
+ 'production_id': fields.many2one('mrp.production', 'Production Order', select=True),
+ 'location_id': fields.many2one('stock.location', 'Operation Location', required= True, domain=[('usage','in',('internal','supplier'))]),
+ 'routing_id': fields.many2one('mrp.routing', 'Parent Routing', required=True),
+ 'product_id':fields.many2one('product.product','Semi Product'),
+ 'components':fields.many2many('mrp.bom','routing_bom','routing_id','product_id','Components'),
+ 'description_ids':fields.one2many('mrp.prodcution.worcenter.line.descriptions', 'operation_line_id', 'Descriptions', required=False),
+ }
+ _defaults = {
+ 'hour': lambda *a: 0,
+ 'cycle': lambda *a: 0,
+ }
+
+ def wc_onchange(self, cr, uid, ids, workcenter_id):
+ value = {}
+ if workcenter_id:
+ wc = self.pool.get('mrp.workcenter').browse(cr, uid, workcenter_id)
+ value['location_id'] = wc.location_id.id
+ return {'value': value}
+
+ def opt_onchange(self, cr, uid, ids, operation_id):
+ value = {}
+ if operation_id:
+# dsc = self.pool.get('mrp.operation.description').search(cr,uid,[('operation_id', '=', operation_id)])
+
+ opt = self.pool.get('mrp.operation').browse(cr, uid, operation_id)
+ value['name'] = opt.cod
+ return {'value': value}
+
+mrp_production_workcenter_line()
+
+class mrp_production_worcenter_line_descriptions(osv.osv):
+ _name = 'mrp.production.worcenter.line.descriptions'
+ _description = 'All descriptions for operation lines on routings'
+ _columns = {
+ 'name':fields.char('Std Description', size=64, required=False, readonly=False),
+ 'sequence': fields.integer('Sequence'),
+ 'operation_line_id':fields.many2one('mrp.production.workcenter.line', 'Operation Line', required=False),
+ }
+mrp_production_worcenter_line_descriptions()
=== added file 'mrp_master_extension/mrp_routing_view.xml'
--- mrp_master_extension/mrp_routing_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_routing_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ Routing
+ -->
+
+ <record id="mrp_routing_inherit_form_op_view" model="ir.ui.view">
+ <field name="name">mrp.routing.form.op.inherit</field>
+ <field name="model">mrp.routing</field>
+ <field name="inherit_id" ref="mrp.mrp_routing_form_view" />
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <xpath expr="/form/notebook/page[@string='Work Center Operations']"
+ position="replace">
+ <page string="Operation Sequence">
+ <field colspan="4" name="routing_line_ids" nolabel="1" />
+ </page>
+ <page string="Fixed Costs">
+ <field name="fixed_costs" nolabel="1" >
+ <tree string="" editable="botton">
+ <field name="name" width="700"/>
+ <field name="amount" width="100" sum="Total"/>
+ </tree>
+ </field>
+ </page>
+ </xpath>
+ </field>
+ </record>
+
+ <!--
+ Operation Line
+ -->
+
+ <record id="mrp_production_workcenter_line_tree_view" model="ir.ui.view">
+ <field name="name">mrp.production.workcenter.line.tree</field>
+ <field name="model">mrp.production.workcenter.line</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Routing Operations">
+ <field name="sequence" />
+ <field name="name" />
+ <field name="operation_id" select="1" />
+ <field name="workcenter_id" select="1" />
+ <field name="location_id" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="mrp_production_workcenter_line_view" model="ir.ui.view">
+ <field name="name">mrp.production.workcenter.line.form</field>
+ <field name="model">mrp.production.workcenter.line</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Routing Operation">
+ <group colspan="4">
+ <field name="sequence" />
+ <field name="name" />
+ <field name="operation_id" select="1"
+ on_change="opt_onchange(operation_id)" />
+ </group>
+ <notebook colspan="4">
+ <page string="General Information">
+<!-- <separator string="Work Center" colspan="4"/>-->
+ <field name="workcenter_id" domain="[('mrp_op_ids', 'in', [operation_id])]" on_change="wc_onchange(workcenter_id)" />
+ <field name="location_id" />
+ <field name="product_id" />
+ <field name="components" widget="one2many_list" nolabel="1" colspan="4">
+ <tree string="Components" editable="bottom">
+ <field name="name" invisible = "1"/>
+ <field name="product_id" on_change="prod_onchange(product_id)" />
+ <field name="product_qty" />
+ <field name="product_uom" invisible = "1"/>
+ </tree>
+ </field>
+ </page>
+
+ <page string="Description">
+ <field name="descript" colspan="4" nolabel="1" />
+ </page>
+ <page string="Standard Descriptions">
+ <field name="description_ids" nolabel="1" />
+ </page>
+ </notebook>
+ </form>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'mrp_master_extension/mrp_workcenter.py'
--- mrp_master_extension/mrp_workcenter.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_workcenter.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,66 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields,osv
+from tools.translate import _
+
+class mrp_workcenter(osv.osv):
+ _description = 'Work Center Inheritance'
+ _inherit = 'mrp.workcenter'
+
+ _columns = {
+ 'location_id': fields.many2one('stock.location', 'Location', required= True, domain=[('usage','in',('internal','supplier'))]),
+ 'purchase_date': fields.date('Purchase Date', size = 32, help = "The machine's purchase date"),
+ 'warranty_date': fields.date('Warranty Date', size = 32, help = "Warranty limit date of the Work Center"),
+ 'maintain_notes': fields.text('Maintain Notes', readonly = False),
+ 'alter_workcenter_ids': fields.many2many('mrp.workcenter','alter_workcenter','parent_workcenter_id','child_workcenter_id','Alternative Work center'),
+ 'mrp_op_ids': fields.many2many('mrp.operation', 'mrp_operations_workcenter', 'workcenter_id', 'operation_id','Operations', domain=[('type','=','mfo')]),
+ 'maintain_op_id': fields.many2one('mrp.operation', 'Maintain Operation', size = 32, domain=[('type','=','mto')]),
+ 'factory_id': fields.many2one('mrp.factory', 'Factory', required= True),
+ 'operations_product_ids': fields.one2many('mrp.bom.operations.product', 'workcenter_id', 'Work Center', required= True),
+ 'user_ids': fields.many2many('res.users', 'mrp_wc_user_rel', 'workcenter_id', 'user_id'),
+ }
+
+ def cycle_onchange(self, cr, uid, ids, time_cycle, costs_hour):
+ value = {}
+ costh = costs_hour * time_cycle
+ value['costs_cycle'] = costh
+ return {'value':value}
+
+ def default_get(self, cr, uid, fields_list, context=None):
+
+ if context == None:
+
+ context = {}
+
+ res = super(mrp_workcenter, self).default_get(cr, uid, fields_list, context)
+
+ if 'factory' in context.keys():
+
+ if context['factory']:
+
+ ids = self.pool.get('mrp.factory').search(cr, uid, [('name', '=', context['factory'])])
+
+ res.update({'factory_id': ids[0]})
+
+ return res
+
+
+mrp_workcenter()
\ No newline at end of file
=== added file 'mrp_master_extension/mrp_workcenter_view.xml'
--- mrp_master_extension/mrp_workcenter_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/mrp_workcenter_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ Work center
+ -->
+
+ <record id="mrp_work_center_master_view" model="ir.ui.view">
+ <field name="name">mrp.work.center.master.form</field>
+ <field name="type">form</field>
+ <field name="model">mrp.workcenter</field>
+ <field name="inherit_id" ref="mrp.mrp_workcenter_view" />
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/group/field[@name='code']"
+ position="replace">
+ <field name="code" select="1" required="1"/>
+ </xpath>
+ <xpath expr="/form/group/field[@name='resource_type']"
+ position="after">
+ <field name="factory_id" />
+ <field name="location_id" />
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='time_cycle']" position="replace">
+ <field name="time_cycle" widget="float_time" on_change="cycle_onchange(time_cycle, costs_hour)"/>
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']/group/field[@name='costs_hour']" position="replace">
+ <field name="costs_hour" on_change="cycle_onchange(time_cycle, costs_hour)"/>
+ </xpath>
+ <xpath expr="/form/notebook/page[@string='General Information']"
+ position="after">
+ <page string="Operations">
+ <separator colspan="4" string="Operation list" />
+ <field name="mrp_op_ids" nolabel="1" />
+ </page>
+ <page string="Alternatives">
+ <separator colspan="4" string="Alternative Work Centers" />
+ <field name="alter_workcenter_ids" nolabel="1" domain = "[('code', '!=', code)]"/>
+ </page>
+ <page string="Operators">
+ <separator colspan="4" string="Possible Operators" />
+ <field name="user_ids" nolabel="1" />
+ </page>
+ <page string="Maintaining">
+ <group col="2" colspan="2">
+ <separator colspan="2" string="Maintain Information" />
+ <field name="purchase_date" />
+ <field name="warranty_date" />
+ <field name="maintain_op_id" />
+ </group>
+ <group col="2" colspan="2">
+ <separator colspan="2" string="Notes" />
+ <field name="maintain_notes" nolabel="1" colspan="2" />
+ </group>
+ </page>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'mrp_master_extension/product'
=== added file 'mrp_master_extension/product/__init__.py'
--- mrp_master_extension/product/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/product/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,21 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import product
=== added file 'mrp_master_extension/product/product.py'
--- mrp_master_extension/product/product.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/product/product.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,34 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields,osv
+from tools.translate import _
+
+class product_product(osv.osv):
+ _name = 'product.product'
+ _description = 'MRP Product Extension'
+ _inherit = 'product.product'
+
+ _columns = {
+ 'default_location':fields.many2one('stock.location', 'Default Location', help='Default real location of the product'),
+ 'mrp_bom_fp_id': fields.many2one('mrp.bom.operations.product', 'bom final products' ),
+ }
+
+product_product()
\ No newline at end of file
=== added file 'mrp_master_extension/product/product_view.xml'
--- mrp_master_extension/product/product_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/product/product_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!--
+ Product Inherit View
+ -->
+
+ <record id="product_normal_form_inherit_view" model="ir.ui.view">
+ <field name="name">product.defloc.inherit.form</field>
+ <field name="model">product.product</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="product.product_normal_form_view" />
+ <field name="arch" type="xml">
+ <xpath expr="/form/notebook/page/group[@name='misc']"
+ position="after">
+ <group colspan="2" col="2" name="default">
+ <separator string="Default Localization" colspan="2" />
+ <field name="default_location" />
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'mrp_master_extension/res'
=== added file 'mrp_master_extension/res/__init__.py'
--- mrp_master_extension/res/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/res/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,21 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import res_users
=== added file 'mrp_master_extension/res/res_users.py'
--- mrp_master_extension/res/res_users.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/res/res_users.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,31 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+
+class users(osv.osv):
+
+ _inherit = 'res.users'
+
+ _columns = {
+ 'workcenter_ids': fields.many2many('mrp.workcenter', 'mrp_wc_user_rel', 'user_id', 'workcenter_id'),
+ }
+users()
\ No newline at end of file
=== added directory 'mrp_master_extension/stock'
=== added file 'mrp_master_extension/stock/__init__.py'
--- mrp_master_extension/stock/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/stock/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,21 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import stock
\ No newline at end of file
=== added file 'mrp_master_extension/stock/stock.py'
--- mrp_master_extension/stock/stock.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/stock/stock.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,111 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import osv, fields
+import decimal_precision as dp
+from tools.translate import _
+
+class stock_picking(osv.osv):
+
+ _inherit = 'stock.picking'
+
+ _columns = {
+ 'internal_type':fields.selection([('input','Production Input'),('output','Production Output')], 'Type'),
+ }
+
+stock_picking()
+
+class StockMove(osv.osv):
+
+ _inherit = 'stock.move'
+
+ _columns = {
+ 'operation_id': fields.many2one('mrp.production.operation', 'Production Operation'),
+ 'bom_prop': fields.float('BOM Proportion', digits=(16, 2)),
+ }
+
+ _defaults = {
+ 'bom_prop': lambda *a: 1.0,
+ }
+
+ #funcion basada en action_consume de stock.move
+
+ def action_produce(self, cr, uid, ids, quantity, location_id=False, context=None):
+ if context is None:
+ context = {}
+ if quantity <= 0:
+ raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
+ res = []
+ for move in self.browse(cr, uid, ids, context=context):
+ move_qty = move.product_qty
+ if move_qty <= 0:
+ raise osv.except_osv(_('Error!'), _('Can not produce a move with negative or zero quantity !'))
+ quantity_rest = move.product_qty
+ quantity_rest -= quantity
+ uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty
+ if quantity_rest <= 0:
+ quantity_rest = 0
+ uos_qty_rest = 0
+ quantity = move.product_qty
+
+ uos_qty = quantity / move_qty * move.product_uos_qty
+
+ if quantity_rest > 0:
+ default_val = {
+ 'product_qty': quantity,
+ 'product_uos_qty': uos_qty,
+ 'state': move.state,
+ 'location_id': location_id or move.location_id.id,
+ }
+ if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):
+ # IF product has checked track for production lot, move lines will be split by 1
+ res += self.action_split(cr, uid, [move.id], quantity, split_by_qty=1, context=context)
+ else:
+ current_move = self.copy(cr, uid, move.id, default_val)
+ res += [current_move]
+ update_val = {}
+ update_val['product_qty'] = quantity_rest
+ update_val['product_uos_qty'] = uos_qty_rest
+ self.write(cr, uid, [move.id], update_val)
+
+ else:
+ quantity_rest = quantity
+ uos_qty_rest = uos_qty
+ if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):
+ res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
+ else:
+ res += [move.id]
+ update_val = {
+ 'product_qty' : quantity_rest,
+ 'product_uos_qty' : uos_qty_rest,
+ 'location_id': location_id or move.location_id.id
+ }
+ self.write(cr, uid, [move.id], update_val)
+
+ product_obj = self.pool.get('product.product')
+ for new_move in self.browse(cr, uid, res, context=context):
+ for (id, name) in product_obj.name_get(cr, uid, [new_move.product_id.id]):
+ message = _('Product ') + " '" + name + "' "+ _("is consumed with") + " '" + str(new_move.product_qty) + "' "+ _("quantity.")
+ self.log(cr, uid, new_move.id, message)
+ self.action_done(cr, uid, res)
+
+ return res
+
+StockMove()
=== added file 'mrp_master_extension/stock/stock_view_inh.xml'
--- mrp_master_extension/stock/stock_view_inh.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/stock/stock_view_inh.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_picking_form_inh" model="ir.ui.view">
+ <field name="name">stock.picking.out.form.inherit</field>
+ <field name="model">stock.picking</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="stock.view_picking_form" />
+ <field name="arch" type="xml">
+ <xpath expr="/form/group/group/field[@name='backorder_id']" position="after">
+ <field name="internal_type" />
+ </xpath>
+ </field>
+ </record>
+
+ <record id="vpicktree_inh" model="ir.ui.view">
+ <field name="name">stock.picking.tree.inherit</field>
+ <field name="model">stock.picking</field>
+ <field name="type">tree</field>
+ <field name="inherit_id" ref="stock.vpicktree" />
+ <field name="arch" type="xml">
+ <xpath expr="/tree/field[@name='stock_journal_id']" position="after">
+ <field name="internal_type" />
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_picking_internal_search_inh" model="ir.ui.view">
+ <field name="name">stock.picking.internal.search.inherit</field>
+ <field name="model">stock.picking</field>
+ <field name="type">search</field>
+ <field name="inherit_id" ref="stock.view_picking_internal_search" />
+ <field name="arch" type="xml">
+ <xpath expr="/search/group/field[@name='origin']" position="after">
+ <field name="internal_type" />
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'mrp_master_extension/wizard'
=== added file 'mrp_master_extension/wizard/__init__.py'
--- mrp_master_extension/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import prod_parcial_picking
+import partial_production
+import new_manufacturing_user
+import routing_assign
\ No newline at end of file
=== added file 'mrp_master_extension/wizard/new_manufacturing_user.py'
--- mrp_master_extension/wizard/new_manufacturing_user.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/new_manufacturing_user.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,328 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+import time
+
+class delete_ops(osv.osv_memory):
+ _name = "delete.ops"
+ _description = "Delete"
+ _columns = {
+ 'op_us': fields.many2one('mrp.production.users','User to delete'),
+ 'user_name': fields.char('Are you sure you want to decouple worker from operation :::> ',size=64)
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ res = super(delete_ops, self).default_get(cr, uid, fields, context=context)
+
+ obj = self.pool.get('mrp.production.users').browse(cr , uid, context['op_us'])
+ values = {
+ 'op_us': obj.id,
+ 'user_name': obj.name.name
+ }
+ res.update(values)
+ return res
+
+ def delete_user(self, cr, uid, fields, context=None):
+
+ obj = self.pool.get('mrp.production.users').browse(cr, uid, context['op_us'])
+ obj.delete_it()
+ return {'type': 'ir.actions.act_window_close'}
+
+delete_ops()
+
+
+class delete_choice(osv.osv_memory):
+
+
+ _name = "delete.choice"
+ _description = "Choice user to delete"
+ _columns = {
+ 'op_us': fields.many2one('mrp.production.users','User to delete'),
+ 'ava':fields.char('Avatible ids', size=256),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+
+ result = []
+ prod_us_op_search = self.pool.get('mrp.production.users').search(cr, uid,[('op', '=', context['op'] )])
+ prod_us = self.pool.get('mrp.production.users').browse(cr , uid, prod_us_op_search)
+ aux = self.pool.get('mrp.production.operation').browse(cr , uid, context['op'])
+
+ if prod_us:
+ for us_obj in prod_us:
+ if us_obj.op.id == aux.id:
+ result.append(us_obj.id)
+
+ ava = str(result)
+
+ res = super(delete_choice, self).default_get(cr, uid, fields, context=context)
+ values = {
+ 'ava':ava,
+ }
+ res.update(values)
+ return res
+
+delete_choice()
+
+class manufacturing_user(osv.osv_memory):
+ _name = "manufacturing.user"
+ _description = "Manufacturing new user"
+
+
+
+ _columns = {
+ 'user': fields.many2one('res.users', 'User to add'),
+ 'percent':fields.float('Estimated %'),
+ 'est_time':fields.float('Estimated time')
+ }
+ _default= {
+ 'percent': 0,
+ 'est_time':0
+ }
+
+ def add_user(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+
+ objs = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'])
+ objs2 = self.pool.get('mrp.production.users')
+
+ con_user = []
+ con_ops = []
+ for obj in objs:
+ for usr_op in obj.user_ops:
+ con_user.append((usr_op.name.id, usr_op.op.id))
+ obj_ops = self.pool.get('mrp.production.operation')
+ ops_ids = obj_ops.search(cr, uid,[('production_id', '=',obj.id )])
+ con_ops = obj_ops.browse(cr , uid, ops_ids)
+
+
+ usr = context['user']
+ percent = context['percent']
+
+ if not usr:
+ raise osv.except_osv(_('Unable to perform action'), _('You must select Operator'))
+
+
+ for check in con_ops:
+ create = True
+ for check_op in con_user:
+ if check_op == (usr, check.id):
+ create = False
+ if create:
+ est_time = check.hour * percent /100
+ values = {
+ 'name': usr,
+ 'op':check.id,
+ 'prod':context['active_ids'][0],
+ 'percent': percent,
+ 'est_time':est_time,
+ }
+
+
+ res = objs2.create(cr, uid, values)
+
+
+ return {'type': 'ir.actions.act_window_close'}
+
+
+
+
+manufacturing_user()
+
+class aux_res_users(osv.osv_memory):
+
+ _name = 'aux.res.users'
+ _description = "Operation users"
+
+ _columns = {
+ 'est_time':fields.float('Estimated time'),
+ 'user_id':fields.many2one('res.users', 'user id'),
+ 'name':fields.char('Nombre', size=64),
+ 'percent':fields.float('% Estimated'),
+ 'wizard_id': fields.many2one('manufacturing.user.op', 'wizard', required=True),
+ 'op':fields.many2one('mrp.production.operation','prod user')
+ }
+
+aux_res_users()
+
+class manufacturing_user_op(osv.osv_memory):
+ _name = "manufacturing.user.op"
+ _description = "Manufacturing new user"
+
+
+
+ _columns = {
+ 'user': fields.one2many('aux.res.users', 'wizard_id', 'Users added'),
+ 'production':fields.many2one('mrp.production', 'Production'),
+ 'operation':fields.many2one('mrp.production.operation', 'Operation'),
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(manufacturing_user_op, self).default_get(cr, uid, fields, context=context)
+ aux = self.pool.get('mrp.production.operation').browse(cr , uid, context['active_ids'][0])
+
+ op_id = aux.id
+ prod_id = aux.production_id.id
+
+ obj = self.pool.get('mrp.production').browse(cr , uid, prod_id)
+ obj2_id= self.pool.get('mrp.production.users').search(cr, uid,[('op', '=', op_id)])
+ obj2= self.pool.get('mrp.production.users').browse(cr, uid,obj2_id)
+
+ result = []
+ if obj:
+ for prod in obj2:
+ values = {
+ 'user_id': prod.name.id,
+ 'name':prod.name.name,
+ 'percent':prod.percent,
+ 'op':op_id,
+ 'est_time':prod.est_time
+ }
+ result.append(values)
+
+ else:
+ raise osv.except_osv(_('no hay produccion'), _(obj))
+ res.update({'user': result , 'production':prod_id, 'operation':op_id})
+ return res
+
+
+
+
+
+manufacturing_user_op()
+
+
+
+class manufacturing_user_op_add(osv.osv_memory):
+ _name = "manufacturing.user.op.add"
+ _description = "Manufacturing new user"
+
+
+
+ _columns = {
+ 'user': fields.many2one('res.users', 'User to add'),
+ 'percent':fields.float('% Estimated'),
+ 'est_time':fields.float('Estimated time'),
+ 'op':fields.many2one('mrp.production.operation')
+
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(manufacturing_user_op_add, self).default_get(cr, uid, fields, context=context)
+ res.update({'op':context['operation']})
+ return res
+
+ def est_time_on_change(self, cr, uid, ids, est_time, op, context=None):
+ objs = self.pool.get('mrp.production.operation').browse(cr , uid, op)
+ tot_time = objs.hour
+ etime_list = est_time.rsplit(':')
+ etime = float(etime_list[0])+(float(etime_list[1])/60)+(float(etime_list[2])/360)
+ percent = (float(etime) * 100) / tot_time
+ return {'value': {'percent':percent}}
+
+ def percent_on_change(self, cr, uid, ids, percent, op, context=None):
+ objs = self.pool.get('mrp.production.operation').browse(cr , uid, op)
+ tot_time = objs.hour
+ est_time_op = (percent / 100) * tot_time
+ h = int(est_time_op)
+ est_time_op =(est_time_op -h)* 60
+ m= int(est_time_op)
+ s = int((est_time_op-m)*60)
+
+ if h<10:
+ h = "0"+str(h)
+ if m<10:
+ m = "0"+str(m)
+ if s<10:
+ s = "0"+str(s)
+
+
+ est_time = str(h) +":"+str(m)+":"+str(s)
+
+ return {'value': {'est_time':est_time}}
+#
+ def add_user_op(self, cr, uid, ids, context=None):
+
+ if context is None:
+ context = {}
+
+ production = context['production']
+
+ objs = self.pool.get('mrp.production').browse(cr , uid, production)
+
+
+ usr = context['user']
+ percent = context['percent']
+
+ objs2 = self.pool.get('mrp.production.users')
+ objs2_id = objs2.search(cr, uid,[('prod', '=', [production])])
+ objs2_s = objs2.browse(cr , uid, objs2_id)
+
+ con_user = []
+
+ for usr_op in objs2_s:
+ con_user.append((usr_op.name.id, usr_op.op.id))
+
+
+
+
+ check = context['operation']
+ st_est_time = context['est_time']
+
+ est_time_list = st_est_time.rsplit(':')
+ est_time = float(est_time_list[0])+(float(est_time_list[1])/60)+(float(est_time_list[2])/360)
+
+
+ create = True
+
+ for check_op in con_user:
+ if check_op == (usr, check):
+ create = False
+ if create:
+
+ values = {
+ 'name': usr,
+ 'op':check,
+ 'prod':production,
+ 'percent':percent,
+ 'est_time':est_time
+ }
+ res = objs2.create(cr, uid, values)
+
+
+ return {'type': 'ir.actions.act_window_close'}
+
+manufacturing_user_op_add()
=== added file 'mrp_master_extension/wizard/new_manufacturing_user_view.xml'
--- mrp_master_extension/wizard/new_manufacturing_user_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/new_manufacturing_user_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- RECORDS DE BORRADO DE USUARIOS -->
+
+ <record id="delete_confirmation" model="ir.ui.view">
+ <field name="name">delete.confirmation</field>
+ <field name="model">delete.ops</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field name="op_us" invisible="1" width="300"/>
+ <field name="user_name" readonly="1" colspan="4" width="200"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="delete_user" string="Yes"
+ type="object" icon="gtk-ok" special="cancel"
+ context="{'op_us':op_us}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="action_delete_user_ops" model="ir.actions.act_window">
+ <field name="name">action.new.time.input </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">delete.ops</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <!-- wizard de seleccion de borrado
+ Dominio no funciona
+ -->
+
+ <record id="delete_choice_form" model="ir.ui.view">
+ <field name="name">delete.choice.form</field>
+ <field name="model">delete.choice</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field name="ava" invisible="1"/>
+ <field name="op_us" domain="[('id','in',eval(ava))]"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="%(action_delete_user_ops)d" string="Delete"
+ type="action" icon="terp-gtk-stop" special="cancel"
+ context="{'op_us':op_us}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="action_delete_user" model="ir.actions.act_window">
+ <field name="name">action.new.time.input </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">delete.choice</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <!-- FORM AUXILIAR PARA MOSTRAR USUARIOS EN EL PRIMER WIZARD -->
+
+ <record id="manufacturing_aux_user_tree" model="ir.ui.view">
+ <field name="name">manufacturing.aux.user.tree</field>
+ <field name="model">aux.res.users</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Operators assignment">
+ <field name="op" invisible="1" />
+ <field colspan="2" name="user_id" readonly="1"/>
+ <field name="percent" readonly="1"/>
+ <field name="est_time" string="Estimated time(hs)" readonly="1"/>
+<!-- <button name="%(action_delete_user_ops)d" string="Delete"-->
+<!-- type="action" icon="terp-gtk-stop" special="cancel" -->
+<!-- context="{'op':op,'us':user_id}" />-->
+ </tree>
+ </field>
+ </record>
+
+ <!-- RECORDS DE ASIGNACION DE USUARIOS DESDE LA ORDEN DE FABRICACION-->
+
+
+ <record id="manufacturing_user_form" model="ir.ui.view">
+ <field name="name">manufacturing.user.form</field>
+ <field name="model">manufacturing.user</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Operator Assignment">
+ <field colspan="2" name="user"/>
+ <field name="percent"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="add_user" string="Add user" type="object" icon="gtk-ok" context="{'user':user,'percent':percent}" />
+ </form>
+ </field>
+ </record>
+
+ <record id="action_new_production_user" model="ir.actions.act_window">
+ <field name="name">Production user</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">manufacturing.user</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+
+ <!-- RECORDS PARA ASIGNAR NUEVOS USUARIOS DIRECTAMENTE A LAS OPERACIONES -->
+
+
+ <record id="manufacturing_user_form_op_add" model="ir.ui.view">
+ <field name="name">manufacturing.user.form.op.add</field>
+ <field name="model">manufacturing.user.op.add</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Assign Operator">
+ <field colspan="2" name="user"/>
+ <field name="op" invisible="1"/>
+ <newline/>
+ <field name="est_time" widget="time" on_change="est_time_on_change(est_time,op)"/>
+ <field name="percent" on_change="percent_on_change(percent,op)"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="add_user_op" string="Add user" type="object" icon="gtk-ok" context="{'user':user,'percent':percent, 'est_time':est_time}"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_new_production_user_op_add" model="ir.actions.act_window">
+ <field name="name">Production user</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">manufacturing.user.op.add</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ <record id="manufacturing_user_form_op" model="ir.ui.view">
+ <field name="name">manufacturing.user.op.form</field>
+ <field name="model">manufacturing.user.op</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Operators assigned">
+ <field colspan="4" name="user" nolabel="1" />
+ <field name="production" invisible="1"/>
+ <field name="operation" invisible="1"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="%(action_new_production_user_op_add)d" string="Add user"
+ type="action" icon="terp-personal+" special="cancel"
+ context="{'production':production,'operation':operation,'user':user}" />
+ <button name="%(action_delete_user)d" string="Delete"
+ type="action" icon="terp-gtk-stop" special="cancel"
+ context="{'op':operation}" />
+
+ </form>
+ </field>
+ </record>
+
+ <record id="action_new_production_user_op" model="ir.actions.act_window">
+ <field name="name">Production operations user </field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">manufacturing.user.op</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'mrp_master_extension/wizard/partial_production.py'
--- mrp_master_extension/wizard/partial_production.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/partial_production.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,92 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+import time
+
+class parcial_picking_aux_production(osv.osv_memory):
+ _name = "parcial.picking.aux.production"
+
+ _columns = {
+ 'stock_move_id':fields.many2one('stock.move', 'Stock move', required=True, select=True),
+ 'product_id':fields.many2one('product.product', 'Product', required=True, select=True),
+ 'product_qty': fields.float('Quantity', required=True),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True),
+ 'wizard_id': fields.many2one('prod.partial.picking', 'wizard', required=True),
+ }
+
+parcial_picking_aux_production()
+
+class production_partial_picking(osv.osv_memory):
+ _name = "production.partial.picking"
+ _description = "Partial Production"
+
+ _columns = {
+ 'production_lines': fields.one2many('parcial.picking.aux.production', 'wizard_id', 'Moves'),
+
+ }
+
+ def do_full_produce(self, cr, uid, ids, context = None):
+
+ move_obj = self.pool.get('stock.move')
+
+ for obj in self.browse(cr, uid, ids):
+ for prod in obj.production_lines:
+ if context is None:
+ context = {}
+ move_id = prod.stock_move_id.id
+ prod_qty = prod.product_qty
+ prod_loc = prod.location_id.id
+ move_obj.action_consume(cr, uid, [move_id] ,prod_qty,prod_loc,context=context)
+
+ return {'type': 'ir.actions.act_window_close'}
+
+
+
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(production_partial_picking, self).default_get(cr, uid, fields, context=context)
+ objs = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'])
+ move_obj = self.pool.get('parcial.picking.aux.production')
+
+ result = []
+ for obj in objs:
+ for prod in obj.move_created_ids:
+
+
+
+ values = {
+ 'stock_move_id': prod.id,
+ 'name':prod.name,
+ 'product_id':prod.product_id.id,
+ 'product_qty': prod.product_qty,
+ 'location_id': prod.location_id.id,
+ }
+
+
+ result.append(values)
+
+ res.update({'production_lines': result})
+ return res
+
+production_partial_picking()
\ No newline at end of file
=== added file 'mrp_master_extension/wizard/partial_production_view.xml'
--- mrp_master_extension/wizard/partial_production_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/partial_production_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="production_picking_form" model="ir.ui.view">
+ <field name="name">production.picking.form</field>
+ <field name="model">production.partial.picking</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field colspan="4" name="production_lines" nolabel="1" widget="one2many_list">
+ <tree string="Components" editable="bottom">
+ <field name="stock_move_id" invisible="1" />
+ <field name="product_id" />
+ <field name="product_qty" />
+ <field name="location_id" invisible="1" />
+ </tree>
+ <form>
+ <field name="stock_move_id" invisible="1" />
+ <field name="product_id" />
+ <field name="product_qty" />
+ <field name="location_id" invisible="1" />
+ </form>
+ </field>
+ <separator string="" colspan="4" />
+ <label string="" colspan="2" />
+ <group col="2" colspan="1">
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="do_full_produce" string="Ok" colspan="1"
+ type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_partial_production_picking" model="ir.actions.act_window">
+ <field name="name">Production Picking</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">production.partial.picking</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'mrp_master_extension/wizard/prod_parcial_picking.py'
--- mrp_master_extension/wizard/prod_parcial_picking.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/prod_parcial_picking.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,91 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+import time
+
+class parcial_picking_aux_product(osv.osv_memory):
+ _name = "parcial.picking.aux.product"
+
+ _columns = {
+ 'stock_move_id':fields.many2one('stock.move', 'Stock move', required=True, select=True),
+ 'product_id':fields.many2one('product.product', 'Product', required=True, select=True),
+ 'product_qty': fields.float('Quantity', required=True),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True),
+ 'wizard_id': fields.many2one('prod.partial.picking', 'wizard', required=True),
+ }
+
+parcial_picking_aux_product()
+
+class prod_partial_picking(osv.osv_memory):
+ _name = "prod.partial.picking"
+ _description = "Partial Picking"
+
+ _columns = {
+ 'move_lines': fields.one2many('parcial.picking.aux.product', 'wizard_id', 'Moves'),
+
+ }
+
+ def do_full_move_consume(self, cr, uid, ids, context = None):
+
+ move_obj = self.pool.get('stock.move')
+
+ for obj in self.browse(cr, uid, ids):
+ for prod in obj.move_lines:
+ if context is None:
+ context = {}
+ move_id = prod.stock_move_id.id
+ prod_qty = prod.product_qty
+ prod_loc = prod.location_id.id
+ move_obj.action_consume(cr, uid, [move_id] ,prod_qty,prod_loc,context=context)
+
+ return {'type': 'ir.actions.act_window_close'}
+
+
+#
+ def default_get(self, cr, uid, fields, context=None):
+
+ if context is None:
+ context = {}
+ res = super(prod_partial_picking, self).default_get(cr, uid, fields, context=context)
+ objs = self.pool.get('mrp.production').browse(cr , uid, context['active_ids'])
+ move_obj = self.pool.get('parcial.picking.aux.product')
+
+ result = []
+ for obj in objs:
+ for prod in obj.move_lines:
+
+ qty = prod.product_id._product_qty_available
+ if prod.state == 'assigned' and qty > 0 :
+
+ values = {
+ 'stock_move_id': prod.id,
+ 'name':prod.name,
+ 'product_id':prod.product_id.id,
+ 'product_qty': prod.product_qty,
+ 'location_id': prod.location_id.id,
+ }
+ result.append(values)
+
+ res.update({'move_lines': result})
+ return res
+
+prod_partial_picking()
\ No newline at end of file
=== added file 'mrp_master_extension/wizard/prod_parcial_picking_view.xml'
--- mrp_master_extension/wizard/prod_parcial_picking_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/prod_parcial_picking_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="process_picking_form" model="ir.ui.view">
+ <field name="name">process.picking.form</field>
+ <field name="model">prod.partial.picking</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field colspan="4" name="move_lines" nolabel="1" widget="one2many_list">
+ <tree string="Components" editable="bottom">
+ <field name="stock_move_id" invisible="1" />
+ <field name="product_id" />
+ <field name="product_qty" />
+ <field name="location_id" invisible="1" />
+ </tree>
+ <form>
+ <field name="stock_move_id" invisible="1" />
+ <field name="product_id" />
+ <field name="product_qty" />
+ <field name="location_id" invisible="1" />
+ </form>
+ </field>
+ <separator string="" colspan="4" />
+ <label string="" colspan="2" />
+ <group col="2" colspan="1">
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="do_full_move_consume" string="Ok" colspan="1"
+ type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_partial_product_picking" model="ir.actions.act_window">
+ <field name="name">Process Picking</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">prod.partial.picking</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+
+</openerp>
=== added file 'mrp_master_extension/wizard/routing_assign.py'
--- mrp_master_extension/wizard/routing_assign.py 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/routing_assign.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,131 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+import time
+
+class assign_routing(osv.osv_memory):
+ _name = "assign.routing"
+ _description = "Manufacturing new user"
+
+ _columns = {
+ 'routing': fields.many2one('mrp.routing', 'Routing'),
+ }
+
+ def assign(self, cr, uid, ids, context=None):
+
+ if context is None:
+ context = {}
+
+ routing_asgn_obj = self.browse(cr , uid, ids)
+
+ routing_name = False
+ routing_id = False
+ for aux in routing_asgn_obj:
+ routing_id = aux.routing.id
+
+ if routing_id:
+ routing_brow = self.pool.get('mrp.routing').browse(cr , uid, routing_id)
+ routing_name = routing_brow.name
+ ops_obj = self.pool.get('mrp.bom.operations.product')
+ objs = self.pool.get('mrp.bom').browse(cr , uid, context['active_ids'])
+ ops = False
+
+
+ for aux in objs:
+ ops = aux.mrp_bom_operations_product_ids
+# for comp in aux.bom_lines:
+
+
+ for to_delete in ops:
+ ops_obj.unlink(cr, uid, [to_delete.id])
+
+ wc_lines = self.pool.get('mrp.production.workcenter.line')
+ print str(routing_id)
+ wc_line_id = wc_lines.search(cr, uid, [('routing_id', '=', routing_id)])
+
+ wc_line_obj = []
+
+ if len(wc_line_id):
+ wc_line_obj = wc_lines.browse(cr, uid, wc_line_id)
+
+ bom_obj = self.pool.get('mrp.bom')
+
+ for operation in wc_line_obj:
+
+ uom = False
+ if operation.product_id.uom_id:
+ uom = operation.product_id.uom_id.id
+ values = {
+ 'sequence': operation.sequence,
+ 'descript': operation.descript,
+ 'operation_id': operation.operation_id.id,
+ 'workcenter_id': operation.workcenter_id.id,
+ 'bom_id': context['active_ids'][0],
+ 'capacity_per_cycle': operation.workcenter_id.capacity_per_cycle,
+ 'time_efficiency': operation.workcenter_id.time_efficiency,
+ 'time_cycle': operation.workcenter_id.time_cycle,
+ 'time_start': operation.workcenter_id.time_start,
+ 'time_stop': operation.workcenter_id.time_stop,
+ 'costs_hour': operation.workcenter_id.costs_hour,
+ 'costs_cycle': operation.workcenter_id.costs_cycle,
+ 'name': '%s -> %s' % (operation.operation_id.name, operation.workcenter_id.name),
+ 'location_id': operation.location_id.id,
+ 'product_id':operation.product_id.id,
+ 'semi_prod_uom':uom,
+
+ }
+
+
+ res = ops_obj.create(cr, uid, values)
+
+ for boms in operation.components:
+ bom_values = {
+ 'bom_id':context['active_ids'][0],
+ 'mrp_bom_operations_product_id':res,
+ 'product_id': boms.product_id.id,
+ 'name' : boms.name,
+ 'product_uom':boms.product_uom.id,
+ 'product_qty':boms.product_qty,
+ }
+ bom_obj.create(cr, uid, bom_values)
+
+ bom_costs_obj = self.pool.get('bom.fixed.cost')
+
+ for del_it in objs[0].fixed_costs:
+ bom_costs_obj.unlink(cr, uid, del_it.id)
+
+
+ for cost in routing_brow.fixed_costs:
+ values = {
+ 'name':cost.name,
+ 'amount':cost.amount,
+ 'estimated':cost.amount,
+ 'bom_id': context['active_ids'][0],
+ }
+ bom_costs_obj.create(cr, uid, values)
+
+ self.pool.get('mrp.bom').write(cr, uid, context['active_ids'][0] ,{'routing_id_name': routing_name,'routing_id':routing_id})
+
+ return {'type': 'ir.actions.act_window_close'}
+
+
+assign_routing()
\ No newline at end of file
=== added file 'mrp_master_extension/wizard/routing_assign_view.xml'
--- mrp_master_extension/wizard/routing_assign_view.xml 1970-01-01 00:00:00 +0000
+++ mrp_master_extension/wizard/routing_assign_view.xml 2012-04-26 18:16:21 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="assign_routing_form" model="ir.ui.view">
+ <field name="name">Assign routing</field>
+ <field name="model">assign.routing</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form>
+ <field colspan="2" name="routing" widget="selection"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="assign" string="Assign" type="object" icon="gtk-ok" />
+ </form>
+ </field>
+ </record>
+
+ <record id="action_assign_routing" model="ir.actions.act_window">
+ <field name="name">Assign routing</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">assign.routing</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'mrp_operations_ext'
=== added file 'mrp_operations_ext/__init__.py'
--- mrp_operations_ext/__init__.py 1970-01-01 00:00:00 +0000
+++ mrp_operations_ext/__init__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+import wizard
+import mrp_operations
+import stock
+
=== added file 'mrp_operations_ext/__openerp__.py'
--- mrp_operations_ext/__openerp__.py 1970-01-01 00:00:00 +0000
+++ mrp_operations_ext/__openerp__.py 2012-04-26 18:16:21 +0000
@@ -0,0 +1,71 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2011 Ting & Avanzosc (http://www.openerpsite.com) All Rights Reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+{
+ 'name': 'Operation Production start end workflow',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Production',
+ 'description': """
+ This module adds state, date_start,date_stop in production order operation lines
+ (in the "Work Centers" tab)
+ State: draft, confirm, done, cancel
+ When finishing/confirming,cancelling production orders set all state lines to the according state
+ Create menus:
+ Production Management > All Operations
+ Production Management > All Operations > Operations To Do (state="confirm")
+ Which is a view on "Work Centers" lines in production order,
+ editable tree
+
+ Add buttons in the form view of production order under workcenter tab:
+ * start (set state to confirm), set date_start
+ * done (set state to done), set date_stop
+ * set to draft (set state to draft)
+ * cancel set state to cancel
+
+ When the production order becomes "ready to produce", operations must
+ become 'confirmed'. When the production order is done, all operations
+ must become done.
+
+ The field delay is the delay(stop date - start date).
+ So that we can compare the theoretic delay and real delay.
+
+ """,
+ 'author': 'OpenERP SA - Avanzosc - Ting!',
+ 'website': 'http://www.openerp.com - http://www.avanzosc.com - http://www.ting.es',
+ 'depends': ['mrp',
+ 'stock',
+ 'mrp_master_extension'],
+ 'init_xml': [],
+ 'update_xml': [
+# 'security/ir.model.access.csv',
+ 'wizard/work_wizard_view.xml',
+ 'mrp_operations_workflow.xml',
+ 'wizard/partial_produce_view.xml',
+ 'mrp_operations_view.xml',
+# 'mrp_operations_report.xml',
+# 'report/mrp_workorder_analysis_view.xml',
+# 'process/mrp_operation_process.xml'
+ ],
+# 'demo_xml': ['mrp_operation_data.xml'],
+# 'test': ['test/mrp_operations.yml', 'test/mrp_operations_report.yml'],
+ 'installable': True,
+ 'active': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added directory 'mrp_operations_ext/i18n'
=== added file 'mrp_operations_ext/i18n/ar.po'
--- mrp_operations_ext/i18n/ar.po 1970-01-01 00:00:00 +0000
+++ mrp_operations_ext/i18n/ar.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,727 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_operations
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.4\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2010-12-15 15:05+0000\n"
+"PO-Revision-Date: 2011-10-11 10:41-0600\n"
+"Last-Translator: oscar <oszckar@xxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-12-17 05:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_form
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_action_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_order
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+msgid "Work Orders"
+msgstr "Ordenes de Trabajo"
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_canceloperation0
+msgid "Cancel the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation_code
+msgid "mrp_operations.operation.code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Production Order Cannot start in [%s] state"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+msgid "Group By..."
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_workorder0
+msgid "Information from the routing definition."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "March"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_resource_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_resource_planning
+msgid "Work Centers"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Resume"
+msgstr ""
+
+#. module: mrp_operations
+#: report:mrp.code.barcode:0
+msgid "("
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Product to Produce"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation:0
+msgid "Production Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production,allow_reorder:0
+msgid "Free Serialisation"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.process,name:mrp_operations.process_process_mrpoperationprocess0
+msgid "Mrp Operations"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,day:0
+msgid "Day"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_productionorder0
+msgid "Production Order"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Picking Exception"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_productionstart0
+msgid "Creation of the work order"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "You cannot Pause the Operation other then Start/Resume state !"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,workcenter_id:0
+msgid "Workcenter"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_productionstart0
+msgid "The work orders are created on the basis of the production order."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_confirm_action
+msgid "Confirmed Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_operation_action
+#: view:mrp.production.workcenter.line:0
+msgid "Operations"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_stock_move
+msgid "Stock Move"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.workorder,nbr:0
+msgid "# of Lines"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,production_state:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "In Production"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.production.workcenter.line,state:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,state:0
+msgid "State"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.action_report_mrp_workorder
+#: model:ir.model,name:mrp_operations.model_mrp_production_workcenter_line
+msgid "Work Order"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_workstartoperation0
+msgid "There is 1 work order per work center. The information about the number of cycles or the cycle time."
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Month -1"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production.workcenter.line,state:0
+msgid ""
+"* When a work order is created it is set in 'Draft' state.\n"
+"* When user sets work order in start mode that time it will be set in 'In Progress' state.\n"
+"* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pause' state.\n"
+"* When the user cancels the work order it will be set in 'Canceled' state.\n"
+"* When order is completely processed that time it is set in 'Finished' state."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "You cannot finish the operation without Starting/Resuming it !"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Planned Date"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "There is no Operation to be cancelled !"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,product_qty:0
+msgid "Product Qty"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "July"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation.code,name:0
+msgid "Operation Name"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation.code,start_stop:0
+msgid "Status"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,order_date:0
+msgid "Order Date"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_draft_action
+msgid "Future Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation has already started !You can either Pause /Finish/Cancel the operation"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_canceloperation0
+msgid "Operation Cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "September"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "December"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,month:0
+msgid "Month"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Canceled"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation
+msgid "mrp_operations.operation"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_workorder
+msgid "Work Order Report"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_start:0
+#: field:mrp.production.workcenter.line,date_start_date:0
+#: field:mrp_operations.operation,date_start:0
+msgid "Start Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Waiting Goods"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Pause"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+msgid "In Progress"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_production
+msgid "Manufacturing Order"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Start"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation:0
+msgid "Calendar View"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_startcanceloperation0
+msgid "When the operation needs to be cancelled, you can do it in the work order form."
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+msgid "Set Draft"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,total_cycles:0
+msgid "Total Cycles"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Pending"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation.code:0
+msgid "Production Operation Code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid " You cannot Resume the operation other then Pause state !"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "August"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Started"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "June"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation is already finished !"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Ready to Produce"
+msgstr ""
+
+#. module: mrp_operations
+#: field:stock.move,move_dest_id_lines:0
+msgid "Children Moves"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_planning
+msgid "Work Orders Planning"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.workorder,date:0
+msgid "Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "November"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production.workcenter.line,delay:0
+msgid "This is lead time between operation start and stop in this workcenter"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Search"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "October"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "January"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_doneoperation0
+msgid "Finish the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation is not started yet !"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_productionorder0
+msgid "Information from the production order."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Sorry!"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Current"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,code_id:0
+#: field:mrp_operations.operation.code,code:0
+msgid "Code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation is Already Cancelled !"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,help:mrp_operations.mrp_production_wc_action_planning
+msgid "To manufacture or assemble products, as well as using raw materials and finished product you must also handle manufacturing operations. Manufacturing operations are often called work orders. The different operations will have different impacts on the costs of manufacture and planning depending on the available workload."
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.module.module,shortdesc:mrp_operations.module_meta_information
+msgid "Work Center Production start end workflow"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_code_action
+msgid "Operation Codes"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,qty:0
+msgid "Qty"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_doneoperation0
+msgid "Operation Done"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+#: view:mrp.workorder:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Done"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.report.xml,name:mrp_operations.report_code_barcode
+msgid "Start/Stop Barcode"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+msgid "Cancel"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,help:mrp_operations.mrp_production_wc_action_form
+msgid "Work Orders is the list of operations to be performed for each manufacturing order. Once you start the first work order of a manufacturing order, the manufacturing order is automatically marked as started. Once you finish the latest operation of a manufacturing order, the MO is automatically done and the related products are produced."
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_startoperation0
+msgid "Start Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Information"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.report.xml,name:mrp_operations.report_wc_barcode
+msgid "Work Centers Barcode"
+msgstr ""
+
+#. module: mrp_operations
+#: constraint:stock.move:0
+msgid "You must assign a production lot for this product"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Late"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.workorder,delay:0
+msgid "Delay"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,production_id:0
+#: field:mrp_operations.operation,production_id:0
+msgid "Production"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Search Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,workcenter_id:0
+#: model:process.node,name:mrp_operations.process_node_workorder0
+msgid "Work Center"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Real"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_planned:0
+msgid "Scheduled Date"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,product:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,total_hours:0
+msgid "Total Hours"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production,allow_reorder:0
+msgid "Check this to be able to move independently all production orders, without moving dependent ones."
+msgstr ""
+
+#. module: mrp_operations
+#: report:mrp.code.barcode:0
+msgid ")"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.ui.menu,name:mrp_operations.menu_report_mrp_workorders_tree
+msgid "Work Order Analysis"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+msgid "Finished"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,uom:0
+msgid "UOM"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Hours by Work Center"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,delay:0
+msgid "Working Hours"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_finished:0
+#: field:mrp.production.workcenter.line,date_planned_end:0
+#: field:mrp_operations.operation,date_finished:0
+msgid "End Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "February"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_startcanceloperation0
+msgid "Operation cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_startoperation0
+msgid "Start the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "April"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_startdoneoperation0
+msgid "Operation done"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "#Line Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_startdoneoperation0
+msgid "When the operation is finished, the operator updates the system by finishing the work order."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "May"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_workstartoperation0
+msgid "Details of the work order"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,production_state:0
+msgid "Production State"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,year:0
+msgid "Year"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Duration"
+msgstr ""
+
+#. module: mrp_operations
+#: constraint:mrp.production:0
+msgid "Order quantity cannot be negative or zero !"
+msgstr ""
+
+#. module: mrp_operations
+#: constraint:stock.move:0
+msgid "You try to assign a lot which is not from the same product"
+msgstr ""
+
=== added file 'mrp_operations_ext/i18n/bg.po'
--- mrp_operations_ext/i18n/bg.po 1970-01-01 00:00:00 +0000
+++ mrp_operations_ext/i18n/bg.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,757 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_operations
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.4\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2010-12-15 15:05+0000\n"
+"PO-Revision-Date: 2009-02-04 05:52+0000\n"
+"Last-Translator: Fabien (Open ERP) <fp@xxxxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-12-17 05:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_form
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_action_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_order
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+msgid "Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_canceloperation0
+msgid "Cancel the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation_code
+msgid "mrp_operations.operation.code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Production Order Cannot start in [%s] state"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+msgid "Group By..."
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_workorder0
+msgid "Information from the routing definition."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "March"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_resource_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_resource_planning
+msgid "Work Centers"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Resume"
+msgstr ""
+
+#. module: mrp_operations
+#: report:mrp.code.barcode:0
+msgid "("
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Product to Produce"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation:0
+msgid "Production Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production,allow_reorder:0
+msgid "Free Serialisation"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.process,name:mrp_operations.process_process_mrpoperationprocess0
+msgid "Mrp Operations"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,day:0
+msgid "Day"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_productionorder0
+msgid "Production Order"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Picking Exception"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_productionstart0
+msgid "Creation of the work order"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "You cannot Pause the Operation other then Start/Resume state !"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,workcenter_id:0
+msgid "Workcenter"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_productionstart0
+msgid "The work orders are created on the basis of the production order."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_confirm_action
+msgid "Confirmed Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_operation_action
+#: view:mrp.production.workcenter.line:0
+msgid "Operations"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_stock_move
+msgid "Stock Move"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.workorder,nbr:0
+msgid "# of Lines"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,production_state:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "In Production"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.production.workcenter.line,state:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,state:0
+msgid "State"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.action_report_mrp_workorder
+#: model:ir.model,name:mrp_operations.model_mrp_production_workcenter_line
+msgid "Work Order"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_workstartoperation0
+msgid ""
+"There is 1 work order per work center. The information about the number of "
+"cycles or the cycle time."
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Month -1"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production.workcenter.line,state:0
+msgid ""
+"* When a work order is created it is set in 'Draft' state.\n"
+"* When user sets work order in start mode that time it will be set in 'In "
+"Progress' state.\n"
+"* When work order is in running mode, during that time if user wants to stop "
+"or to make changes in order then can set in 'Pause' state.\n"
+"* When the user cancels the work order it will be set in 'Canceled' state.\n"
+"* When order is completely processed that time it is set in 'Finished' state."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "You cannot finish the operation without Starting/Resuming it !"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Planned Date"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "There is no Operation to be cancelled !"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,product_qty:0
+msgid "Product Qty"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "July"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation.code,name:0
+msgid "Operation Name"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation.code,start_stop:0
+msgid "Status"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,order_date:0
+msgid "Order Date"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_draft_action
+msgid "Future Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid ""
+"Operation has already started !You can either Pause /Finish/Cancel the "
+"operation"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_canceloperation0
+msgid "Operation Cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "September"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "December"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,month:0
+msgid "Month"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Canceled"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation
+msgid "mrp_operations.operation"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_workorder
+msgid "Work Order Report"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_start:0
+#: field:mrp.production.workcenter.line,date_start_date:0
+#: field:mrp_operations.operation,date_start:0
+msgid "Start Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Waiting Goods"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Pause"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+msgid "In Progress"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_production
+msgid "Manufacturing Order"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Start"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation:0
+msgid "Calendar View"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_startcanceloperation0
+msgid ""
+"When the operation needs to be cancelled, you can do it in the work order "
+"form."
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+msgid "Set Draft"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,total_cycles:0
+msgid "Total Cycles"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Pending"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operations.operation.code:0
+msgid "Production Operation Code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid " You cannot Resume the operation other then Pause state !"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "August"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Started"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "June"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation is already finished !"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+msgid "Ready to Produce"
+msgstr ""
+
+#. module: mrp_operations
+#: field:stock.move,move_dest_id_lines:0
+msgid "Children Moves"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_planning
+msgid "Work Orders Planning"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: field:mrp.workorder,date:0
+msgid "Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "November"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production.workcenter.line,delay:0
+msgid "This is lead time between operation start and stop in this workcenter"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Search"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "October"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "January"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_doneoperation0
+msgid "Finish the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation is not started yet !"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_productionorder0
+msgid "Information from the production order."
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Sorry!"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "Current"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,code_id:0
+#: field:mrp_operations.operation.code,code:0
+msgid "Code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Operation is Already Cancelled !"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,help:mrp_operations.mrp_production_wc_action_planning
+msgid ""
+"To manufacture or assemble products, as well as using raw materials and "
+"finished product you must also handle manufacturing operations. "
+"Manufacturing operations are often called work orders. The different "
+"operations will have different impacts on the costs of manufacture and "
+"planning depending on the available workload."
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.module.module,shortdesc:mrp_operations.module_meta_information
+msgid "Work Center Production start end workflow"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_code_action
+msgid "Operation Codes"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,qty:0
+msgid "Qty"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_doneoperation0
+msgid "Operation Done"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.production.workcenter.line,production_state:0
+#: view:mrp.workorder:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Done"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.report.xml,name:mrp_operations.report_code_barcode
+msgid "Start/Stop Barcode"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+msgid "Cancel"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,help:mrp_operations.mrp_production_wc_action_form
+msgid ""
+"Work Orders is the list of operations to be performed for each manufacturing "
+"order. Once you start the first work order of a manufacturing order, the "
+"manufacturing order is automatically marked as started. Once you finish the "
+"latest operation of a manufacturing order, the MO is automatically done and "
+"the related products are produced."
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,name:mrp_operations.process_node_startoperation0
+msgid "Start Operation"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Information"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.report.xml,name:mrp_operations.report_wc_barcode
+msgid "Work Centers Barcode"
+msgstr ""
+
+#. module: mrp_operations
+#: constraint:stock.move:0
+msgid "You must assign a production lot for this product"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Late"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.workorder,delay:0
+msgid "Delay"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,production_id:0
+#: field:mrp_operations.operation,production_id:0
+msgid "Production"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Search Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp_operations.operation,workcenter_id:0
+#: model:process.node,name:mrp_operations.process_node_workorder0
+msgid "Work Center"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Real"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_planned:0
+msgid "Scheduled Date"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,product:0
+#: view:mrp.workorder:0
+#: field:mrp.workorder,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,total_hours:0
+msgid "Total Hours"
+msgstr ""
+
+#. module: mrp_operations
+#: help:mrp.production,allow_reorder:0
+msgid ""
+"Check this to be able to move independently all production orders, without "
+"moving dependent ones."
+msgstr ""
+
+#. module: mrp_operations
+#: report:mrp.code.barcode:0
+msgid ")"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.ui.menu,name:mrp_operations.menu_report_mrp_workorders_tree
+msgid "Work Order Analysis"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp.production.workcenter.line,state:0
+#: selection:mrp.workorder,state:0
+msgid "Finished"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,uom:0
+msgid "UOM"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Hours by Work Center"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,delay:0
+msgid "Working Hours"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,date_finished:0
+#: field:mrp.production.workcenter.line,date_planned_end:0
+#: field:mrp_operations.operation,date_finished:0
+msgid "End Date"
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "February"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_startcanceloperation0
+msgid "Operation cancelled"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_startoperation0
+msgid "Start the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "April"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_startdoneoperation0
+msgid "Operation done"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+msgid "#Line Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,note:mrp_operations.process_transition_startdoneoperation0
+msgid ""
+"When the operation is finished, the operator updates the system by finishing "
+"the work order."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "May"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.transition,name:mrp_operations.process_transition_workstartoperation0
+msgid "Details of the work order"
+msgstr ""
+
+#. module: mrp_operations
+#: field:mrp.production.workcenter.line,production_state:0
+msgid "Production State"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.workorder:0
+#: field:mrp.workorder,year:0
+msgid "Year"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Duration"
+msgstr ""
+
+#. module: mrp_operations
+#: constraint:mrp.production:0
+msgid "Order quantity cannot be negative or zero !"
+msgstr ""
+
+#. module: mrp_operations
+#: constraint:stock.move:0
+msgid "You try to assign a lot which is not from the same product"
+msgstr ""
+
+#~ msgid ""
+#~ "The Object name must start with x_ and not contain any special character !"
+#~ msgstr ""
+#~ "Името на обекта трябва да започва с \"x_\" и да не съдържа никакви специални "
+#~ "символи!"
+
+#~ msgid "Invalid XML for View Architecture!"
+#~ msgstr "Невалиден XML за преглед на архитектурата"
=== added file 'mrp_operations_ext/i18n/bs.po'
--- mrp_operations_ext/i18n/bs.po 1970-01-01 00:00:00 +0000
+++ mrp_operations_ext/i18n/bs.po 2012-04-26 18:16:21 +0000
@@ -0,0 +1,751 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * mrp_operations
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.0dev\n"
+"Report-Msgid-Bugs-To: support@xxxxxxxxxxx\n"
+"POT-Creation-Date: 2010-12-15 15:05+0000\n"
+"PO-Revision-Date: 2010-10-30 09:26+0000\n"
+"Last-Translator: Miro Glavić <glavicmiro@xxxxxxxxx>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-12-17 05:36+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_action_form
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_action_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_order
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+msgid "Work Orders"
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_canceloperation0
+msgid "Cancel the operation."
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.model,name:mrp_operations.model_mrp_operations_operation_code
+msgid "mrp_operations.operation.code"
+msgstr ""
+
+#. module: mrp_operations
+#: code:addons/mrp_operations/mrp_operations.py:0
+#, python-format
+msgid "Production Order Cannot start in [%s] state"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+#: view:mrp.workorder:0
+msgid "Group By..."
+msgstr ""
+
+#. module: mrp_operations
+#: model:process.node,note:mrp_operations.process_node_workorder0
+msgid "Information from the routing definition."
+msgstr ""
+
+#. module: mrp_operations
+#: selection:mrp.workorder,month:0
+msgid "March"
+msgstr ""
+
+#. module: mrp_operations
+#: model:ir.actions.act_window,name:mrp_operations.mrp_production_wc_resource_planning
+#: model:ir.ui.menu,name:mrp_operations.menu_mrp_production_wc_resource_planning
+msgid "Work Centers"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production:0
+#: view:mrp.production.workcenter.line:0
+#: selection:mrp_operations.operation.code,start_stop:0
+msgid "Resume"
+msgstr ""
+
+#. module: mrp_operations
+#: report:mrp.code.barcode:0
+msgid "("
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp.production.workcenter.line:0
+msgid "Product to Produce"
+msgstr ""
+
+#. module: mrp_operations
+#: view:mrp_operati
Follow ups