diff --git a/fieldservice_stock/README.rst b/fieldservice_stock/README.rst new file mode 100644 index 0000000000..9a6fcdb3da --- /dev/null +++ b/fieldservice_stock/README.rst @@ -0,0 +1,138 @@ +===================== +Field Service - Stock +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github + :target: https://github.com/OCA/field-service/tree/12.0/fieldservice_stock + :alt: OCA/field-service +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/field-service-12-0/field-service-12-0-fieldservice_stock + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/264/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is an add-on for the Field Service application in Odoo. +It provides a generic framework to allow you to link inventory and +stock operations with your field service operations. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +To install Field Service and have the mapping features, you need to install GeoEngine. + +Please refer to the installation instructions available at: +https://github.com/OCA/geospatial/tree/11.0/base_geoengine + +Configuration +============= + +To configure this module, you need to: + +* Go to Field Service > Master Data > Locations +* Create or select a location and set the inventory location + +If you are in a multi-warehouse situation: + +* Go to Field Service > Configuration > Territories +* Create or select a territory +* Set the warehouse that will serve this territory + +Usage +===== + +This module primarily establishes a connection between stock and +field service operations so therefore has no specific usage +instructions. + +Known issues / Roadmap +====================== + +The roadmap of the Field Service application is documented on +`Github `_. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators +* Brian McMaster + +Contributors +~~~~~~~~~~~~ + +* Brian McMaster +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. +* Marcel Savegnago + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Open Source Integrators + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-brian10048| image:: https://github.com/brian10048.png?size=40px + :target: https://github.com/brian10048 + :alt: brian10048 +.. |maintainer-wolfhall| image:: https://github.com/wolfhall.png?size=40px + :target: https://github.com/wolfhall + :alt: wolfhall +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 +.. |maintainer-smangukiya| image:: https://github.com/smangukiya.png?size=40px + :target: https://github.com/smangukiya + :alt: smangukiya + +Current `maintainers `__: + +|maintainer-brian10048| |maintainer-wolfhall| |maintainer-max3903| |maintainer-smangukiya| + +This module is part of the `OCA/field-service `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/fieldservice_stock/__init__.py b/fieldservice_stock/__init__.py new file mode 100644 index 0000000000..da2feecfe9 --- /dev/null +++ b/fieldservice_stock/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2018 - TODAY, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/fieldservice_stock/__manifest__.py b/fieldservice_stock/__manifest__.py new file mode 100644 index 0000000000..3d609dd3de --- /dev/null +++ b/fieldservice_stock/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright (C) 2018 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Field Service - Stock", + "summary": "Integrate the logistics operations with Field Service", + "version": "13.0.1.0.0", + "category": "Field Service", + "author": "Open Source Integrators, " + "Brian McMaster, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/field-service", + "depends": ["fieldservice", "stock"], + "data": [ + "security/ir.model.access.csv", + "data/fsm_stock_data.xml", + "views/res_territory.xml", + "views/fsm_location.xml", + "views/fsm_order.xml", + "views/stock.xml", + ], + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": ["brian10048", "wolfhall", "max3903", "smangukiya"], +} diff --git a/fieldservice_stock/data/fsm_stock_data.xml b/fieldservice_stock/data/fsm_stock_data.xml new file mode 100644 index 0000000000..21fb29802d --- /dev/null +++ b/fieldservice_stock/data/fsm_stock_data.xml @@ -0,0 +1,8 @@ + + + + Field + view + + + diff --git a/fieldservice_stock/i18n/de.po b/fieldservice_stock/i18n/de.po new file mode 100644 index 0000000000..1af4456989 --- /dev/null +++ b/fieldservice_stock/i18n/de.po @@ -0,0 +1,163 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-26 17:58+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.8\n" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Allocated Quantity" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Deliveries" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__delivery_count +msgid "Delivery Orders" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Done Quantity" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_wizard +msgid "FSM Record Conversion" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_location +msgid "Field Service Location" +msgstr "Field-Service-Ort" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_stock.field_procurement_group__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_move__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_picking__fsm_order_id +msgid "Field Service Order" +msgstr "Field-Service-Auftrag" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_stock_inventory +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Inventory" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__inventory_location_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__inventory_location_id +msgid "Inventory Location" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Moves" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__move_ids +msgid "Operations" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_procurement_group +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__procurement_group_id +msgid "Procurement Group" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_product +msgid "Products" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Reference" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Requested Quantity" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__return_count +msgid "Return Orders" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Returns" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__shipping_address_id +msgid "Shipping Location" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_territory +msgid "Territory" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__picking_ids +msgid "Transfers" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Unit of Measure" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__warehouse_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_territory__warehouse_id +msgid "Warehouse" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,help:fieldservice_stock.field_fsm_order__warehouse_id +msgid "Warehouse used to ship the materials" +msgstr "" + +#~ msgid "Cancel" +#~ msgstr "Abbrechen" + +#~ msgid "Field Service Equipment" +#~ msgstr "Service-Equipment" + +#~ msgid "Product Template" +#~ msgstr "Produktvorlage" diff --git a/fieldservice_stock/i18n/es.po b/fieldservice_stock/i18n/es.po new file mode 100644 index 0000000000..7bf3a80c58 --- /dev/null +++ b/fieldservice_stock/i18n/es.po @@ -0,0 +1,233 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-04 00:14+0000\n" +"Last-Translator: Nelson Ramírez Sánchez \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Allocated Quantity" +msgstr "Cantidad Asignada" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Deliveries" +msgstr "Entregas" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__delivery_count +msgid "Delivery Orders" +msgstr "Pedidos de Entrega" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Done Quantity" +msgstr "Cantidad Hecha" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_wizard +msgid "FSM Record Conversion" +msgstr "Conversión de Registro FSM" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_location +msgid "Field Service Location" +msgstr "Ubicación del Servicio de Campo" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_stock.field_procurement_group__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_move__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_picking__fsm_order_id +msgid "Field Service Order" +msgstr "Orden de Servicio de Campo" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_stock_inventory +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Inventory" +msgstr "Inventario" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__inventory_location_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__inventory_location_id +msgid "Inventory Location" +msgstr "Ubicación de Inventario" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Moves" +msgstr "Movimientos" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__move_ids +msgid "Operations" +msgstr "Operaciones" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_procurement_group +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__procurement_group_id +msgid "Procurement Group" +msgstr "Grupo de Adquisiciones" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_product +msgid "Products" +msgstr "Productos" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Reference" +msgstr "Referencia" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Requested Quantity" +msgstr "Cantidad Requerida" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__return_count +msgid "Return Orders" +msgstr "Órdenes de Devolución" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Returns" +msgstr "Devoluciones" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__shipping_address_id +msgid "Shipping Location" +msgstr "Lugar de Envío" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de Stock" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_rule +msgid "Stock Rule" +msgstr "Regla de Stock" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_territory +msgid "Territory" +msgstr "Territorio" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_picking +msgid "Transfer" +msgstr "Transferir" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__picking_ids +msgid "Transfers" +msgstr "Transferencias" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Unit of Measure" +msgstr "Unidad de Medida" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__warehouse_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_territory__warehouse_id +msgid "Warehouse" +msgstr "Almacén" + +#. module: fieldservice_stock +#: model:ir.model.fields,help:fieldservice_stock.field_fsm_order__warehouse_id +msgid "Warehouse used to ship the materials" +msgstr "Almacén utilizado para enviar los materiales" + +#~ msgid "Please create a stock request." +#~ msgstr "Por favor cree una solicitud de stock." + +#~ msgid "Cancel" +#~ msgstr "Cancelar" + +#~ msgid "Cancelled" +#~ msgstr "Cancelado" + +#, fuzzy +#~ msgid "Create Fsm Equipment" +#~ msgstr "Crea Equipos FSM" + +#~ msgid "Creates a FSM Equipment" +#~ msgstr "Crea Equipos FSM" + +#~ msgid "Current Inventory Location" +#~ msgstr "Ubicación Actual de Inventario" + +#~ msgid "Done" +#~ msgstr "Hecho" + +#~ msgid "Draft" +#~ msgstr "Borrador" + +#~ msgid "Equipment" +#~ msgstr "Equipo" + +#~ msgid "FSM Order" +#~ msgstr "Orden FSM" + +#~ msgid "Field Service Equipment" +#~ msgstr "Equipo de Servicio de Campo" + +#~ msgid "In progress" +#~ msgstr "En progreso" + +#~ msgid "Lot/Serial" +#~ msgstr "Lote / Serie" + +#~ msgid "Order Lines" +#~ msgstr "Líneas de Pedido" + +#~ msgid "Product" +#~ msgstr "Producto" + +#~ msgid "Product Moves (Stock Move Line)" +#~ msgstr "Movimientos de Producto (Línea de Movimiento de Stock)" + +#~ msgid "Product Template" +#~ msgstr "Plantilla de Producto" + +#~ msgid "Request State" +#~ msgstr "Estado de Solicitud" + +#~ msgid "Serial #" +#~ msgstr "# de Serial" + +#~ msgid "Set to Draft" +#~ msgstr "Establecer en Borrador" + +#~ msgid "Stock Request" +#~ msgstr "Solicitud de Stock" + +#~ msgid "Stock Request Order" +#~ msgstr "Pedido de Solicitud de Stock" + +#~ msgid "Stock Requests" +#~ msgstr "Solicitudes de Stock" + +#~ msgid "Submit" +#~ msgstr "Enviar" + +#~ msgid "Submitted" +#~ msgstr "Enviado" + +#~ msgid "Receipts" +#~ msgstr "Ingresos" diff --git a/fieldservice_stock/i18n/es_CL.po b/fieldservice_stock/i18n/es_CL.po new file mode 100644 index 0000000000..e918795dcd --- /dev/null +++ b/fieldservice_stock/i18n/es_CL.po @@ -0,0 +1,233 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-20 01:13+0000\n" +"Last-Translator: Nelson Ramírez Sánchez \n" +"Language-Team: none\n" +"Language: es_CL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Allocated Quantity" +msgstr "Cantidad Asignada" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Deliveries" +msgstr "Entregas" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__delivery_count +msgid "Delivery Orders" +msgstr "Pedidos de Entrega" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Done Quantity" +msgstr "Cantidad Hecha" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_wizard +msgid "FSM Record Conversion" +msgstr "Conversión de Registro FSM" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_location +msgid "Field Service Location" +msgstr "Ubicación del Servicio de Campo" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_stock.field_procurement_group__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_move__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_picking__fsm_order_id +msgid "Field Service Order" +msgstr "Orden de Servicio de Campo" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_stock_inventory +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Inventory" +msgstr "Inventario" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__inventory_location_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__inventory_location_id +msgid "Inventory Location" +msgstr "Ubicación de Inventario" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Moves" +msgstr "Movimientos" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__move_ids +msgid "Operations" +msgstr "Operaciones" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_procurement_group +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__procurement_group_id +msgid "Procurement Group" +msgstr "Grupo de Adquisiciones" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_product +msgid "Products" +msgstr "Productos" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Reference" +msgstr "Referencias" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Requested Quantity" +msgstr "Cantidad Pedida" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__return_count +msgid "Return Orders" +msgstr "Órdenes de Devolución" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Returns" +msgstr "Devoluciones" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__shipping_address_id +msgid "Shipping Location" +msgstr "Lugar de Envío" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de Stock" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_rule +msgid "Stock Rule" +msgstr "Regla de Stock" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_territory +msgid "Territory" +msgstr "Territorio" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_picking +msgid "Transfer" +msgstr "Transferir" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__picking_ids +msgid "Transfers" +msgstr "Transferencias" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Unit of Measure" +msgstr "Unidad de Medida" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__warehouse_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_territory__warehouse_id +msgid "Warehouse" +msgstr "Almacén" + +#. module: fieldservice_stock +#: model:ir.model.fields,help:fieldservice_stock.field_fsm_order__warehouse_id +msgid "Warehouse used to ship the materials" +msgstr "Almacén utilizado para enviar los materiales" + +#~ msgid "Please create a stock request." +#~ msgstr "Por favor cree una solicitud de stock." + +#~ msgid "Cancel" +#~ msgstr "Cancelar" + +#~ msgid "Cancelled" +#~ msgstr "Cancelado" + +#, fuzzy +#~ msgid "Create Fsm Equipment" +#~ msgstr "Crea Equipos FSM" + +#~ msgid "Creates a FSM Equipment" +#~ msgstr "Crea Equipos FSM" + +#~ msgid "Current Inventory Location" +#~ msgstr "Ubicación Actual de Inventario" + +#~ msgid "Done" +#~ msgstr "Hecho" + +#~ msgid "Draft" +#~ msgstr "Borrador" + +#~ msgid "Equipment" +#~ msgstr "Equipo" + +#~ msgid "FSM Order" +#~ msgstr "Orden FSM" + +#~ msgid "Field Service Equipment" +#~ msgstr "Equipo de Servicio de Campo" + +#~ msgid "In progress" +#~ msgstr "En progreso" + +#~ msgid "Lot/Serial" +#~ msgstr "Lote / Serie" + +#~ msgid "Order Lines" +#~ msgstr "Líneas de Pedido" + +#~ msgid "Product" +#~ msgstr "Producto" + +#~ msgid "Product Moves (Stock Move Line)" +#~ msgstr "Movimientos de Producto (Línea de Movimiento de Stock)" + +#~ msgid "Product Template" +#~ msgstr "Plantilla de Producto" + +#~ msgid "Request State" +#~ msgstr "Estado de Solicitud" + +#~ msgid "Serial #" +#~ msgstr "# de Serial" + +#~ msgid "Set to Draft" +#~ msgstr "Establecer en Borrador" + +#~ msgid "Stock Request" +#~ msgstr "Solicitud de Stock" + +#~ msgid "Stock Request Order" +#~ msgstr "Pedido de Solicitud de Stock" + +#~ msgid "Stock Requests" +#~ msgstr "Solicitudes de Stock" + +#~ msgid "Submit" +#~ msgstr "Enviar" + +#~ msgid "Submitted" +#~ msgstr "Enviado" + +#~ msgid "Receipts" +#~ msgstr "Ingresos" diff --git a/fieldservice_stock/i18n/fieldservice_stock.pot b/fieldservice_stock/i18n/fieldservice_stock.pot new file mode 100644 index 0000000000..831dfcda85 --- /dev/null +++ b/fieldservice_stock/i18n/fieldservice_stock.pot @@ -0,0 +1,152 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \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: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Allocated Quantity" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Deliveries" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__delivery_count +msgid "Delivery Orders" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Done Quantity" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_wizard +msgid "FSM Record Conversion" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_location +msgid "Field Service Location" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_stock.field_procurement_group__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_move__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_picking__fsm_order_id +msgid "Field Service Order" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_stock_inventory +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Inventory" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__inventory_location_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__inventory_location_id +msgid "Inventory Location" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Moves" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__move_ids +msgid "Operations" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_procurement_group +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__procurement_group_id +msgid "Procurement Group" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_product +msgid "Products" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Reference" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Requested Quantity" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__return_count +msgid "Return Orders" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Returns" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__shipping_address_id +msgid "Shipping Location" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_territory +msgid "Territory" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__picking_ids +msgid "Transfers" +msgstr "" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Unit of Measure" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__warehouse_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_territory__warehouse_id +msgid "Warehouse" +msgstr "" + +#. module: fieldservice_stock +#: model:ir.model.fields,help:fieldservice_stock.field_fsm_order__warehouse_id +msgid "Warehouse used to ship the materials" +msgstr "" + diff --git a/fieldservice_stock/i18n/pt_BR.po b/fieldservice_stock/i18n/pt_BR.po new file mode 100644 index 0000000000..bf6b70185f --- /dev/null +++ b/fieldservice_stock/i18n/pt_BR.po @@ -0,0 +1,250 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-06-17 16:19+0000\n" +"Last-Translator: Fernando Colus \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Allocated Quantity" +msgstr "Quantidade Alocada" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Deliveries" +msgstr "Entregas" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__delivery_count +msgid "Delivery Orders" +msgstr "Pedidos de Entrega" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Done Quantity" +msgstr "Quantidade Concluída" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_wizard +msgid "FSM Record Conversion" +msgstr "Conversão de registro FSM (Field Service Management)" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_location +msgid "Field Service Location" +msgstr "Localização do Serviço de Campo" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_order +#: model:ir.model.fields,field_description:fieldservice_stock.field_procurement_group__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_move__fsm_order_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_stock_picking__fsm_order_id +msgid "Field Service Order" +msgstr "Pedido de Serviço de Campo" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_stock_inventory +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Inventory" +msgstr "Inventário" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__inventory_location_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__inventory_location_id +msgid "Inventory Location" +msgstr "Localização de Inventário" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Moves" +msgstr "Movimentações" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__move_ids +msgid "Operations" +msgstr "Operações" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_procurement_group +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__procurement_group_id +msgid "Procurement Group" +msgstr "Grupo de Aquisições" + +#. module: fieldservice_stock +#: model:ir.ui.menu,name:fieldservice_stock.menu_fsm_product +msgid "Products" +msgstr "Produtos" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Reference" +msgstr "Referência" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Requested Quantity" +msgstr "Quantidade Requisitada" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__return_count +msgid "Return Orders" +msgstr "Retornar Pedidos" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Returns" +msgstr "Retornos" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_location__shipping_address_id +msgid "Shipping Location" +msgstr "Localização do Embarque" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimentação de Estoque" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_rule +msgid "Stock Rule" +msgstr "Regra de Estoque" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_fsm_territory +msgid "Territory" +msgstr "Território" + +#. module: fieldservice_stock +#: model:ir.model,name:fieldservice_stock.model_stock_picking +msgid "Transfer" +msgstr "Transferência" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__picking_ids +msgid "Transfers" +msgstr "Transferências" + +#. module: fieldservice_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_stock.view_fsm_order_form_inherit_stock +msgid "Unit of Measure" +msgstr "Unidade de Medida (UoM)" + +#. module: fieldservice_stock +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_order__warehouse_id +#: model:ir.model.fields,field_description:fieldservice_stock.field_fsm_territory__warehouse_id +msgid "Warehouse" +msgstr "Armazém" + +#. module: fieldservice_stock +#: model:ir.model.fields,help:fieldservice_stock.field_fsm_order__warehouse_id +msgid "Warehouse used to ship the materials" +msgstr "Armazém utilizado para embarque dos materiais" + +#~ msgid "Please create a stock request." +#~ msgstr "Por gentileza, crie uma requisição de estoque." + +#~ msgid "" +#~ "There is already a Stock Request Order " +#~ "with the same Field Service Order and " +#~ "Warehouse that is in Draft state. " +#~ "Please add this Stock Request " +#~ "there. (%s)" +#~ msgstr "" +#~ "Já existe um Pedido de Solicitação de Estoque com o mesmo Pedido de " +#~ "Serviço de Campo e Armazém que está no estado Rascunho. Adicione essa " +#~ "solicitação de estoque lá. (%s)" + +#~ msgid "Cancel" +#~ msgstr "Cancelar" + +#~ msgid "Cancelled" +#~ msgstr "Cancelado" + +#~ msgid "Create Fsm Equipment" +#~ msgstr "Criar Equipamento FSM (Field Service Management)" + +#~ msgid "Creates a FSM Equipment" +#~ msgstr "Cria um Equipamento FSM (Field Service Management)" + +#~ msgid "Current Inventory Location" +#~ msgstr "Localização Atual do Inventário" + +#~ msgid "Done" +#~ msgstr "Concluído" + +#~ msgid "Draft" +#~ msgstr "Rascunho" + +#~ msgid "Equipment" +#~ msgstr "Equipamento" + +#~ msgid "FSM Order" +#~ msgstr "Pedido de FSM (Field Service Management)" + +#~ msgid "Field Service Equipment" +#~ msgstr "Equipamento de Serviço de Campo" + +#~ msgid "In progress" +#~ msgstr "Em andamento" + +#~ msgid "Lot/Serial" +#~ msgstr "Lote/Serial" + +#~ msgid "Order Lines" +#~ msgstr "Linhas do Pedido" + +#~ msgid "Picking Type" +#~ msgstr "Tipo de Coleta" + +#~ msgid "Product" +#~ msgstr "Produto" + +#~ msgid "Product Moves (Stock Move Line)" +#~ msgstr "Movimentações de Produto (Linha de Movimentação de Estoque)" + +#~ msgid "Product Template" +#~ msgstr "Modelo de Produto" + +#~ msgid "" +#~ "Products with the 'Creates a FSM Equipment' flag will automatically be " +#~ "converted to an FSM Equipment." +#~ msgstr "" +#~ "Os produtos com o sinalizador \"Cria um equipamento FSM\" serão " +#~ "automaticamente convertidos em um equipamento FSM." + +#~ msgid "Request State" +#~ msgstr "Estado da Requisição" + +#~ msgid "Serial #" +#~ msgstr "Serial #" + +#~ msgid "Set to Draft" +#~ msgstr "Marque como rascunho" + +#~ msgid "Stock Request" +#~ msgstr "Requisição de Estoque" + +#~ msgid "Stock Request Order" +#~ msgstr "Pedido de Movimentação de Estoque" + +#~ msgid "Stock Requests" +#~ msgstr "Requisições de Estoque" + +#~ msgid "Submit" +#~ msgstr "Submeter" + +#~ msgid "Submitted" +#~ msgstr "Submetido" diff --git a/fieldservice_stock/migrations/13.0.1.0.0/pre-migration.py b/fieldservice_stock/migrations/13.0.1.0.0/pre-migration.py new file mode 100644 index 0000000000..45666c371e --- /dev/null +++ b/fieldservice_stock/migrations/13.0.1.0.0/pre-migration.py @@ -0,0 +1,12 @@ +# Copyright 2021 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + cr = env.cr + if openupgrade.table_exists(cr, "fsm_territory"): + openupgrade.rename_models(cr, [("fsm.territory", "res.territory")]) + openupgrade.rename_tables(cr, [("fsm_territory", "res_territory")]) diff --git a/fieldservice_stock/models/__init__.py b/fieldservice_stock/models/__init__.py new file mode 100644 index 0000000000..f8f62f5645 --- /dev/null +++ b/fieldservice_stock/models/__init__.py @@ -0,0 +1,13 @@ +# Copyright (C) 2018 - TODAY, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + res_territory, + fsm_location, + fsm_order, + stock_move, + procurement_group, + stock_rule, + stock_picking, + fsm_wizard, +) diff --git a/fieldservice_stock/models/fsm_location.py b/fieldservice_stock/models/fsm_location.py new file mode 100644 index 0000000000..e4d8f0298c --- /dev/null +++ b/fieldservice_stock/models/fsm_location.py @@ -0,0 +1,21 @@ +# Copyright (C) 2018 - TODAY, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class FSMLocation(models.Model): + _inherit = "fsm.location" + + inventory_location_id = fields.Many2one( + "stock.location", + string="Inventory Location", + required=True, + default=lambda self: self.env.ref("stock.stock_location_customers"), + ) + shipping_address_id = fields.Many2one("res.partner", string="Shipping Location") + + @api.onchange("fsm_parent_id") + def _onchange_fsm_parent_id(self): + super(FSMLocation, self)._onchange_fsm_parent_id() + self.inventory_location_id = self.fsm_parent_id.inventory_location_id.id diff --git a/fieldservice_stock/models/fsm_order.py b/fieldservice_stock/models/fsm_order.py new file mode 100644 index 0000000000..106a51eff3 --- /dev/null +++ b/fieldservice_stock/models/fsm_order.py @@ -0,0 +1,102 @@ +# Copyright (C) 2018 - TODAY, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class FSMOrder(models.Model): + _inherit = "fsm.order" + + @api.model + def _default_warehouse_id(self): + company = self.env.user.company_id.id + warehouse_ids = self.env["stock.warehouse"].search( + [("company_id", "=", company)], limit=1 + ) + return warehouse_ids and warehouse_ids.id + + @api.model + def _get_move_domain(self): + return [("picking_id.picking_type_id.code", "in", ("outgoing", "incoming"))] + + picking_ids = fields.One2many("stock.picking", "fsm_order_id", string="Transfers") + delivery_count = fields.Integer( + string="Delivery Orders", compute="_compute_picking_ids" + ) + procurement_group_id = fields.Many2one( + "procurement.group", "Procurement Group", copy=False + ) + inventory_location_id = fields.Many2one( + related="location_id.inventory_location_id", readonly=True + ) + warehouse_id = fields.Many2one( + "stock.warehouse", + string="Warehouse", + required=True, + default=_default_warehouse_id, + help="Warehouse used to ship the materials", + ) + return_count = fields.Integer( + string="Return Orders", compute="_compute_picking_ids" + ) + move_ids = fields.One2many( + "stock.move", "fsm_order_id", string="Operations", domain=_get_move_domain + ) + + @api.depends("picking_ids") + def _compute_picking_ids(self): + for order in self: + order.delivery_count = len( + [ + picking + for picking in order.picking_ids + if picking.picking_type_id.code == "outgoing" + ] + ) + order.return_count = len( + [ + picking + for picking in order.picking_ids + if picking.picking_type_id.code == "incoming" + ] + ) + + def action_view_delivery(self): + """ + This function returns an action that display existing delivery orders + of given fsm order ids. It can either be a in a list or in a form + view, if there is only one delivery order to show. + """ + action = self.env.ref("stock.action_picking_tree_all").read()[0] + pickings = self.mapped("picking_ids") + delivery_ids = [ + picking.id + for picking in pickings + if picking.picking_type_id.code == "outgoing" + ] + if len(delivery_ids) > 1: + action["domain"] = [("id", "in", delivery_ids)] + elif pickings: + action["views"] = [(self.env.ref("stock.view_picking_form").id, "form")] + action["res_id"] = delivery_ids[0] + return action + + def action_view_returns(self): + """ + This function returns an action that display existing return orders + of given fsm order ids. It can either be a in a list or in a form + view, if there is only one return order to show. + """ + action = self.env.ref("stock.action_picking_tree_all").read()[0] + pickings = self.mapped("picking_ids") + return_ids = [ + picking.id + for picking in pickings + if picking.picking_type_id.code == "incoming" + ] + if len(return_ids) > 1: + action["domain"] = [("id", "in", return_ids)] + elif pickings: + action["views"] = [(self.env.ref("stock.view_picking_form").id, "form")] + action["res_id"] = return_ids[0] + return action diff --git a/fieldservice_stock/models/fsm_wizard.py b/fieldservice_stock/models/fsm_wizard.py new file mode 100644 index 0000000000..96a1266b3e --- /dev/null +++ b/fieldservice_stock/models/fsm_wizard.py @@ -0,0 +1,13 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class FSMWizard(models.TransientModel): + _inherit = "fsm.wizard" + + def _prepare_fsm_location(self, partner): + res = super()._prepare_fsm_location(partner) + res["inventory_location_id"] = partner.property_stock_customer.id + return res diff --git a/fieldservice_stock/models/procurement_group.py b/fieldservice_stock/models/procurement_group.py new file mode 100644 index 0000000000..1c02672451 --- /dev/null +++ b/fieldservice_stock/models/procurement_group.py @@ -0,0 +1,9 @@ +# Copyright (C) 2018 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ProcurementGroup(models.Model): + _inherit = "procurement.group" + + fsm_order_id = fields.Many2one("fsm.order", "Field Service Order") diff --git a/fieldservice_stock/models/res_territory.py b/fieldservice_stock/models/res_territory.py new file mode 100644 index 0000000000..e231fca4e9 --- /dev/null +++ b/fieldservice_stock/models/res_territory.py @@ -0,0 +1,9 @@ +# Copyright (C) 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class ResTerritory(models.Model): + _inherit = "res.territory" + + warehouse_id = fields.Many2one("stock.warehouse", string="Warehouse") diff --git a/fieldservice_stock/models/stock_move.py b/fieldservice_stock/models/stock_move.py new file mode 100644 index 0000000000..9c7abe934e --- /dev/null +++ b/fieldservice_stock/models/stock_move.py @@ -0,0 +1,9 @@ +# Copyright (C) 2018 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class StockMove(models.Model): + _inherit = "stock.move" + + fsm_order_id = fields.Many2one("fsm.order", string="Field Service Order") diff --git a/fieldservice_stock/models/stock_picking.py b/fieldservice_stock/models/stock_picking.py new file mode 100644 index 0000000000..20f94d4247 --- /dev/null +++ b/fieldservice_stock/models/stock_picking.py @@ -0,0 +1,18 @@ +# Copyright (C) 2018 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + fsm_order_id = fields.Many2one( + related="group_id.fsm_order_id", string="Field Service Order", store=True + ) + + @api.model + def create(self, vals): + res = super().create(vals) + if vals.get("fsm_order_id"): + res.fsm_order_id = vals.get("fsm_order_id") + return res diff --git a/fieldservice_stock/models/stock_rule.py b/fieldservice_stock/models/stock_rule.py new file mode 100644 index 0000000000..84dde2f114 --- /dev/null +++ b/fieldservice_stock/models/stock_rule.py @@ -0,0 +1,31 @@ +# Copyright (C) 2018 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models + + +class StockRule(models.Model): + _inherit = "stock.rule" + + def _get_stock_move_values( + self, + product_id, + product_qty, + product_uom, + location_id, + name, + origin, + values, + group_id, + ): + vals = super()._get_stock_move_values( + product_id, + product_qty, + product_uom, + location_id, + name, + origin, + values, + group_id, + ) + vals.update({"fsm_order_id": values.get("fsm_order_id")}) + return vals diff --git a/fieldservice_stock/readme/CONFIGURE.rst b/fieldservice_stock/readme/CONFIGURE.rst new file mode 100644 index 0000000000..be45397600 --- /dev/null +++ b/fieldservice_stock/readme/CONFIGURE.rst @@ -0,0 +1,10 @@ +To configure this module, you need to: + +* Go to Field Service > Master Data > Locations +* Create or select a location and set the inventory location + +If you are in a multi-warehouse situation: + +* Go to Field Service > Configuration > Territories +* Create or select a territory +* Set the warehouse that will serve this territory diff --git a/fieldservice_stock/readme/CONTRIBUTORS.rst b/fieldservice_stock/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..5db5c162c6 --- /dev/null +++ b/fieldservice_stock/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Brian McMaster +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. +* Marcel Savegnago diff --git a/fieldservice_stock/readme/CREDITS.rst b/fieldservice_stock/readme/CREDITS.rst new file mode 100644 index 0000000000..0eff0acf4e --- /dev/null +++ b/fieldservice_stock/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Open Source Integrators diff --git a/fieldservice_stock/readme/DESCRIPTION.rst b/fieldservice_stock/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..0662a1496a --- /dev/null +++ b/fieldservice_stock/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module is an add-on for the Field Service application in Odoo. +It provides a generic framework to allow you to link inventory and +stock operations with your field service operations. diff --git a/fieldservice_stock/readme/INSTALL.rst b/fieldservice_stock/readme/INSTALL.rst new file mode 100644 index 0000000000..e5355c4b0f --- /dev/null +++ b/fieldservice_stock/readme/INSTALL.rst @@ -0,0 +1,4 @@ +To install Field Service and have the mapping features, you need to install GeoEngine. + +Please refer to the installation instructions available at: +https://github.com/OCA/geospatial/tree/13.0/base_geoengine diff --git a/fieldservice_stock/readme/ROADMAP.rst b/fieldservice_stock/readme/ROADMAP.rst new file mode 100644 index 0000000000..f607015959 --- /dev/null +++ b/fieldservice_stock/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +The roadmap of the Field Service application is documented on +`Github `_. diff --git a/fieldservice_stock/readme/USAGE.rst b/fieldservice_stock/readme/USAGE.rst new file mode 100644 index 0000000000..0eca605486 --- /dev/null +++ b/fieldservice_stock/readme/USAGE.rst @@ -0,0 +1,3 @@ +This module primarily establishes a connection between stock and +field service operations so therefore has no specific usage +instructions. diff --git a/fieldservice_stock/security/ir.model.access.csv b/fieldservice_stock/security/ir.model.access.csv new file mode 100644 index 0000000000..b8e0ce44b5 --- /dev/null +++ b/fieldservice_stock/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_move_portal,access.stock.move.portal,stock.model_stock_move,base.group_portal,1,1,0,0 +access_product_product_portal,access.product.product.portal,product.model_product_product,base.group_portal,1,0,0,0 +access_product_template_portal,access.product.template.portal,product.model_product_template,base.group_portal,1,0,0,0 +access_uom_uom_portal,access.uom.uom.portal,uom.model_uom_uom,base.group_portal,1,0,0,0 diff --git a/fieldservice_stock/static/description/icon.png b/fieldservice_stock/static/description/icon.png new file mode 100644 index 0000000000..955674d8f0 Binary files /dev/null and b/fieldservice_stock/static/description/icon.png differ diff --git a/fieldservice_stock/static/description/index.html b/fieldservice_stock/static/description/index.html new file mode 100644 index 0000000000..e3f772599b --- /dev/null +++ b/fieldservice_stock/static/description/index.html @@ -0,0 +1,470 @@ + + + + + + +Field Service - Stock + + + +
+

