Metadata-Version: 2.1
Name: odoo-addon-fieldservice_mobile
Version: 19.0.1.2.0
Requires-Dist: odoo-addon-fieldservice_sale==19.0.*
Requires-Dist: odoo-addon-fieldservice_stage_server_action==19.0.*
Requires-Dist: odoo-addon-fieldservice_vehicle==19.0.*
Requires-Dist: odoo==19.0.*
Summary: Field Service Mobile Backend Support.
Home-page: https://github.com/ursais/osi-addons
License: AGPL-3
Author: Open Source Integrators
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 19.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 4 - Beta
Description-Content-Type: text/x-rst

======================
Field Service - Mobile
======================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:f574ef315463d1109a8bf128be06b184255d572ddfcfa756191d5d331eac5ab7
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-ursais%2Fosi--addons-lightgray.png?logo=github
    :target: https://github.com/ursais/osi-addons/tree/19.0/fieldservice_mobile
    :alt: ursais/osi-addons

|badge1| |badge2| |badge3|

This module provides backend support for the Field Service mobile
application. It manages mobile-specific stage visibility, stage duration
tracking, portal configuration, dynamic feature mapping by security
group, and payment link generation for field service orders linked to
sales orders. Portal technicians use the **Field Service Mobile / Portal
Worker** group, which grants the ACLs required by the app while
restricting access to orders assigned to that worker.

It also exposes HTTP endpoints used by the offline-capable mobile
client:

- ``POST /fsm/sync`` — apply order updates, clock punches
  (``fsm.stage.history``) and signature in a single atomic transaction
- ``POST /fsm/photo`` — multipart upload that creates ``ir.attachment``
  without base64 RPC
- ``POST /fsm/pull`` — delta pull of orders assigned to the current
  technician (``person_id`` / ``person_ids``), filtered by
  ``write_date``

**Table of contents**

.. contents::
   :local:

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

To configure mobile stages:

- Go to **Field Service > Configuration > Stages**.
- Enable **Display in Mobile** for stages that should appear in the
  mobile app.
- Enable **Display in Odoo** for stages that should appear on FSM orders
  in Odoo.
- Assign a server action on stages that require automated updates.

To configure automated actions tied to stage sequences, adjust the
domain on each automation under **Settings > Technical > Automation >
Automated Actions**.

To configure mobile features:

- Go to **Field Service > Configuration > FSM Mobile Features**.
- Select installed modules for the dynamic mobile menu.
- Activate a feature mapping record and assign security groups per
  feature line.

To allow a portal technician to use the mobile app:

- Create (or open) the portal user and add the **Field Service Mobile /
  Portal Worker** group (implies Portal).
- Link that user partner to an ``fsm.person`` worker.
- Assign orders to that worker (``person_id`` / ``person_ids``); record
  rules limit portal workers to their own orders.
- Default feature lines already include the portal worker group; adjust
  per-feature groups if you need a narrower mobile menu.

**Upgrade note:** FSM mobile ACLs are no longer granted to every Portal
user. After upgrading this module, assign **Portal Worker** to each
technician who should keep using the app; otherwise they lose access to
orders, attachments, and sync APIs.

Usage
=====

1. Open the **Field Service** application.
2. Under **Configuration**, open **FSM Mobile Features**.
3. Select installed modules and feature lines for the mobile menu.
4. Assign security groups to control which features each user can
   access.
5. Activate the desired feature mapping record.

Portal technicians must be in the **Field Service Mobile / Portal
Worker** group. They then see only orders assigned to their linked
``fsm.person``, plus the features and attachments allowed by the active
feature mapping and stock visibility settings.

Mobile sync API
---------------

Authenticated mobile sessions (**Portal Worker** or internal workers
linked to an ``fsm.person`` via ``partner_id``) can call:

Batch sync — ``POST /fsm/sync`` (``type=jsonrpc``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: json

   {
     "jsonrpc": "2.0",
     "method": "call",
     "params": {
       "order_id": 12,
       "order": {"stage_id": 5, "resolution": "Done"},
       "clocks": [
         {
           "stage_id": 6,
           "start_datetime": "2026-07-24 15:00:00",
           "duration": 0.5,
           "total_duration": 1.0
         }
       ],
       "signature": {
         "signed_by": "Jane Doe",
         "signature": "<base64 png>"
       }
     }
   }

Use ``"mutations": [ {...}, {...} ]`` to push several orders in the same
request / transaction.

Photo upload — ``POST /fsm/photo`` (``multipart/form-data``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fields: ``csrf_token`` (required), ``order_id``, optional ``name``, and
a file field named ``ufile``, ``file``, ``photo`` or ``attachment``.
Obtain ``csrf_token`` from the session (e.g.
``/web/session/authenticate`` / ``/web/session/get_session_info``).

Delta pull — ``POST /fsm/pull`` (``type=jsonrpc``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: json

   {
     "params": {
       "since": "2026-07-24 00:00:00",
       "limit": 80,
       "offset": 0
     }
   }

Returns only orders where the current user's ``fsm.person`` is
``person_id`` or in ``person_ids``, optionally filtered with
``write_date > since``.

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

Bugs are tracked on `GitHub Issues <https://github.com/ursais/osi-addons/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 <https://github.com/ursais/osi-addons/issues/new?body=module:%20fieldservice_mobile%0Aversion:%2019.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
-------

* Open Source Integrators

Contributors
------------

- Wolfgang Hall <whall@graymatterlogic.com>
- Sandip Mangukiya <smangukiya@graymatterlogic.com>
- Ammar Officewala <aofficewala@graymatterlogic.com>
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
- `Gray Matter Logic <https://www.graymatterlogic.com>`__:

  - Maxime Chambreuil <maxime.chambreuil@graymatterlogic.com>

Other credits
-------------

The development of this module was originally supported by Open Source
Integrators.

Maintainers
-----------

.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px
    :target: https://github.com/max3903
    :alt: max3903

Current maintainer:

|maintainer-max3903| 

This module is part of the `ursais/osi-addons <https://github.com/ursais/osi-addons/tree/19.0/fieldservice_mobile>`_ project on GitHub.

You are welcome to contribute.
