diff --git a/fieldservice_equipment_stock/README.rst b/fieldservice_equipment_stock/README.rst new file mode 100644 index 0000000000..4df32e978d --- /dev/null +++ b/fieldservice_equipment_stock/README.rst @@ -0,0 +1,144 @@ +=============================== +Field Service - Stock Equipment +=============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:65d3e76c59e42923ac9daf7d3f8297aa5752d4f1147b3b0dbf421e0218dcc28f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/fieldservice_equipment_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-18-0/field-service-18-0-fieldservice_equipment_stock + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is an add-on for the Field Service application in Odoo. It +allows you to track your FSM Equipments in stock moves. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Products can be automatically converted into FSM Equipments. This is +only available only for products tracked by serial number. This needs to +be enabled both on Operation Types and Products. For example, we may +want to create the FSM Equipment on Delivery, or on Receipts. + +To enable on Products: + +- Go to Inventory > Master Data > Products +- Open the Product form, Inventory tab +- On the "Traceability" section, make sure "Tracking" is set to "By + Unique Serial Number" +- Enable the "Creates FSM Equipment" checkbox + +To enable on Operation Types: + +- Go to Inventory > Configuration > Operation Types +- Select the intended Operation Type ("Receipts" for example) +- On the "Traceability" section, enable the "Create FSM Equipment" + checkbox + +Usage +===== + +A completed stock move for a properly configured Product on a configured +stock Operation Type will automatically create a field service +equipment. + +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 to smash 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 +- `XCG Consulting `__: + + - Szeka Wong + +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_equipment_stock/__init__.py b/fieldservice_equipment_stock/__init__.py new file mode 100644 index 0000000000..e27a9c3831 --- /dev/null +++ b/fieldservice_equipment_stock/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2020, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/fieldservice_equipment_stock/__manifest__.py b/fieldservice_equipment_stock/__manifest__.py new file mode 100644 index 0000000000..3288ec3f48 --- /dev/null +++ b/fieldservice_equipment_stock/__manifest__.py @@ -0,0 +1,31 @@ +# Copyright (C) 2020, Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Field Service - Stock Equipment", + "summary": "Integrate stock operations with your field service equipments", + "version": "18.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", + "views/fsm_equipment.xml", + "views/product_template.xml", + "views/stock_picking_type.xml", + "views/stock_lot.xml", + ], + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": [ + "brian10048", + "wolfhall", + "max3903", + "smangukiya", + ], +} diff --git a/fieldservice_equipment_stock/i18n/es.po b/fieldservice_equipment_stock/i18n/es.po new file mode 100644 index 0000000000..3b5d9cb5cb --- /dev/null +++ b/fieldservice_equipment_stock/i18n/es.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_equipment_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-09 07:47+0000\n" +"Last-Translator: Ivorra78 \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 4.17\n" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "Create Fsm Equipment" +msgstr "Crear equipo Fsm" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_product__create_fsm_equipment +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_template__create_fsm_equipment +msgid "Creates a FSM Equipment" +msgstr "Crea un equipo FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__current_stock_location_id +msgid "Current Inventory Location" +msgstr "Ubicación actual del inventario" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_lot__fsm_equipment_id +msgid "Equipment" +msgstr "Equipamiento" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "Equipo de Servicio de Campo" + +#. module: fieldservice_equipment_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_equipment_stock.fsm_equipment_form_view_stock +msgid "Inventory" +msgstr "Inventario" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_lot +msgid "Lot/Serial" +msgstr "Lote/Número de serie" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_picking_type +msgid "Picking Type" +msgstr "Tipo de recogida" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_product_template +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__product_id +msgid "Product" +msgstr "Producto" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,help:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "" +"Products with the 'Creates a FSM Equipment' flag will automatically be " +"converted to an FSM Equipment." +msgstr "" +"Los productos con el indicador \"Crea un equipo FSM\" se convertirán " +"automáticamente en un equipo FSM." + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__lot_id +msgid "Serial #" +msgstr "Número de serie #" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de Existencias" + +#~ msgid "Product Template" +#~ msgstr "Plantilla del Producto" diff --git a/fieldservice_equipment_stock/i18n/es_AR.po b/fieldservice_equipment_stock/i18n/es_AR.po new file mode 100644 index 0000000000..79648a30ca --- /dev/null +++ b/fieldservice_equipment_stock/i18n/es_AR.po @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_equipment_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-03 21:34+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\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 4.3.2\n" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "Create Fsm Equipment" +msgstr "Crear Equipo FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_product__create_fsm_equipment +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_template__create_fsm_equipment +msgid "Creates a FSM Equipment" +msgstr "Crea un Equipo FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__current_stock_location_id +msgid "Current Inventory Location" +msgstr "Ubicación Actual del Inventario" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_lot__fsm_equipment_id +msgid "Equipment" +msgstr "Equipo" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "Equipo de Servicio de Campo" + +#. module: fieldservice_equipment_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_equipment_stock.fsm_equipment_form_view_stock +msgid "Inventory" +msgstr "Inventario" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_lot +msgid "Lot/Serial" +msgstr "Lote / Número de Serie" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_picking_type +msgid "Picking Type" +msgstr "Tipo de Entrega" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_product_template +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__product_id +msgid "Product" +msgstr "Producto" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,help:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "" +"Products with the 'Creates a FSM Equipment' flag will automatically be " +"converted to an FSM Equipment." +msgstr "" +"Los productos marcados como 'Crea un Equipo FSM' se convertirán " +"automáticamente en un Equipo FSM." + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__lot_id +msgid "Serial #" +msgstr "Serie #" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de Inventario" + +#~ msgid "Product Template" +#~ msgstr "Plantilla del Producto" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/fieldservice_equipment_stock/i18n/fieldservice_equipment_stock.pot b/fieldservice_equipment_stock/i18n/fieldservice_equipment_stock.pot new file mode 100644 index 0000000000..d19a0d335a --- /dev/null +++ b/fieldservice_equipment_stock/i18n/fieldservice_equipment_stock.pot @@ -0,0 +1,78 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_equipment_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "Create Fsm Equipment" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_product__create_fsm_equipment +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_template__create_fsm_equipment +msgid "Creates a FSM Equipment" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__current_stock_location_id +msgid "Current Inventory Location" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_lot__fsm_equipment_id +msgid "Equipment" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_equipment_stock.fsm_equipment_form_view_stock +msgid "Inventory" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_lot +msgid "Lot/Serial" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_picking_type +msgid "Picking Type" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_product_template +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__product_id +msgid "Product" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,help:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "" +"Products with the 'Creates a FSM Equipment' flag will automatically be " +"converted to an FSM Equipment." +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__lot_id +msgid "Serial #" +msgstr "" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_move +msgid "Stock Move" +msgstr "" diff --git a/fieldservice_equipment_stock/i18n/it.po b/fieldservice_equipment_stock/i18n/it.po new file mode 100644 index 0000000000..2614d839ec --- /dev/null +++ b/fieldservice_equipment_stock/i18n/it.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_equipment_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-17 17:14+0000\n" +"Last-Translator: Francesco Foresti \n" +"Language-Team: none\n" +"Language: it\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 4.17\n" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "Create Fsm Equipment" +msgstr "Crea attrezzatura FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_product__create_fsm_equipment +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_template__create_fsm_equipment +msgid "Creates a FSM Equipment" +msgstr "Crea un'attrezzatura FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__current_stock_location_id +msgid "Current Inventory Location" +msgstr "Ubicazione giacenza attuale" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_lot__fsm_equipment_id +msgid "Equipment" +msgstr "Attrezzatura" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "Attrezzatura assistenza sul campo" + +#. module: fieldservice_equipment_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_equipment_stock.fsm_equipment_form_view_stock +msgid "Inventory" +msgstr "Inventario" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_lot +msgid "Lot/Serial" +msgstr "Lotto/Seriale" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_picking_type +msgid "Picking Type" +msgstr "Tipologia prelievo" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_product_template +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__product_id +msgid "Product" +msgstr "Prodotto" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,help:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "" +"Products with the 'Creates a FSM Equipment' flag will automatically be " +"converted to an FSM Equipment." +msgstr "" +"I prodotti con l'opzione 'Crea una attrezzatura FSM' saranno convertiti " +"automaticamente in una attrezzatura FSM." + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__lot_id +msgid "Serial #" +msgstr "Nr. seriale" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimento di magazzino" + +#~ msgid "Product Template" +#~ msgstr "Modello prodotto" diff --git a/fieldservice_equipment_stock/i18n/pt_BR.po b/fieldservice_equipment_stock/i18n/pt_BR.po new file mode 100644 index 0000000000..78001fd667 --- /dev/null +++ b/fieldservice_equipment_stock/i18n/pt_BR.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * fieldservice_equipment_stock +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-03-15 05:45+0000\n" +"Last-Translator: Marcel Savegnago \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 4.3.2\n" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "Create Fsm Equipment" +msgstr "Criar Equipamentos FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_product__create_fsm_equipment +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_product_template__create_fsm_equipment +msgid "Creates a FSM Equipment" +msgstr "Cria um Equipamento FSM" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__current_stock_location_id +msgid "Current Inventory Location" +msgstr "Localização de Inventário Atual" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_stock_lot__fsm_equipment_id +msgid "Equipment" +msgstr "Equipamento" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_fsm_equipment +msgid "Field Service Equipment" +msgstr "Equipamento de Serviço de Campo" + +#. module: fieldservice_equipment_stock +#: model_terms:ir.ui.view,arch_db:fieldservice_equipment_stock.fsm_equipment_form_view_stock +msgid "Inventory" +msgstr "Inventário" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_lot +msgid "Lot/Serial" +msgstr "Lote/Serie" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_picking_type +msgid "Picking Type" +msgstr "Tipo de Separação" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_product_template +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__product_id +msgid "Product" +msgstr "Produto" + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,help:fieldservice_equipment_stock.field_stock_picking_type__create_fsm_equipment +msgid "" +"Products with the 'Creates a FSM Equipment' flag will automatically be " +"converted to an FSM Equipment." +msgstr "" +"Produtos com o sinalizador ‘Cria um Equipamento FSM’ serão automaticamente " +"convertidos em um Equipamento FSM." + +#. module: fieldservice_equipment_stock +#: model:ir.model.fields,field_description:fieldservice_equipment_stock.field_fsm_equipment__lot_id +msgid "Serial #" +msgstr "Série #" + +#. module: fieldservice_equipment_stock +#: model:ir.model,name:fieldservice_equipment_stock.model_stock_move +msgid "Stock Move" +msgstr "Movimento de Estoque" + +#~ msgid "Product Template" +#~ msgstr "Modelo de Produto" diff --git a/fieldservice_equipment_stock/models/__init__.py b/fieldservice_equipment_stock/models/__init__.py new file mode 100644 index 0000000000..cbea216dc5 --- /dev/null +++ b/fieldservice_equipment_stock/models/__init__.py @@ -0,0 +1,7 @@ +from . import ( + stock_move, + stock_picking_type, + fsm_equipment, + product_template, + stock_lot, +) diff --git a/fieldservice_equipment_stock/models/fsm_equipment.py b/fieldservice_equipment_stock/models/fsm_equipment.py new file mode 100644 index 0000000000..9c50770efa --- /dev/null +++ b/fieldservice_equipment_stock/models/fsm_equipment.py @@ -0,0 +1,46 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class FSMEquipment(models.Model): + _inherit = "fsm.equipment" + + product_id = fields.Many2one("product.product", string="Product") + lot_id = fields.Many2one("stock.lot", string="Serial #") + current_stock_location_id = fields.Many2one( + "stock.location", + string="Current Inventory Location", + compute="_compute_current_stock_loc_id", + ) + + @api.depends("product_id", "lot_id") + def _compute_current_stock_loc_id(self): + stock_quant_obj = self.env["stock.quant"] + for equipment in self: + quants = stock_quant_obj.search( + [("lot_id", "=", equipment.lot_id.id)], order="id desc", limit=1 + ) + equipment.current_stock_location_id = ( + quants.location_id and quants.location_id.id or False + ) + + @api.onchange("product_id") + def _onchange_product(self): + self.current_stock_location_id = False + + @api.model_create_multi + def create(self, vals_list): + equipments = super().create(vals_list) + for equipment in equipments: + if equipment.lot_id: + equipment.lot_id.fsm_equipment_id = equipment.id + return equipments + + def write(self, vals): + res = super().write(vals) + for equipment in self: + if "lot_id" in vals: + equipment.lot_id.fsm_equipment_id = equipment.id + return res diff --git a/fieldservice_equipment_stock/models/product_template.py b/fieldservice_equipment_stock/models/product_template.py new file mode 100644 index 0000000000..d0bb3485db --- /dev/null +++ b/fieldservice_equipment_stock/models/product_template.py @@ -0,0 +1,10 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + create_fsm_equipment = fields.Boolean(string="Creates a FSM Equipment") diff --git a/fieldservice_equipment_stock/models/stock_lot.py b/fieldservice_equipment_stock/models/stock_lot.py new file mode 100644 index 0000000000..70433a9037 --- /dev/null +++ b/fieldservice_equipment_stock/models/stock_lot.py @@ -0,0 +1,10 @@ +# Copyright (C) 2018 - TODAY, Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockLot(models.Model): + _inherit = "stock.lot" + + fsm_equipment_id = fields.Many2one("fsm.equipment", string="Equipment") diff --git a/fieldservice_equipment_stock/models/stock_move.py b/fieldservice_equipment_stock/models/stock_move.py new file mode 100644 index 0000000000..34ae85beab --- /dev/null +++ b/fieldservice_equipment_stock/models/stock_move.py @@ -0,0 +1,33 @@ +# Copyright (C) 2018 Brian McMaster +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models + + +class StockMove(models.Model): + _inherit = "stock.move" + + def prepare_equipment_values(self, move_line): + move = move_line.move_id + return { + "name": f"{move_line.product_id.name} ({move_line.lot_id.name})", + "product_id": move_line.product_id.id, + "lot_id": move_line.lot_id.id, + "location_id": move.fsm_order_id.location_id.id, + "current_location_id": move.fsm_order_id.location_id.id, + "current_stock_location_id": move_line.location_dest_id.id, + } + + def _action_done(self, cancel_backorder=False): + res = super()._action_done(cancel_backorder) + fsm_equipment_obj = self.env["fsm.equipment"] + for rec in self: + if ( + rec.state == "done" + and rec.picking_type_id.create_fsm_equipment + and rec.product_tmpl_id.create_fsm_equipment + ): + for line in rec.move_line_ids: + line.lot_id.fsm_equipment_id = fsm_equipment_obj.create( + self.prepare_equipment_values(line) + ) + return res diff --git a/fieldservice_equipment_stock/models/stock_picking_type.py b/fieldservice_equipment_stock/models/stock_picking_type.py new file mode 100644 index 0000000000..f4001b609e --- /dev/null +++ b/fieldservice_equipment_stock/models/stock_picking_type.py @@ -0,0 +1,13 @@ +# Copyright (C) 2020 Open Source Integrators, Daniel Reis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class StockPickingType(models.Model): + _inherit = "stock.picking.type" + + create_fsm_equipment = fields.Boolean( + name="Create FSM Equipment", + help="Products with the 'Creates a FSM Equipment' flag " + "will automatically be converted to an FSM Equipment.", + ) diff --git a/fieldservice_equipment_stock/pyproject.toml b/fieldservice_equipment_stock/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/fieldservice_equipment_stock/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/fieldservice_equipment_stock/readme/CONFIGURE.md b/fieldservice_equipment_stock/readme/CONFIGURE.md new file mode 100644 index 0000000000..7f8447a611 --- /dev/null +++ b/fieldservice_equipment_stock/readme/CONFIGURE.md @@ -0,0 +1,19 @@ +Products can be automatically converted into FSM Equipments. This is +only available only for products tracked by serial number. This needs to +be enabled both on Operation Types and Products. For example, we may +want to create the FSM Equipment on Delivery, or on Receipts. + +To enable on Products: + +- Go to Inventory \> Master Data \> Products +- Open the Product form, Inventory tab +- On the "Traceability" section, make sure "Tracking" is set to "By + Unique Serial Number" +- Enable the "Creates FSM Equipment" checkbox + +To enable on Operation Types: + +- Go to Inventory \> Configuration \> Operation Types +- Select the intended Operation Type ("Receipts" for example) +- On the "Traceability" section, enable the "Create FSM Equipment" + checkbox diff --git a/fieldservice_equipment_stock/readme/CONTRIBUTORS.md b/fieldservice_equipment_stock/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..13c81b1305 --- /dev/null +++ b/fieldservice_equipment_stock/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Brian McMaster \<\> +- Sandip Mangukiya \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Marcel Savegnago \<\> +- [XCG Consulting](https://xcg-consulting.fr): + - Szeka Wong diff --git a/fieldservice_equipment_stock/readme/CREDITS.md b/fieldservice_equipment_stock/readme/CREDITS.md new file mode 100644 index 0000000000..7e4827b0a8 --- /dev/null +++ b/fieldservice_equipment_stock/readme/CREDITS.md @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +- Open Source Integrators \<\> diff --git a/fieldservice_equipment_stock/readme/DESCRIPTION.md b/fieldservice_equipment_stock/readme/DESCRIPTION.md new file mode 100644 index 0000000000..151274bb96 --- /dev/null +++ b/fieldservice_equipment_stock/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module is an add-on for the Field Service application in Odoo. It +allows you to track your FSM Equipments in stock moves. diff --git a/fieldservice_equipment_stock/readme/ROADMAP.md b/fieldservice_equipment_stock/readme/ROADMAP.md new file mode 100644 index 0000000000..e14dbdee6f --- /dev/null +++ b/fieldservice_equipment_stock/readme/ROADMAP.md @@ -0,0 +1,2 @@ +The roadmap of the Field Service application is documented on +[Github](https://github.com/OCA/field-service/issues/1). diff --git a/fieldservice_equipment_stock/readme/USAGE.md b/fieldservice_equipment_stock/readme/USAGE.md new file mode 100644 index 0000000000..1dd65def24 --- /dev/null +++ b/fieldservice_equipment_stock/readme/USAGE.md @@ -0,0 +1,3 @@ +A completed stock move for a properly configured Product on a configured +stock Operation Type will automatically create a field service +equipment. diff --git a/fieldservice_equipment_stock/security/ir.model.access.csv b/fieldservice_equipment_stock/security/ir.model.access.csv new file mode 100644 index 0000000000..431ba34601 --- /dev/null +++ b/fieldservice_equipment_stock/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_picking_type_portal,access.stock.picking.type.portal,stock.model_stock_picking_type,base.group_portal,1,0,0,0 diff --git a/fieldservice_equipment_stock/static/description/icon.png b/fieldservice_equipment_stock/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/fieldservice_equipment_stock/static/description/icon.png differ diff --git a/fieldservice_equipment_stock/static/description/index.html b/fieldservice_equipment_stock/static/description/index.html new file mode 100644 index 0000000000..82238065be --- /dev/null +++ b/fieldservice_equipment_stock/static/description/index.html @@ -0,0 +1,478 @@ + + + + + +Field Service - Stock Equipment + + + +
+

