From 09e264921e39ebf40eedd16bece42c02f3dbc395 Mon Sep 17 00:00:00 2001 From: Berezi <82805447+Berezi@users.noreply.github.com> Date: Tue, 19 Mar 2024 09:27:18 +0100 Subject: [PATCH] [12.0][MIG] mrp_bom_import_wizard: (#251) Co-authored-by: Tu Nombre --- mrp_bom_import/__manifest__.py | 4 +- mrp_bom_import/i18n/es.po | 506 ++++++++++++-- mrp_bom_import/i18n/mrp_bom_import.pot | 442 ++++++++++-- mrp_bom_import/models/mrp_bom_import.py | 645 ++++++++++-------- .../views/mrp_bom_import_line_view.xml | 48 ++ mrp_bom_import/views/mrp_bom_import_view.xml | 185 +++++ mrp_bom_import/views/mrp_bom_line_view.xml | 25 + 7 files changed, 1453 insertions(+), 402 deletions(-) create mode 100644 mrp_bom_import/views/mrp_bom_import_line_view.xml create mode 100644 mrp_bom_import/views/mrp_bom_import_view.xml create mode 100644 mrp_bom_import/views/mrp_bom_line_view.xml diff --git a/mrp_bom_import/__manifest__.py b/mrp_bom_import/__manifest__.py index 414e6b2d7..7fed52a52 100644 --- a/mrp_bom_import/__manifest__.py +++ b/mrp_bom_import/__manifest__.py @@ -14,9 +14,11 @@ 'summary': '''MRP BoM Import''', 'website': 'http://www.avanzosc.es', 'data': [ - 'views/mrp_bom_view.xml', + 'views/mrp_bom_line_view.xml', 'views/product_view.xml', 'security/ir.model.access.csv', + 'views/mrp_bom_import_line_view.xml', + 'views/mrp_bom_import_view.xml', ], 'installable': True, 'auto_install': False, diff --git a/mrp_bom_import/i18n/es.po b/mrp_bom_import/i18n/es.po index 7564c6141..d6c81b784 100644 --- a/mrp_bom_import/i18n/es.po +++ b/mrp_bom_import/i18n/es.po @@ -1,14 +1,15 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * mrp_bom_import +# * mrp_bom_import # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-09-25 10:38+0000\n" -"PO-Revision-Date: 2019-09-25 10:38+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2024-01-23 10:02+0000\n" +"PO-Revision-Date: 2024-01-23 10:02+0000\n" +"Last-Translator: \n" + "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -16,54 +17,137 @@ msgstr "" "Plural-Forms: \n" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "BoM Ref: this will fill BoM Reference" +msgstr "BoM Ref: esto rellenará la Referencia de LdM" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Parent Code: this will fill Parent Product Code" +msgstr "" +"Parent Code: esto rellenará el Código del producto padre" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Parent Name: this will fill Parent Product Name" +msgstr "" +"Parent Name: esto rellenará el Nombre del producto padre" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Parent Qty: this will fill Parent Product Quantity" +msgstr "Parent Qty: esto rellenará la Cantidad del producto padre" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "" +"Product Code: this will fill Component Product Code" +msgstr "Product Code: esto rellenará el Código del componente" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "" +"Product Name: this will fill Component Product Name" +msgstr "" +"Product Name: esto rellenará el Nombre del componente" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Quantity: this will fill Component Quantity" +msgstr "Quantity: esto rellenará la Cantidad del componente" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form + msgid "BoMs" msgstr "LdMs" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form -msgid "Products" -msgstr "Productos" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_needaction +msgid "Action Needed" +msgstr "Acción requerida" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_ids +msgid "Activities" +msgstr "Actividades" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "Decoración de Actividad de Excepción" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_state +msgid "Activity State" +msgstr "Estado de la actividad" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_type_icon +msgid "Activity Type Icon" +msgstr "Ícono de tipo de actvidad" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_attachment_count +msgid "Attachment Count" +msgstr "Nº de archivos adjuntos" #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_id msgid "BoM" msgstr "LdM" +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__bom_line_import_ids +msgid "BoM Component Lines" +msgstr "Línea de componentes de LdM" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_import_id #: model:ir.ui.menu,name:mrp_bom_import.menu_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_tree -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_line_tree +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_line_component_import_view_tree + msgid "BoM Import" msgstr "Importar LdM" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__bom_import_lines -msgid "BoM Import Lines" -msgstr "Importar lineas LdM" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_line_id +msgid "BoM Line" +msgstr "Línea de LdM" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_code -msgid "BoM code" -msgstr "Codigo LdM" +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "BoM Lines" +msgstr "Líneas de LdM" #. module: mrp_bom_import -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:138 -#, python-format -msgid "Buy" -msgstr "" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_name +msgid "BoM Name" +msgstr "Nombre padre" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "BoM Product" +msgstr "Producto padre" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__category_id -msgid "Category" -msgstr "Categoría" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_ref +msgid "BoM Ref" +msgstr "Referencia de LdM" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__categ_name -msgid "Category name" -msgstr "Nombre categoría" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_code +msgid "BoM code" +msgstr "Código padre" + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +#, python-format +msgid "Component Import Lines" +msgstr "Importación de componentes" #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__create_uid @@ -80,30 +164,75 @@ msgstr "Creado el" #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__display_name #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__display_name +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_category__display_name +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_product__display_name + msgid "Display Name" msgstr "Nombre mostrado" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__map -msgid "Erection Drawing" -msgstr "Plano Montaje" +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Done" +msgstr "Procesado" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__error +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__error +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search + msgid "Error" msgstr "" #. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: BoM product not found." +msgstr "Error: Producto padre no encontrada." + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: More than one BoM product found." +msgstr "Error: Más de un producto padre encontrado." + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: More than one product found." +msgstr "Error: Más de un componente encontrado." + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: Product not found." +msgstr "Error: Componente no encontrado." + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: Quantity cannot be 0." +msgstr "Error: La cantidad no puede ser 0." + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: There is another line with the same parent product errors." +msgstr "Error: Hay otra línea para la misma LdM con errores." + +#. module: mrp_bom_import + #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__data msgid "File" msgstr "Archivo" #. module: mrp_bom_import -#: model:ir.ui.menu,name:mrp_bom_import.mrp_bom_import -msgid "File BoM Import" -msgstr "Importar archivo LdM" -#. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__file_date msgid "File Import Date" msgstr "Fecha importación archivo" @@ -113,30 +242,105 @@ msgstr "Fecha importación archivo" msgid "Filename" msgstr "Nombre de archivo" +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_follower_ids +msgid "Followers" +msgstr "Seguidores" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_channel_ids +msgid "Followers (Channels)" +msgstr "Seguidores (Canales)" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_partner_ids +msgid "Followers (Partners)" +msgstr "Seguidores (Contactos)" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "Icono de Font Awesome ej. fa-tasks" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Group By" +msgstr "Agrupar por" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Help" +msgstr "Ayuda" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Help with Excel column names" +msgstr "Ayuda con los nombres de columnas de Excel" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__id #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__id +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_category__id +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_product__id msgid "ID" -msgstr "" +msgstr "Identificador" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_exception_icon +msgid "Icon" +msgstr "Icono" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "Icono para indicar una actividad de excepción." + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_needaction +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_unread +msgid "If checked, new messages require your attention." +msgstr "Si está marcado hay nuevos mensajes que requieren su atención." + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_has_error +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_has_sms_error +msgid "If checked, some messages have a delivery error." +msgstr "Si se encuentra marcado, algunos mensajes tienen error de envío." + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form + msgid "Import" msgstr "Importar" #. module: mrp_bom_import +#: model:ir.model,name:mrp_bom_import.model_mrp_bom_import +msgid "Import BoM from excel file" +msgstr "Importar LdM de fichero excel" + +#. module: mrp_bom_import +#: model:ir.model,name:mrp_bom_import.model_mrp_bom_line_import +msgid "Import BoM lines" +msgstr "Lineas de importador de LdM" + +#. module: mrp_bom_import + #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__name msgid "Import name" msgstr "Nombre importación" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__state -msgid "Import state" -msgstr "Estado" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_is_follower +msgid "Is Follower" +msgstr "Es un seguidor" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import____last_update #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import____last_update +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_category____last_update +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_product____last_update + msgid "Last Modified on" msgstr "Última modificación en" @@ -153,20 +357,40 @@ msgid "Last Updated on" msgstr "Última actualización el" #. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Lines" +msgstr "Líneas" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Log" +msgstr "Registro" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__log_info #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__log_info +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search + msgid "Log Info" msgstr "Info log." #. module: mrp_bom_import #: model:ir.actions.act_window,name:mrp_bom_import.mrp_bom_import_act +#: model:ir.ui.menu,name:mrp_bom_import.mrp_bom_import + msgid "MRP BoM Import" msgstr "MRP Importación LdM" #. module: mrp_bom_import -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:135 -#, python-format -msgid "Manufacture" -msgstr "" +#: model:ir.actions.act_window,name:mrp_bom_import.mrp_bom_line_action +msgid "MRP BoM Lines" +msgstr "MRP líneas de LdM" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_main_attachment_id +msgid "Main Attachment" +msgstr "Adjuntos principales" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_product_product__map_number @@ -174,17 +398,90 @@ msgid "Map Number" msgstr "Plano montaje" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__origin -msgid "Origin" -msgstr "Origen" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_has_error +msgid "Message Delivery error" +msgstr "Error de Envío de Mensaje" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_ids +msgid "Messages" +msgstr "Mensajes" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "Mi fecha límite de actividad" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "Siguiente plazo de actividad" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_summary +msgid "Next Activity Summary" +msgstr "Resumen de la siguiente actividad" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_type_id +msgid "Next Activity Type" +msgstr "Siguiente tipo de actividad" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_needaction_counter +msgid "Number of Actions" +msgstr "Número de acciones" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_has_error_counter +msgid "Number of errors" +msgstr "Numero de errores" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "Número de mensajes que requieren una acción" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "Número de mensajes con error de envío" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_unread_counter +msgid "Number of unread messages" +msgstr "Número de mensajes no leidos" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__parent_product_bom_count +msgid "Parent Bom Qty" +msgstr "Recuento de BoMs" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_product_id +msgid "Parent Product" +msgstr "Producto padre" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__parent_qty +msgid "Parent Quantity" +msgstr "Cantidad padre" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Pending" +msgstr "Pendiente" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form + msgid "Process" msgstr "Procesar" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__done +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__done + msgid "Processed" msgstr "Procesado" @@ -192,34 +489,65 @@ msgstr "Procesado" #: model:ir.model,name:mrp_bom_import.model_product_product #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__product_id msgid "Product" -msgstr "Producto" +msgstr "Componente" + #. module: mrp_bom_import #: model:ir.model,name:mrp_bom_import.model_product_category msgid "Product Category" msgstr "Categoría de producto" +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__product_found_by_code +msgid "Product Found By Code" +msgstr "Buscar productos por referencia" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__product_ref msgid "Product code" -msgstr "Código producto" +msgstr "Código componente" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__product_name msgid "Product name" -msgstr "Nombre producto" - -#. module: mrp_bom_import -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:57 -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:74 -#, python-format -msgid "Products" -msgstr "" +msgstr "Nombre componente" #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__quantity msgid "Quantity" -msgstr "Cantidad" +msgstr "Cantidad componente" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_user_id +msgid "Responsible User" +msgstr "Usuario responsable" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_has_sms_error +msgid "SMS Delivery error" +msgstr "Error de entrega de SMS" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__state +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__state +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Status" +msgstr "Estado" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" +"Estado basado en actividades\n" +"Vencida: la fecha tope ya ha pasado\n" +"Hoy: La fecha tope es hoy\n" +"Planificada: futuras actividades." + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_product_category__supplier_id @@ -227,7 +555,16 @@ msgid "Supplier" msgstr "Proveedor" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "This is not a valid file." +msgstr "No es un archivo válido." + +#. module: mrp_bom_import +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__2validate +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__2validate + msgid "To validate" msgstr "Para validar" @@ -237,32 +574,51 @@ msgid "Total BoMs" msgstr "Total LdMs" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__products_count -msgid "Total Products" -msgstr "Total productos" +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "Tipo de actividad de excepción registrada." #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_unread +msgid "Unread Messages" +msgstr "Mensajes sin leer" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_unread_counter +msgid "Unread Messages Counter" +msgstr "Nº de mensajes sin leer" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form + msgid "Validate" msgstr "Validar" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__pass +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__pass + msgid "Validated" msgstr "Validado" #. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__website_message_ids +msgid "Website Messages" +msgstr "Mensajes del sitio web" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__website_message_ids +msgid "Website communication history" +msgstr "Historial de comunicaciones del sitio web" + +#. module: mrp_bom_import + #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__weight msgid "Weight" msgstr "Peso" #. module: mrp_bom_import -#: model:ir.model,name:mrp_bom_import.model_mrp_bom_import -msgid "mrp.bom.import" -msgstr "" - -#. module: mrp_bom_import -#: model:ir.model,name:mrp_bom_import.model_mrp_bom_line_import -msgid "mrp.bom.line.import" -msgstr "" +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "You must use this column names in order to fill the table:" +msgstr "Debe usar las siguientes columnas para rellenar la tabla:" diff --git a/mrp_bom_import/i18n/mrp_bom_import.pot b/mrp_bom_import/i18n/mrp_bom_import.pot index 4c54735df..5c6814624 100644 --- a/mrp_bom_import/i18n/mrp_bom_import.pot +++ b/mrp_bom_import/i18n/mrp_bom_import.pot @@ -1,14 +1,15 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * mrp_bom_import +# * mrp_bom_import # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-09-25 10:38+0000\n" -"PO-Revision-Date: 2019-09-25 10:38+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2024-01-23 10:02+0000\n" +"PO-Revision-Date: 2024-01-23 10:02+0000\n" +"Last-Translator: \n" + "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -16,13 +17,77 @@ msgstr "" "Plural-Forms: \n" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "BoM Ref: this will fill BoM Reference" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Parent Code: this will fill Parent Product Code" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Parent Name: this will fill Parent Product Name" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Parent Qty: this will fill Parent Product Quantity" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "" +"Product Code: this will fill Component Product Code" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "" +"Product Name: this will fill Component Product Name" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Quantity: this will fill Component Quantity" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form + msgid "BoMs" msgstr "" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form -msgid "Products" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_ids +msgid "Activities" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_state +msgid "Activity State" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_attachment_count +msgid "Attachment Count" + msgstr "" #. module: mrp_bom_import @@ -30,39 +95,56 @@ msgstr "" msgid "BoM" msgstr "" +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__bom_line_import_ids +msgid "BoM Component Lines" +msgstr "" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_import_id #: model:ir.ui.menu,name:mrp_bom_import.menu_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_tree -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_line_tree +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_line_component_import_view_tree + msgid "BoM Import" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__bom_import_lines -msgid "BoM Import Lines" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_line_id +msgid "BoM Line" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_code -msgid "BoM code" +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "BoM Lines" msgstr "" #. module: mrp_bom_import -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:138 -#, python-format -msgid "Buy" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_name +msgid "BoM Name" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "BoM Product" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_ref +msgid "BoM Ref" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__category_id -msgid "Category" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_code +msgid "BoM code" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__categ_name -msgid "Category name" +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +#, python-format +msgid "Component Import Lines" msgstr "" #. module: mrp_bom_import @@ -80,27 +162,69 @@ msgstr "" #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__display_name #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__display_name +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_category__display_name +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_product__display_name msgid "Display Name" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__map -msgid "Erection Drawing" +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Done" msgstr "" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__error +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__error +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search + msgid "Error" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__data -msgid "File" +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: BoM product not found." msgstr "" #. module: mrp_bom_import -#: model:ir.ui.menu,name:mrp_bom_import.mrp_bom_import -msgid "File BoM Import" +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: More than one BoM product found." +msgstr "" + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: More than one product found." +msgstr "" + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: Product not found." +msgstr "" + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: Quantity cannot be 0." +msgstr "" + +#. module: mrp_bom_import +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "Error: There is another line with the same parent product errors." +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__data +msgid "File" msgstr "" #. module: mrp_bom_import @@ -113,30 +237,101 @@ msgstr "" msgid "Filename" msgstr "" +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_channel_ids +msgid "Followers (Channels)" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Group By" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Help" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Help with Excel column names" +msgstr "" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__id #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__id +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_category__id +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_product__id msgid "ID" msgstr "" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_needaction +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_unread +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_has_error +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_has_sms_error +msgid "If checked, some messages have a delivery error." +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form msgid "Import" msgstr "" +#. module: mrp_bom_import +#: model:ir.model,name:mrp_bom_import.model_mrp_bom_import +msgid "Import BoM from excel file" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model,name:mrp_bom_import.model_mrp_bom_line_import +msgid "Import BoM lines" +msgstr "" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__name msgid "Import name" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__state -msgid "Import state" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_is_follower +msgid "Is Follower" msgstr "" #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import____last_update #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import____last_update +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_category____last_update +#: model:ir.model.fields,field_description:mrp_bom_import.field_product_product____last_update msgid "Last Modified on" msgstr "" @@ -153,19 +348,36 @@ msgid "Last Updated on" msgstr "" #. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Lines" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "Log" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__log_info #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__log_info +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search msgid "Log Info" msgstr "" #. module: mrp_bom_import #: model:ir.actions.act_window,name:mrp_bom_import.mrp_bom_import_act +#: model:ir.ui.menu,name:mrp_bom_import.mrp_bom_import msgid "MRP BoM Import" msgstr "" #. module: mrp_bom_import -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:135 -#, python-format -msgid "Manufacture" +#: model:ir.actions.act_window,name:mrp_bom_import.mrp_bom_line_action +msgid "MRP BoM Lines" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_main_attachment_id +msgid "Main Attachment" msgstr "" #. module: mrp_bom_import @@ -174,17 +386,88 @@ msgid "Map Number" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__origin -msgid "Origin" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_ids +msgid "Messages" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__my_activity_date_deadline +msgid "My Activity Deadline" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_has_error_counter +msgid "Number of errors" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__parent_product_bom_count +msgid "Parent Bom Qty" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__bom_product_id +msgid "Parent Product" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__parent_qty +msgid "Parent Quantity" msgstr "" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Pending" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form msgid "Process" msgstr "" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__done +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__done msgid "Processed" msgstr "" @@ -199,6 +482,11 @@ msgstr "" msgid "Product Category" msgstr "" +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__product_found_by_code +msgid "Product Found By Code" +msgstr "" + #. module: mrp_bom_import #: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__product_ref msgid "Product code" @@ -210,15 +498,34 @@ msgid "Product name" msgstr "" #. module: mrp_bom_import -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:57 -#: code:addons/mrp_bom_import/models/mrp_bom_import.py:74 -#, python-format -msgid "Products" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__quantity +msgid "Quantity" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__quantity -msgid "Quantity" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_has_sms_error +msgid "SMS Delivery error" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__state +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__state +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.bom_import_line_view_search +msgid "Status" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." msgstr "" #. module: mrp_bom_import @@ -227,7 +534,15 @@ msgid "Supplier" msgstr "" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#: code:addons/mrp_bom_import/models/mrp_bom_import.py:0 +#, python-format +msgid "This is not a valid file." +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__2validate +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__2validate msgid "To validate" msgstr "" @@ -237,32 +552,47 @@ msgid "Total BoMs" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__products_count -msgid "Total Products" +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__activity_exception_decoration +msgid "Type of the exception activity on record." msgstr "" #. module: mrp_bom_import -#: model_terms:ir.ui.view,arch_db:mrp_bom_import.view_mrp_bom_import_form +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: mrp_bom_import +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form msgid "Validate" msgstr "" #. module: mrp_bom_import -#: selection:mrp.bom.line.import,state:0 +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_import__state__pass +#: model:ir.model.fields.selection,name:mrp_bom_import.selection__mrp_bom_line_import__state__pass msgid "Validated" msgstr "" #. module: mrp_bom_import -#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__weight -msgid "Weight" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_import__website_message_ids +msgid "Website Messages" msgstr "" #. module: mrp_bom_import -#: model:ir.model,name:mrp_bom_import.model_mrp_bom_import -msgid "mrp.bom.import" +#: model:ir.model.fields,help:mrp_bom_import.field_mrp_bom_import__website_message_ids +msgid "Website communication history" msgstr "" #. module: mrp_bom_import -#: model:ir.model,name:mrp_bom_import.model_mrp_bom_line_import -msgid "mrp.bom.line.import" +#: model:ir.model.fields,field_description:mrp_bom_import.field_mrp_bom_line_import__weight +msgid "Weight" msgstr "" +#. module: mrp_bom_import +#: model_terms:ir.ui.view,arch_db:mrp_bom_import.mrp_bom_import_view_form +msgid "You must use this column names in order to fill the table:" +msgstr "" diff --git a/mrp_bom_import/models/mrp_bom_import.py b/mrp_bom_import/models/mrp_bom_import.py index b3f8aaf67..5653b8147 100644 --- a/mrp_bom_import/models/mrp_bom_import.py +++ b/mrp_bom_import/models/mrp_bom_import.py @@ -1,13 +1,17 @@ -# Copyright (c) 2019 Daniel Campos - Avanzosc S.L. +# Copyright 2019 Daniel Campos - Avanzosc S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models, exceptions, api, _ import base64 -import tempfile -import math + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError +from odoo.models import expression +from odoo.tools.safe_eval import safe_eval try: import xlrd + + try: from xlrd import xlsx except ImportError: @@ -16,289 +20,390 @@ xlrd = xlsx = None +def check_number(number): + try: + if isinstance(number, float) or isinstance(number, int): + return number + if "." in number: + val = float(number) + else: + val = int(number) + return val + except ValueError: + return False + +def convert2str(value): + if isinstance(value, float) or isinstance(value, int): + new_value = str(value).strip() + if "." in new_value: + new_value = new_value[: new_value.index(".")] + return new_value.strip(" \n\t") + elif isinstance(value, tuple): + return value[0].strip(" \n\t") + else: + return value.strip(" \n\t") + + +IMPORT_STATUS = [ + ("2validate", "To validate"), + ("pass", "Validated"), + ("error", "Error"), + ("done", "Processed"), +] + + class MrpBomImport(models.Model): - _name = 'mrp.bom.import' + _name = "mrp.bom.import" + _description = "Import BoM from excel file" + _order = "file_date desc" + _inherit = ["mail.thread", "mail.activity.mixin"] - @api.multi - @api.depends('filename', 'file_date') - def _get_import_name(self): + name = fields.Char( + string="Import name", + compute="_compute_import_name", + copy=False, + ) + bom_count = fields.Integer( + compute="_compute_bom_count", + string="Total BoMs", + ) + data = fields.Binary( + string="File", + required=True, + copy=False, + ) + filename = fields.Char( + string="Filename", + copy=False, + ) + file_date = fields.Date( + string="File Import Date", + required=True, + default=fields.Date.context_today, + copy=False, + ) + bom_line_import_ids = fields.One2many( + comodel_name="mrp.bom.line.import", + inverse_name="bom_import_id", + string="BoM Component Lines", + copy=False, + ) + state = fields.Selection( + selection=IMPORT_STATUS, + compute="_compute_state", + string="Status", + ) + log_info = fields.Text( + string="Log Info", + compute="_compute_log_info", + ) + product_found_by_code = fields.Boolean( + string="Product Found By Code", + default=False) + + def _get_import_lines(self): + return self.mapped("bom_line_import_ids") + + @api.depends("filename", "file_date") + def _compute_import_name(self): for file_import in self: - file_import.name = u'{} - {}'.format(file_import.filename, - file_import.file_date) - products_count = fields.Float(compute='_compute_products_count', - string='Total Products') - bom_count = fields.Float(compute='_compute_products_count', - string='Total BoMs') - name = fields.Char(string='Import name', compute='_get_import_name') - data = fields.Binary('File', required=True) - filename = fields.Char('Filename') - file_date = fields.Date(string="File Import Date", required=True, - default=fields.Date.context_today) - bom_import_lines = fields.One2many( - comodel_name='mrp.bom.line.import', inverse_name='bom_import_id', - string='BoM Import Lines' + file_import.name = "{} - {}".format( + file_import.filename, file_import.file_date + ) + + @api.depends( + "bom_line_import_ids", + "bom_line_import_ids.product_id", + "bom_line_import_ids.bom_id", ) + def _compute_bom_count(self): + for bom_import in self: + lines = bom_import._get_import_lines() + bom_import.bom_count = len(lines.mapped("bom_id")) - @api.multi - def _compute_products_count(self): - if self.bom_import_lines: - self.products_count = len( - set(self.mapped("bom_import_lines.product_id").ids)) - self.bom_count = len( - set(self.mapped("bom_import_lines.bom_id").ids)) - return {} - - @api.multi - def action_bom_import_products(self): - views = [ - (self.env.ref('product.product_product_tree_view').id, 'tree'), - (self.env.ref('product.product_normal_form_view').id, 'form')] - return { - 'name': _('Products'), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'product.product', - 'view_id': False, - 'views': views, - 'type': 'ir.actions.act_window', - 'domain': [('id', 'in', - self.bom_import_lines.mapped("product_id").ids)], - } + @api.depends( + "bom_line_import_ids", + "bom_line_import_ids.state", + ) + def _compute_state(self): + for bom_import in self: + lines = bom_import._get_import_lines() + line_states = lines.mapped("state") + if line_states and any([state == "error" for state in line_states]): + bom_import.state = "error" + elif line_states and all([state == "done" for state in line_states]): + bom_import.state = "done" + elif line_states and all([state == "pass" for state in line_states]): + bom_import.state = "pass" + else: + bom_import.state = "2validate" + + @api.depends( + "bom_line_import_ids", + "bom_line_import_ids.log_info", + ) + def _compute_log_info(self): + for bom_import in self: + lines = bom_import._get_import_lines() + logged_lines = lines.filtered("log_info") + if logged_lines: + bom_import.log_info = "\n".join(logged_lines.mapped("log_info")) + else: + bom_import.log_info = "" - @api.multi def action_bom_import_boms(self): - views = [ - (self.env.ref('mrp.mrp_bom_tree_view').id, 'tree'), - (self.env.ref('mrp.mrp_bom_form_view').id, 'form')] - return { - 'name': _('Products'), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'mrp.bom', - 'view_id': False, - 'views': views, - 'type': 'ir.actions.act_window', - 'domain': [('id', 'in', - self.bom_import_lines.mapped("bom_id").ids)], - } + action = self.env.ref("mrp.mrp_bom_form_action") + action_dict = action and action.read()[0] + lines = self._get_import_lines() + domain = expression.AND( + [ + [("id", "in", lines.mapped("bom_id").ids)], + safe_eval(action.domain or "[]"), + ] + ) + action_dict.update({"domain": domain}) + return action_dict - def check_number(self, number): - try: - if isinstance(number, float) or isinstance(number, int): - return number - if "." in number: - val = float(number) - else: - val = int(number) - return val - except ValueError: - return False - - def float2string(self, number): - if isinstance(number, float): - if math.fmod(number, 1) == 0.0: - return str(number).replace('.0', '') - return str(number) - - def check_product(self, name, default_code, weight=False, map_number=False, - category_id=False, origin=False): - product_obj = self.env['product.product'] - product_category = self.env['product.category'] - supplierinfo_obj = self.env['product.supplierinfo'] - route_obj = self.env['stock.location.route'] - wh_obj = self.env['stock.warehouse'] - if not name and not default_code: - return False - sub_name = product = False - if default_code: - sub_name = product_obj.search([('name', 'ilike', default_code)], - limit=1) - product = product_obj.search([('default_code', '=', default_code)], - limit=1) - if sub_name: - return False - if not product and name: - product = product_obj.search(([('name', '=', name)]), limit=1) - if not product: - vals = {'name': name, - 'default_code': default_code, - 'type': 'product', - 'weight': weight, - 'map_number': map_number, - } - if category_id: - vals['categ_id'] = category_id - if origin and (origin == 'F' or origin == 'C'): - if origin == 'F': - route_id = wh_obj._find_global_route( - 'mrp.route_warehouse0_manufacture', - _('Manufacture')).id - if origin == 'C': - route_id = wh_obj._find_global_route( - 'purchase_stock.route_warehouse0_buy', _('Buy')).id - vals['route_ids'] = [(6, 0, [route_id])] - product = product_obj.create(vals) - if category_id: - category = product_category.browse(category_id) - if category.supplier_id: - sup_info = supplierinfo_obj.search( - [('product_id', '=', product.id), - ('product_tmpl_id', '=', product.product_tmpl_id.id), - ('name', '=', category.supplier_id.id)]) - if not sup_info: - supplierinfo_obj.create( - {'product_id': product.id, - 'product_tmpl_id': product.product_tmpl_id.id, - 'name': category.supplier_id.id}) - return product.id - - def check_categ(self, name): - product_categ_obj = self.env['product.category'] - if not name: - return False - categ_lst = product_categ_obj.search([('name', '=', name)], limit=1) - if not categ_lst: - return False - else: - return categ_lst.id + def action_bom_import_bom_lines(self): + action = self.env.ref("mrp_bom_import.mrp_bom_line_action") + action_dict = action and action.read()[0] + lines = self._get_import_lines() + domain = expression.AND( + [ + [("id", "in", lines.mapped("bom_line_id").ids)], + safe_eval(action.domain or "[]"), + ] + ) + action_dict.update({"domain": domain}) + return action_dict def action_import_bom(self): - for line in self.bom_import_lines: - line.unlink() - """Load BoM lines data from the xls file.""" - file_1 = base64.decodestring(self.data) - (fileno, fp_name) = tempfile.mkstemp('.xls', 'odoo_') - outFile = open(fp_name, 'wb') - outFile.write(file_1) - outFile.close() - reader = xlrd.open_workbook(fp_name) - sheet = reader.sheet_by_index(0) - ctx = self.env.context - bom_import_line_obj = self.env['mrp.bom.line.import'] - keys = ['null', 'item', 'qty', 'code', 'map', 'name', 'weight', - 'qty_total', 'denomination', 'weight2', 'parent_code', - 'origin', 'category' - ] - reader.nrow = 10 - for counter in range(9, sheet.nrows-1): - # grab the current row - rowValues = sheet.row_values(counter+1, 0, end_colx=sheet.ncols) - values = dict(zip(keys, rowValues)) - line_data = { - 'bom_import_id': self.id, - 'product_name': values['name'], - 'quantity': self.check_number(values['qty']) or 0, - 'product_ref': self.float2string(values['code']), - 'map': self.float2string(values['map']), - 'weight': self.check_number(values['weight']) or 0, - 'origin': values['origin'], - 'bom_code': values['parent_code'], - 'categ_name': values['category'], - } - try: - bom_import_line_obj.create(line_data) - except Exception as error: - raise exceptions.Warning(u"Line Error: \n") + self.ensure_one() + (self._get_import_lines()).unlink() + book = base64.decodebytes(self.data) + reader = xlrd.open_workbook(file_contents=book) + try: + sheet_list = reader.sheet_names() + for sheet_name in sheet_list: + sheet = reader.sheet_by_name(sheet_name) + bom_import_line_obj = self.env["mrp.bom.line.import"] + keys = [c.value for c in sheet.row(0)] + for counter in range(1, sheet.nrows): + row_values = sheet.row_values(counter, 0, end_colx=sheet.ncols) + values = dict(zip(keys, row_values)) + line_data = self._get_line_values(values) + if line_data: + bom_import_line_obj.create(line_data) + except Exception: + raise ValidationError(_("This is not a valid file.")) + + def _get_line_values(self, row_values): + self.ensure_one() + if ( + not row_values.get("Product Name") + and not row_values.get("Product Code") + and not row_values.get("Quantity", 1) + ): + return {} + values = { + "bom_ref": convert2str(row_values.get("BoM Ref", "")), + "product_name": convert2str(row_values.get("Product Name", "")), + "product_ref": convert2str(row_values.get("Product Code", "")), + "quantity": check_number(row_values.get("Quantity", 1)), + "bom_code": convert2str(row_values.get("Parent Code", "")), + "bom_name": convert2str(row_values.get("Parent Name", "")), + "parent_qty": check_number(row_values.get("Parent Qty", 1)), + } + values.update( + { + "bom_import_id": self.id, + } + ) + return values def action_validate_lines(self): - product_obj = self.env['product.product'] - bom_obj = self.env['mrp.bom'] - for line in self.bom_import_lines.filtered( - lambda x: x.state not in ('done', 'pass')): - category_id = False - if line.categ_name: - category_id = self.check_categ(line.categ_name) - if category_id: - line.category_id = category_id - if not category_id: - line.state = 'error' - line.log_info = 'Error: Category not found' - continue - if not line.product_id and (line.product_ref or line.product_name): - product_id = self.check_product(line.product_name, - line.product_ref, - line.weight, - line.map, - line.category_id.id, - line.origin - ) - line.product_id = product_id - line.state = 'pass' - elif line.product_id: - line.state = 'pass' - else: - line.state = 'error' - line.log_info = 'Error: Cannot assign product' - continue - if line.bom_code: - bom = bom_obj.search([('code', '=', line.bom_code)]) - if bom: - line.state = 'error' - line.log_info = 'Error: BoM already exist' - continue - bom_product = product_obj.search([('default_code', '=', - line.bom_code)]) - if not bom_product: - line.state = 'error' - line.log_info = 'Error: BoM product does not exist' - continue - if not line.quantity: - line.state = 'error' - line.log_info = 'Error: Quantity cannot be 0' + lines = (self._get_import_lines()).filtered( + lambda x: x.state not in ("done")) + lines.action_validate_lines() def action_process_lines(self): - bom_obj = self.env['mrp.bom'] - bom_line_obj = self.env['mrp.bom.line'] - product_obj = self.env['product.product'] - for line in self.bom_import_lines.filtered( - lambda x: x.state == 'pass'): - bom_product = product_obj.search( - [('default_code', '=', line.bom_code)], limit=1) - if not bom_product: - line.state = 'error' - line.log_info = 'Error: BoM product does not exist' - break - bom = bom_obj.search( - [('code', '=', line.bom_code)], limit=1) - if not bom: - bom = bom_obj.create( - {'code': line.bom_code, - 'product_tmpl_id': bom_product.product_tmpl_id.id, - 'product_id': bom_product.id}) - bom_line = bom_line_obj.search( - [('product_id', '=', line.product_id.id), - ('bom_id', '=', bom.id)], limit=1) - if not bom_line: - bom_line = bom_line_obj.create( - {'product_id': line.product_id.id, - 'product_qty': line.quantity, 'bom_id': bom.id}) - line.bom_id = bom.id - line.state = 'done' - line.log_info = '' + lines = (self._get_import_lines()).filtered( + lambda x: x.state == "pass") + lines.action_process_lines() + + def button_open_bom_component_import_line(self): + self.ensure_one() + return { + "name": _("Component Import Lines"), + "type": "ir.actions.act_window", + "res_model": self.bom_line_import_ids._name, + "view_mode": "tree", + "view_id": self.env.ref( + "mrp_bom_import.mrp_bom_line_component_import_view_tree" + ).id, + "target": "current", + "domain": [("id", "in", self.bom_line_import_ids.ids)], + "context": { + "default_bom_import_id": self.id, + }, + } class MrpBomLineImport(models.Model): - _name = 'mrp.bom.line.import' + _name = "mrp.bom.line.import" + _description = "Import BoM lines" bom_import_id = fields.Many2one( - comodel_name='mrp.bom.import', string='BoM Import', ondelete='cascade', - required=True) - quantity = fields.Float(string='Quantity') - product_name = fields.Char(string='Product name') - product_ref = fields.Char(string='Product code') - product_id = fields.Many2one('product.product', string='Product') - weight = fields.Float(string='Weight') - origin = fields.Char(string='Origin') - map = fields.Char(string='Erection Drawing') - bom_code = fields.Char(string='BoM code') - bom_id = fields.Many2one('mrp.bom', string='BoM') - categ_name = fields.Char(string='Category name') - category_id = fields.Many2one('product.category', string='Category') - log_info = fields.Text(string='Log Info') - state = fields.Selection([ - ('2validate', 'To validate'), - ('pass', 'Validated'), - ('error', 'Error'), - ('done', 'Processed')], - string='Import state', default='2validate' + comodel_name="mrp.bom.import", + string="BoM Import", + ondelete="cascade", ) + product_name = fields.Char(string="Product name") + product_ref = fields.Char(string="Product code") + product_id = fields.Many2one( + comodel_name="product.product", + string="Product", + ) + quantity = fields.Float(string="Quantity") + bom_ref = fields.Char(string="BoM Ref") + bom_code = fields.Char(string="BoM code") + bom_name = fields.Char(string="BoM Name") + bom_product_id = fields.Many2one( + string="Parent Product", + comodel_name="product.product") + bom_id = fields.Many2one( + comodel_name="mrp.bom", + string="BoM", + ) + bom_line_id = fields.Many2one( + string="BoM Line", + comodel_name="mrp.bom.line") + log_info = fields.Text(string="Log Info") + state = fields.Selection( + selection=IMPORT_STATUS, + string="Status", + default="2validate", + ) + parent_product_bom_count = fields.Integer( + string="Parent Bom Qty", + related="bom_product_id.bom_count", + store=True) + parent_qty = fields.Float(string="Parent Quantity") + + def _check_product(self): + self.ensure_one() + log_info = "" + if self.product_id: + return self.product_id, log_info + product_obj = self.env["product.product"] + search_domain = [("name", "=", self.product_name)] + if self.product_ref: + search_domain = expression.AND( + [[("default_code", "=", self.product_ref)], search_domain] + ) + if self.bom_import_id.product_found_by_code: + search_domain = [("default_code", "=", self.product_ref)] + products = product_obj.search(search_domain) + if not products: + products = False + log_info = _("Error: Product not found.") + elif len(products) != 1: + products = False + log_info = _("Error: More than one product found.") + return products, log_info + + def _check_bom_product(self): + self.ensure_one() + log_info = "" + if self.bom_product_id: + return self.bom_product_id, log_info + product_obj = self.env["product.product"] + search_domain = [("name", "=", self.bom_name)] + if self.bom_code: + search_domain = expression.AND( + [[("default_code", "=", self.bom_code)], search_domain] + ) + if self.bom_import_id.product_found_by_code: + search_domain = [("default_code", "=", self.bom_code)] + products = product_obj.search(search_domain) + if not products: + products = False + log_info = _("Error: BoM product not found.") + elif len(products) != 1: + products = False + log_info = _("Error: More than one BoM product found.") + return products, log_info + + def action_validate_lines(self): + for line in self.filtered(lambda x: x.state not in ("done")): + line_vals = {} + log_info = "" + product = bom_product = bom = False + product, product_log_info = line._check_product() + if product_log_info: + log_info += product_log_info + bom_product, bom_product_log_info = line._check_bom_product() + if bom_product_log_info: + log_info += bom_product_log_info + if not line.quantity: + log_info += _("Error: Quantity cannot be 0.") + state = "error" if log_info else "pass" + line_vals.update( + { + "product_id": product and product.id, + "bom_product_id": bom_product and bom_product.id, + "bom_id": bom and bom.id, + "state": state, + "log_info": log_info, + } + ) + line.write(line_vals) + + def _create_bom(self): + self.ensure_one() + bom = self.env["mrp.bom"].create({ + "product_tmpl_id": self.bom_product_id.product_tmpl_id.id, + "code": self.bom_ref, + "product_qty": self.parent_qty, + "product_uom_id": self.bom_product_id.uom_id.id}) + return bom + + def generate_bom_line_values(self): + self.ensure_one() + bom_line = { + "product_id": self.product_id.id, + "product_qty": self.quantity, + "product_uom_id": self.product_id.uom_id.id} + return bom_line + + def action_process_lines(self): + bom_product = [] + for line in self.filtered(lambda x: x.state == "pass"): + log_info = "" + bom = False + if not line.bom_id and line.bom_product_id and line.bom_product_id not in bom_product: + state = "2validate" + same_parent = line.bom_import_id.bom_line_import_ids.filtered( + lambda c: c.bom_product_id == line.bom_product_id) + if any([state.state == "error" for state in same_parent]): + log_info = _("Error: There is another line with the " + + "same parent product errors.") + state = "error" + else: + bom = line._create_bom() + for l in same_parent: + bom_line_values = l.generate_bom_line_values() + bom_line_values.update({"bom_id": bom.id}) + bom_line = self.env["mrp.bom.line"].create( + bom_line_values) + l.write({ + "bom_id": bom.id, + "bom_line_id": bom_line.id, + "state": "done"}) + state = "done" + line.write( + { + "state": state, + "log_info": log_info, + } + ) diff --git a/mrp_bom_import/views/mrp_bom_import_line_view.xml b/mrp_bom_import/views/mrp_bom_import_line_view.xml new file mode 100644 index 000000000..0edbab6d2 --- /dev/null +++ b/mrp_bom_import/views/mrp_bom_import_line_view.xml @@ -0,0 +1,48 @@ + + + + mrp.bom.line.import + + + + + + + + + + + + + + + + + diff --git a/mrp_bom_import/views/mrp_bom_import_view.xml b/mrp_bom_import/views/mrp_bom_import_view.xml new file mode 100644 index 000000000..f7195bde7 --- /dev/null +++ b/mrp_bom_import/views/mrp_bom_import_view.xml @@ -0,0 +1,185 @@ + + + + mrp.bom.import + + + + + + + + + + + + mrp.bom.import + +
+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + +
+

Help with Excel column names

+

You must use this column names in order to fill the table:

+
    +
  • Product Code: this will fill Component Product Code
  • +
  • Product Name: this will fill Component Product Name
  • +
  • Quantity: this will fill Component Quantity
  • +
  • Parent Code: this will fill Parent Product Code
  • +
  • Parent Name: this will fill Parent Product Name
  • +
  • Parent Qty: this will fill Parent Product Quantity
  • +
  • BoM Ref: this will fill BoM Reference
  • +
+
+
+
+
+ +
+
+
+
+ + + mrp.bom.line.import + + + + + + + + + + + + + + + + + + + + + + MRP BoM Import + ir.actions.act_window + mrp.bom.import + tree,form + + + + + + +
diff --git a/mrp_bom_import/views/mrp_bom_line_view.xml b/mrp_bom_import/views/mrp_bom_line_view.xml new file mode 100644 index 000000000..6748197a9 --- /dev/null +++ b/mrp_bom_import/views/mrp_bom_line_view.xml @@ -0,0 +1,25 @@ + + + + + mrp.bom.line.tree + mrp.bom.line + + + + + + + + + + + + MRP BoM Lines + ir.actions.act_window + mrp.bom.line + tree,form + + + +