Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0] [MIG] fieldservice_sale_stock #673

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f937347
[ADD] fieldservice_sale_stock
brian10048 Nov 20, 2019
3b3b361
[IMP] fieldservice_sale_stock: Auto Install module
brian10048 Dec 6, 2019
9dfbdf4
[FIX] fieldservice_sale
brian10048 Dec 6, 2019
a8c89ee
[FIX] fieldservice_sale_stock: Expecting one result
max3903 Dec 10, 2019
865bb07
[UPD] Update fieldservice_sale_stock.pot
oca-travis Dec 10, 2019
2d16fbf
[UPD] README.rst
OCA-git-bot Dec 10, 2019
544cedd
[IMP] fieldservice_sale_stock
max3903 Dec 22, 2019
90c3fc9
fieldservice_sale_stock 12.0.1.0.1
OCA-git-bot Dec 30, 2019
cad4f14
Added translation using Weblate (Spanish (Chile))
Jan 3, 2020
63ae9d5
[IMP] fieldservice_sale_stock
max3903 Jan 9, 2020
ffaefff
fieldservice_sale_stock 12.0.1.0.2
OCA-git-bot Jan 14, 2020
4cb48e2
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Jan 16, 2020
6c1e933
[ADD] Spanish (es) translation
max3903 Jan 16, 2020
94bbfe7
[IMP] fieldservice_sale_stock
max3903 Feb 3, 2020
4b7716e
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 5, 2020
5052dca
fieldservice_sale_stock 12.0.1.0.3
OCA-git-bot Feb 9, 2020
acfda33
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 25, 2020
1d058bf
Translated using Weblate (Spanish)
Mar 25, 2020
0425e85
[FIX] fieldservice_sale_stock: Set the FSM order on the procurement g…
max3903 May 12, 2020
a9ff143
[FIX] fieldservice_sale_stock
max3903 May 20, 2020
a3621d8
fieldservice_sale_stock 12.0.1.0.4
OCA-git-bot May 20, 2020
f90b7a9
Translated using Weblate (Spanish (Chile))
Jun 7, 2020
ea778d4
Translated using Weblate (Spanish)
Jun 7, 2020
0190378
[IMP] fieldservice_sale_stock: black, isort, prettier
Oct 7, 2020
9ee46ea
[MIG] fieldservice_sale_stock: Migration to 13.0
RLeeOSI Oct 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions fieldservice_sale_stock/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
==========================
Field Service - Sale 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_sale_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_sale_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 links pickings created by a sale order to the field
service order created by the sale order.

**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/12.0/base_geoengine

Configuration
=============

Configure a storable product that generates a unique field service order for
an individual sale order:

* Go to Sales > Catalog > Products
* Create or select a product
* Set the type to 'Storable'
* Set the Service Policy to 'Per Sale Order'

Usage
=====

* Go to Sales
* Create a new Quotation/Sale Order
* Set the FSM Location to be used
* On a Sale Order Line, select a product configured for field service orders
* Confirm the Sale Order
* Field Service orders linked to SO lines are created
* The pickings for storable products will get linked to the newly created
field service order

Known issues / Roadmap
======================

The roadmap of the Field Service application is documented on
`Github <https://github.com/OCA/field-service/issues/1>`_.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/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 <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_sale_stock%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Brian McMaster

Contributors
~~~~~~~~~~~~

* Brian McMaster <[email protected]>

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-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-brian10048| image:: https://github.com/brian10048.png?size=40px
:target: https://github.com/brian10048
:alt: brian10048

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-wolfhall| |maintainer-max3903| |maintainer-brian10048|