Field Service - Stock Equipment

+ + +

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

+

This module is an add-on for the Field Service application in Odoo. It +allows you to track your FSM Equipments in stock moves.

+

Table of contents

+ +
+

Configuration

+

Products can be automatically converted into FSM Equipments. This is +only available only for products tracked by serial number. This needs to +be enabled both on Operation Types and Products. For example, we may +want to create the FSM Equipment on Delivery, or on Receipts.

+

To enable on Products:

+
    +
  • Go to Inventory > Master Data > Products
  • +
  • Open the Product form, Inventory tab
  • +
  • On the “Traceability” section, make sure “Tracking” is set to “By +Unique Serial Number”
  • +
  • Enable the “Creates FSM Equipment” checkbox
  • +
+

To enable on Operation Types:

+
    +
  • Go to Inventory > Configuration > Operation Types
  • +
  • Select the intended Operation Type (“Receipts” for example)
  • +
  • On the “Traceability” section, enable the “Create FSM Equipment” +checkbox
  • +
+
+
+

Usage

+

A completed stock move for a properly configured Product on a configured +stock Operation Type will automatically create a field service +equipment.

+
+
+

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 to smash 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_equipment_stock/tests/__init__.py b/fieldservice_equipment_stock/tests/__init__.py new file mode 100644 index 0000000000..81851e3f98 --- /dev/null +++ b/fieldservice_equipment_stock/tests/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2020 - TODAY, Marcel Savegnago (Escodoo) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from . import test_fsm_equipment +from . import test_stock_move diff --git a/fieldservice_equipment_stock/tests/test_fsm_equipment.py b/fieldservice_equipment_stock/tests/test_fsm_equipment.py new file mode 100644 index 0000000000..830b1c06e8 --- /dev/null +++ b/fieldservice_equipment_stock/tests/test_fsm_equipment.py @@ -0,0 +1,88 @@ +# Copyright (C) 2020 - TODAY, Marcel Savegnago (Escodoo) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests import Form, TransactionCase + + +class TestFSMEquipment(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.Equipment = cls.env["fsm.equipment"] + cls.stock_location = cls.env.ref("stock.stock_location_customers") + cls.current_location = cls.env.ref("fieldservice.location_1") + cls.test_location = cls.env.ref("fieldservice.test_location") + + currency = cls.env["res.currency"].create( + { + "name": "Currency 1", + "symbol": "$", + } + ) + partner = cls.env["res.partner"].create( + { + "name": "Partner 1", + } + ) + cls.company1 = cls.env["res.company"].create( + { + "name": "Company 1", + "currency_id": currency.id, + "partner_id": partner.id, + } + ) + cls.product1 = cls.env["product.product"].create( + { + "name": "Product A", + "type": "consu", + "is_storable": True, + "tracking": "serial", + } + ) + cls.lot1 = cls.env["stock.lot"].create( + { + "name": "serial1", + "product_id": cls.product1.id, + "company_id": cls.company1.id, + } + ) + cls.env["stock.quant"].create( + { + "product_id": cls.product1.id, + "location_id": cls.stock_location.id, + "quantity": 1.0, + "lot_id": cls.lot1.id, + } + ) + + cls.equipment = cls.Equipment.create( + { + "name": "Equipment 1", + "product_id": cls.product1.id, + "lot_id": cls.lot1.id, + "current_stock_location_id": cls.stock_location.id, + } + ) + + def test_onchange_product(self): + equipment = self.equipment + equipment._onchange_product() + self.assertFalse(equipment.current_stock_location_id) + + def test_compute_current_stock_loc_id(self): + equipment = self.equipment + equipment._compute_current_stock_loc_id() + self.assertTrue(equipment.current_stock_location_id == self.stock_location) + + def test_fsm_equipment(self): + # Create an equipment + view_id = "fieldservice.fsm_equipment_form_view" + with Form(self.Equipment, view=view_id) as f: + f.name = "Test Equipment 1" + f.current_location_id = self.current_location + f.location_id = self.test_location + f.lot_id = self.lot1 + f.product_id = self.product1 + equipment = f.save() + + self.assertEqual(f.id, equipment.lot_id.fsm_equipment_id.id) diff --git a/fieldservice_equipment_stock/tests/test_stock_move.py b/fieldservice_equipment_stock/tests/test_stock_move.py new file mode 100644 index 0000000000..ccfebc0579 --- /dev/null +++ b/fieldservice_equipment_stock/tests/test_stock_move.py @@ -0,0 +1,62 @@ +# Copyright (C) 2021 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import TransactionCase + + +class TestStockMove(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.Move = cls.env["stock.move"] + cls.stock_location = cls.env.ref("stock.stock_location_customers") + cls.supplier_location = cls.env.ref("stock.stock_location_suppliers") + cls.stock_location = cls.env.ref("stock.stock_location_stock") + cls.uom_unit = cls.env.ref("uom.product_uom_unit") + + def test_action_done(self): + # Create product template + templateAB = self.env["product.template"].create( + { + "name": "templAB", + "uom_id": self.uom_unit.id, + "type": "consu", + "is_storable": True, + "tracking": "none", + } + ) + + # Create product A and B + productA = self.env["product.product"].create( + { + "name": "product A", + "standard_price": 1, + "type": "consu", + "is_storable": True, + "tracking": "none", + "uom_id": self.uom_unit.id, + "default_code": "A", + "product_tmpl_id": templateAB.id, + } + ) + + # Create a stock move from INCOMING to STOCK + stockMoveInA = self.env["stock.move"].create( + { + "location_id": self.supplier_location.id, + "location_dest_id": self.stock_location.id, + "name": "MOVE INCOMING -> STOCK ", + "product_id": productA.id, + "product_uom": productA.uom_id.id, + "product_uom_qty": 2, + } + ) + + stockMoveInA.quantity = stockMoveInA.product_uom_qty + stockMoveInA._action_confirm() + stockMoveInA._action_assign() + stockMoveInA.picked = True + stockMoveInA._action_done() + + self.assertEqual("done", stockMoveInA.state) diff --git a/fieldservice_equipment_stock/views/fsm_equipment.xml b/fieldservice_equipment_stock/views/fsm_equipment.xml new file mode 100644 index 0000000000..a533ad542f --- /dev/null +++ b/fieldservice_equipment_stock/views/fsm_equipment.xml @@ -0,0 +1,32 @@ + + + fsm.equipment.form.stock + fsm.equipment + + + + + + + + + + + + + + fsm.equipment.model + fsm.equipment + + + + + + + + diff --git a/fieldservice_equipment_stock/views/product_template.xml b/fieldservice_equipment_stock/views/product_template.xml new file mode 100644 index 0000000000..0b2e4fca2f --- /dev/null +++ b/fieldservice_equipment_stock/views/product_template.xml @@ -0,0 +1,11 @@ + + + product.template + + + + + + + + diff --git a/fieldservice_equipment_stock/views/stock_lot.xml b/fieldservice_equipment_stock/views/stock_lot.xml new file mode 100644 index 0000000000..7d7c404fc8 --- /dev/null +++ b/fieldservice_equipment_stock/views/stock_lot.xml @@ -0,0 +1,23 @@ + + + stock.lot + + + + + + + + + + + + {'search_default_group_by_product': 1, + 'default_product_id': context.get('product_id', False)} + + + diff --git a/fieldservice_equipment_stock/views/stock_picking_type.xml b/fieldservice_equipment_stock/views/stock_picking_type.xml new file mode 100644 index 0000000000..87c8eef571 --- /dev/null +++ b/fieldservice_equipment_stock/views/stock_picking_type.xml @@ -0,0 +1,11 @@ + + + stock.picking.type + + + + + + + +