Field Service - Stock

+ + +

Beta License: AGPL-3 OCA/field-service Translate me on Weblate Try me on Runbot

+

This module is an add-on for the Field Service application in Odoo. +It provides a generic framework to allow you to link inventory and +stock operations with your field service operations.

+

Table of contents

+ +
+

Installation

+

To install Field Service and have the mapping features, you need to install GeoEngine.

+

Please refer to the installation instructions available at: +https://github.com/OCA/geospatial/tree/11.0/base_geoengine

+
+
+

Configuration

+

To configure this module, you need to:

+
    +
  • Go to Field Service > Master Data > Locations
  • +
  • Create or select a location and set the inventory location
  • +
+

If you are in a multi-warehouse situation:

+
    +
  • Go to Field Service > Configuration > Territories
  • +
  • Create or select a territory
  • +
  • Set the warehouse that will serve this territory
  • +
+
+
+

Usage

+

This module primarily establishes a connection between stock and +field service operations so therefore has no specific usage +instructions.

+
+
+

Known issues / Roadmap

+

The roadmap of the Field Service application is documented on +Github.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
  • Brian McMaster
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

brian10048 wolfhall max3903 smangukiya

+

This module is part of the OCA/field-service project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/fieldservice_stock/tests/__init__.py b/fieldservice_stock/tests/__init__.py new file mode 100644 index 0000000000..0d064c5691 --- /dev/null +++ b/fieldservice_stock/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2020, Brian McMaster +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import common diff --git a/fieldservice_stock/tests/common.py b/fieldservice_stock/tests/common.py new file mode 100644 index 0000000000..c20a4a83b2 --- /dev/null +++ b/fieldservice_stock/tests/common.py @@ -0,0 +1,31 @@ +# Copyright (C) 2020, Brian McMaster +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from odoo.tests.common import SavepointCase + + +class TestFSMStockCommon(SavepointCase): + @classmethod + def setUpClass(cls): + super(TestFSMStockCommon, cls).setUpClass() + + cls.ModelData = cls.env["ir.model.data"] + cls.FSMOrder = cls.env["fsm.order"] + cls.Product = cls.env["product.product"] + + cls.stock_cust_loc = cls.ModelData.xmlid_to_res_id( + "stock.stock_location_customers" + ) + cls.partner_1 = ( + cls.env["res.partner"] + .with_context(tracking_disable=True) + .create({"name": "Partner 1"}) + ) + cls.fsm_location_1 = cls.env["fsm.location"].create( + { + "name": "FSM Location 1", + "owner_id": cls.partner_1.id, + "customer_id": cls.partner_1.id, + "inventory_location_id": cls.stock_cust_loc, + } + ) diff --git a/fieldservice_stock/views/fsm_location.xml b/fieldservice_stock/views/fsm_location.xml new file mode 100644 index 0000000000..11a5350655 --- /dev/null +++ b/fieldservice_stock/views/fsm_location.xml @@ -0,0 +1,20 @@ + + + + fsm.location + + + + + + + + + + + diff --git a/fieldservice_stock/views/fsm_order.xml b/fieldservice_stock/views/fsm_order.xml new file mode 100644 index 0000000000..6c04bffdc3 --- /dev/null +++ b/fieldservice_stock/views/fsm_order.xml @@ -0,0 +1,84 @@ + + + fsm.order.form.stock + fsm.order + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/fieldservice_stock/views/res_territory.xml b/fieldservice_stock/views/res_territory.xml new file mode 100644 index 0000000000..62d19ef241 --- /dev/null +++ b/fieldservice_stock/views/res_territory.xml @@ -0,0 +1,30 @@ + + + + res.territory.warehouse.tree + res.territory + + + + + + + + + + res.territory.warehouse.form + res.territory + + + + + + + + diff --git a/fieldservice_stock/views/stock.xml b/fieldservice_stock/views/stock.xml new file mode 100644 index 0000000000..6fd0fe5c0f --- /dev/null +++ b/fieldservice_stock/views/stock.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/setup/fieldservice_stock/odoo/addons/fieldservice_stock b/setup/fieldservice_stock/odoo/addons/fieldservice_stock new file mode 120000 index 0000000000..6bb1c1f529 --- /dev/null +++ b/setup/fieldservice_stock/odoo/addons/fieldservice_stock @@ -0,0 +1 @@ +../../../../fieldservice_stock \ No newline at end of file diff --git a/setup/fieldservice_stock/setup.py b/setup/fieldservice_stock/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/fieldservice_stock/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)