This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/12.0/fieldservice_sale_stock>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions fieldservice_sale_stock/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2019 Brian McMaster
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
17 changes: 17 additions & 0 deletions fieldservice_sale_stock/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (C) 2019 Brian McMaster
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Field Service - Sale Stock",
"version": "13.0.1.0.0",
"summary": "Sell stockable items linked to field service orders.",
"category": "Field Service",
"author": "Brian McMaster, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/field-service",
"depends": ["fieldservice_sale", "fieldservice_stock"],
"license": "AGPL-3",
"development_status": "Beta",
"maintainers": ["wolfhall", "max3903", "brian10048"],
"installable": True,
"auto_install": True,
}
22 changes: 22 additions & 0 deletions fieldservice_sale_stock/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_sale_stock
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-06-07 05:19+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\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_sale_stock
#: model:ir.model,name:fieldservice_sale_stock.model_sale_order
msgid "Sale Order"
msgstr "Pedido de Venta"
22 changes: 22 additions & 0 deletions fieldservice_sale_stock/i18n/es_CL.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_sale_stock
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-06-07 05:19+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\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_sale_stock
#: model:ir.model,name:fieldservice_sale_stock.model_sale_order
msgid "Sale Order"
msgstr "Nota de Venta"
20 changes: 20 additions & 0 deletions fieldservice_sale_stock/i18n/fieldservice_sale_stock.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_sale_stock
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.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_sale_stock
#: model:ir.model,name:fieldservice_sale_stock.model_sale_order
msgid "Sale Order"
msgstr ""

22 changes: 22 additions & 0 deletions fieldservice_sale_stock/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * fieldservice_sale_stock
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-02-25 09:13+0000\n"
"Last-Translator: Marcel Savegnago <[email protected]>\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_sale_stock
#: model:ir.model,name:fieldservice_sale_stock.model_sale_order
msgid "Sale Order"
msgstr "Pedido de Venda"
4 changes: 4 additions & 0 deletions fieldservice_sale_stock/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2019 Brian McMaster
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import sale_order
38 changes: 38 additions & 0 deletions fieldservice_sale_stock/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (C) 2019 Brian McMaster
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models


class SaleOrder(models.Model):
_inherit = "sale.order"

def prepare_fsm_values_for_stock_move(self, fsm_order):
return {
"fsm_order_id": fsm_order.id,
}

def prepare_fsm_values_for_stock_picking(self, fsm_order):
return {
"fsm_order_id": fsm_order.id,
}

def _link_pickings_to_fsm(self):
for rec in self:
# TODO: We may want to split the picking to have one picking
# per FSM order
fsm_order = self.env["fsm.order"].search(
[("sale_id", "=", rec.id), ("sale_line_id", "=", False)]
)
if rec.procurement_group_id:
rec.procurement_group_id.fsm_order_id = fsm_order.id or False
for picking in rec.picking_ids:
picking.write(rec.prepare_fsm_values_for_stock_picking(fsm_order))
for move in picking.move_lines:
move.write(rec.prepare_fsm_values_for_stock_move(fsm_order))

def _action_confirm(self):
""" On SO confirmation, link the fsm order on the pickings
created by the sale order """
res = super()._action_confirm()
self._link_pickings_to_fsm()
return res
7 changes: 7 additions & 0 deletions fieldservice_sale_stock/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Configure a storable product that generates a unique field service order for
an individual sale order:

* Go to Sales > Catalog > Products
* Create or select a product
* Set the type to 'Storable'
* Set the Service Policy to 'Per Sale Order'
2 changes: 2 additions & 0 deletions fieldservice_sale_stock/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Brian McMaster <[email protected]>
* Raphael Lee <[email protected]>
2 changes: 2 additions & 0 deletions fieldservice_sale_stock/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module links pickings created by a sale order to the field
service order created by the sale order.
4 changes: 4 additions & 0 deletions fieldservice_sale_stock/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions fieldservice_sale_stock/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The roadmap of the Field Service application is documented on
`Github <https://github.com/OCA/field-service/issues/1>`_.
8 changes: 8 additions & 0 deletions fieldservice_sale_stock/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Go to Sales
* Create a new Quotation/Sale Order
* Set the FSM Location to be used
* On a Sale Order Line, select a product configured for field service orders
* Confirm the Sale Order
* Field Service orders linked to SO lines are created
* The pickings for storable products will get linked to the newly created
field service order
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading