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

[16.0][MIG] - shopfloor_base #642

Merged
merged 111 commits into from
Dec 26, 2023
Merged
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
d283df6
Add shopfloor_base (split from shopfloor)
simahawk Feb 2, 2021
b80b7f0
shopfloor_base: add shopfloor.scenario
simahawk Feb 2, 2021
a59b68f
shopfloor_base: decouple actions lookup from service
simahawk Feb 2, 2021
c6c7739
shopfloor_base: 'schema' is an action as well
simahawk Feb 2, 2021
7b8a5c3
shopfloor_base: scan anything delegate search
simahawk Feb 2, 2021
a05b26f
shopfloor_base: data|schema_detail are actions as well
simahawk Feb 2, 2021
6753527
shopfloor_base: actions_for must be private
simahawk Feb 2, 2021
e9b95dc
shopfloor_base: misc fixups
simahawk Feb 2, 2021
6a014a0
shopfloor_base: reorganize misc test classes
simahawk Feb 2, 2021
3e2bcf0
shopfloor_base: rework scan_anything tests
simahawk Feb 2, 2021
7913b2c
shopfloor_base: scan_anything allow limit record types scan
simahawk Feb 11, 2021
bfeaf94
shopfloor: fix copyright
simahawk Feb 12, 2021
bc18c54
shopfloor_base: keep relation menu <-> scenario for existing records
simahawk Feb 12, 2021
e5ef302
shopfloor_base: compute scenario for inactive menu
simahawk Feb 12, 2021
e816d18
shopfloor_base: move menu to app, add quick link to logs
simahawk Feb 12, 2021
5d4b307
shopfloor_base: pure json for scenario options edit
simahawk Feb 16, 2021
a2d74e5
shopfloor_base: update README
simahawk Feb 16, 2021
e047a13
shopfloor_base: drop dependency on rest_log
simahawk Feb 16, 2021
1d31fe3
shopfloor_base: re-license to LGPL
simahawk Feb 16, 2021
64b1237
shopfloor_base: fix group menu by scenario
simahawk Feb 17, 2021
7bdd28f
shopfloor_base: add TODO for scenario model
simahawk Feb 17, 2021
86a760d
shopfloor_base: log what done via hooks
simahawk Feb 18, 2021
a8224df
[UPD] README.rst
OCA-git-bot Feb 24, 2021
729994b
[ADD] icon.png
OCA-git-bot Feb 24, 2021
d126108
[UPD] Update shopfloor_base.pot
oca-travis Feb 24, 2021
387e988
shopfloor_base: use partner.display_name
sebalix Feb 25, 2021
a66a7f4
shopfloor_base 13.0.1.1.0
OCA-git-bot Mar 1, 2021
f964186
[MIG] shopfloor_base: Migration to 14.0
hparfr Mar 5, 2021
17f050c
[IMP] shopfloor_base: black, isort, prettier
hparfr Mar 5, 2021
17dbf10
[UPD] README.rst
OCA-git-bot Mar 5, 2021
f8ee122
Added translation using Weblate (Spanish (Argentina))
ibuioli Mar 31, 2021
2b62d68
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 31, 2021
bcb61b3
shopfloor_base: give demo user shopfloor permission
simahawk Feb 26, 2021
311a2f1
shopfloor_base: add generic msg for rec not found
simahawk Feb 26, 2021
6397dbc
shopfloor_base: service add properties for schema
simahawk Feb 26, 2021
862d72a
shopfloor_base: validator return None if not found
simahawk Feb 26, 2021
e9f98f3
shopfloor_base: add ACSONE to credits
simahawk Mar 3, 2021
c95dc25
shofloor: make menu picking type info not mandatory
simahawk Mar 8, 2021
b825f29
shopfloor: isolate menu items in tests
simahawk Mar 8, 2021
230b186
[UPD] README.rst
OCA-git-bot Apr 20, 2021
ea7e7b1
shopfloor_base 14.0.1.0.1
OCA-git-bot Apr 20, 2021
b8bc764
[UPD] Update shopfloor_base.pot
oca-travis May 31, 2021
de29598
Update translation files
oca-transbot May 31, 2021
26db75c
Translated using Weblate (Spanish (Argentina))
ibuioli Jun 5, 2021
9c14a23
shopfloor_base: adapt tests to base_rest change
simahawk Oct 14, 2021
c37b162
shopfloor_base 14.0.1.0.2
OCA-git-bot Oct 14, 2021
bdcc58a
shopfloor_base: unify exposed model usage
simahawk Nov 17, 2021
1067acc
sf_base: profiles and menu load w/out permission check
simahawk Nov 17, 2021
f6f48d2
shopfloor_base 14.0.1.1.0
OCA-git-bot Nov 17, 2021
701e8e8
shopfloor_base: dev status -> Beta
simahawk Jan 18, 2022
ff65f85
[UPD] README.rst
OCA-git-bot Jan 19, 2022
8a5d09f
shopfloor_base 14.0.1.2.0
OCA-git-bot Jan 19, 2022
78313e9
[IMP] shopfloor_base: add app menu icon
petrus-v Nov 3, 2021
966f244
[UPD] README.rst
OCA-git-bot Feb 15, 2022
b22940e
shopfloor_base 14.0.1.2.1
OCA-git-bot Feb 15, 2022
e593a3a
[14.0] shopfloor_base: add icon.svg file used to generate .png file
petrus-v Feb 16, 2022
f0e3e88
shopfloor_base 14.0.1.2.2
OCA-git-bot Mar 11, 2022
53a5634
shopfloor_base: add app backend
simahawk Oct 14, 2021
35a4c84
shopfloor_base: test files better naming
simahawk Oct 21, 2021
910ad99
shopfloor_base: get rid of static controller
simahawk Oct 26, 2021
2c46a3c
shopfloor.app: index tech_name
simahawk Nov 3, 2021
0200f8d
shopfloor.app: rework route registration
simahawk Nov 2, 2021
de5e6d2
shopfloor_base: add default app
simahawk Nov 13, 2021
f5befad
sf_base: shopfloor.app load services when available
simahawk Nov 13, 2021
87b4ccf
sf_base: tests unify service get
simahawk Nov 14, 2021
e62be14
shopfloor: unify service lookup in tests
simahawk Nov 16, 2021
1627f57
sf_base: shopfloor.app fix and test endpoint registration
simahawk Nov 15, 2021
2671d9c
sf_base: shopfloor.app display registered routes
simahawk Nov 15, 2021
eff3649
shopfloor.app: register only static routes
simahawk Nov 18, 2021
9dfe2ab
sf_base: limit profiles and menu items by app
simahawk Nov 18, 2021
1a1874c
shopfloor_base: add per app api-docs
simahawk Nov 19, 2021
0185b70
shopfloor_base: apps menu 1st
simahawk Nov 20, 2021
61d3de3
shopfloor_base: fix test service setup
simahawk Nov 20, 2021
4496218
shopfloor_base: get rid of api key left overs
simahawk Nov 26, 2021
bd60bcd
shopflor.app: add category
simahawk Nov 26, 2021
8ec9538
shopfloor.app: add btn to view menu items
simahawk Nov 26, 2021
d7615c5
shopfloor.app: improve form view
simahawk Nov 26, 2021
bdb74db
shopfloor.app: comp registry check reusable
simahawk Dec 8, 2021
b251078
sf_mobile_base: emit sync event
simahawk Feb 7, 2022
fa527ea
shopfloor_base: fix form mixin validators
simahawk Feb 16, 2022
23c40a2
shopfloor_base: fix common setup
simahawk Jan 20, 2022
648786b
shopfloor_base: 14.0.2.0.0
simahawk Nov 26, 2021
21b10d3
Translated using Weblate (Spanish (Argentina))
ibuioli Apr 10, 2022
e1e1e45
shopfloor*: base_jsonify -> jsonifier
simahawk Apr 22, 2022
61c1554
shopfloor_base 14.0.2.1.0
OCA-git-bot Apr 26, 2022
ebf5bf4
shopfloor_base: add api_url_for_service
simahawk Apr 28, 2022
df4e09a
shopfloor_base: add base http test class
simahawk Apr 28, 2022
7da3bdb
shopfloor_base 14.0.2.2.0
OCA-git-bot Apr 28, 2022
75fd250
shopfloor_base: move version and info to core
simahawk Apr 28, 2022
9759f22
shopfloor_base 14.0.2.3.0
OCA-git-bot Apr 29, 2022
c8bdef0
Update translation files
oca-transbot Apr 29, 2022
60a7ccf
shopfloor_base: add lang settings
simahawk Apr 29, 2022
b9acd3a
shopfloor_base: take user lang on login
simahawk Apr 29, 2022
f2a22d9
shopfloor_base 14.0.2.4.0
OCA-git-bot May 3, 2022
0ea0068
shopfloor*: fix datetime handling
simahawk May 3, 2022
4f3e00f
shopfloor_base 14.0.2.4.1
OCA-git-bot May 4, 2022
f5c2072
Translated using Weblate (Spanish (Argentina))
ibuioli May 6, 2022
10e8236
shopfloor_mobile_base: expose entire url in app info
JuMiSanAr May 10, 2022
074f5d0
shopfloor_base 14.0.2.5.0
OCA-git-bot May 12, 2022
b1a3bab
sf_mobile_base: move manifest making to app model
simahawk Oct 25, 2022
15adac3
shopfloor_base: include env in name
simahawk Oct 25, 2022
7ceb011
shopfloor_base 14.0.2.6.0
OCA-git-bot Oct 25, 2022
015c869
shopfloor_base: improve profile
TDu Nov 3, 2022
cba7410
shopfloor_base 14.0.2.7.0
OCA-git-bot Nov 7, 2022
929f0fa
Translated using Weblate (Spanish (Argentina))
ibuioli Nov 9, 2022
7f43942
[IMP] shopfloor_base: add actions for locking records
mt-software-de Feb 22, 2023
be23a70
shopfloor_base 14.0.2.8.0
OCA-git-bot Feb 22, 2023
79a9958
shopfloor_base: cross worker fix
simahawk Jul 26, 2022
855b0c6
shopfloor_base: use route handler tool
simahawk Feb 17, 2023
2a7e3be
[16.0][MIG] - shopfloor_base
sbejaoui May 25, 2023
26f0096
[MIG] shopfloor_base: fix endpoint values generation
lmignon Jul 17, 2023
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
1 change: 1 addition & 0 deletions setup/shopfloor_base/odoo/addons/shopfloor_base
6 changes: 6 additions & 0 deletions setup/shopfloor_base/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
185 changes: 185 additions & 0 deletions shopfloor_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
==============
Shopfloor Base
==============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwms-lightgray.png?logo=github
:target: https://github.com/OCA/wms/tree/14.0/shopfloor_base
:alt: OCA/wms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-shopfloor_base
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/285/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

Shopfloor is a barcode scanner application.

This module provides REST APIs to support scenario. It needs a frontend
to consume the backend APIs and provide screens for users on barcode devices.
A default front-end application is provided by ``shopfloor_mobile_base``.

**Table of contents**

.. contents::
:local:

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

Shopfloor config menu
~~~~~~~~~~~~~~~~~~~~~

In the main menu (or home screen) click on "Shopfloor".


Profiles
~~~~~~~~

In Shopfloor / Profiles.

The profiles are used to restrict which menus are shown on the frontend
application. When a user logs in the scanner application, they have to
select their profile, so the correct menus are shown.

Menus
~~~~~

In Shopfloor / Menus.

The menus are displayed on the frontend application.
The configuration may come from the menu itself
and/or from the scenario linked to it.

Their profile will restrict the visibility to the profile chosen on the device.
If a menu has no profile, it is shown in every profile.

Some scenario may have additional options.


Scenario
~~~~~~~~

In Shopfloor / Scenario.

A Scenario represents a flow (or more basically "something to do" with the app.
Each scenario must have a name and a unique key.
The key must match a registered shopfloor service component.

Usage
=====

An API key is created in the Demo data (for development), using
the Demo user. The key to use in the HTTP header ``API-KEY`` is: 72B044F7AC780DAC

Curl example::

curl -X POST "http://localhost:8069/shopfloor/user/menu" -H "accept: */*" -H "Content-Type: application/json" -H "API-KEY: 72B044F7AC780DAC"

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

* improve documentation
* change shopfloor.scenario.key to selection? See comment in model

Changelog
=========

13.0.1.0.0
~~~~~~~~~~

First official version.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/wms/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/wms/issues/new?body=module:%20shopfloor_base%0Aversion:%2014.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
~~~~~~~

* Camptocamp
* BCIM
* Akretion

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

* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Simone Orsi <simahawk@gmail.com>
* Sébastien Alix <sebastien.alix@camptocamp.com>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Benoit Guillot <benoit.guillot@akretion.com>
* Thierry Ducrest <thierry.ducrest@camptocamp.com>
* Michael Tietz (MT Software) <mtietz@mt-software.de>

Design
~~~~~~

* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com>
* Jacques-Etienne Baudoux <je@bcim.be>

Other credits
~~~~~~~~~~~~~

**Financial support**

* Cosanum
* Camptocamp R&D
* Akretion R&D
* ACSONE R&D

**Icons**

* Tablet app icon by Gregor Cresnar from the Noun Project

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

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

|maintainer-guewen| |maintainer-simahawk| |maintainer-sebalix|

This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/14.0/shopfloor_base>`_ 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 shopfloor_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import controllers
from . import models
from . import actions
from . import services
41 changes: 41 additions & 0 deletions shopfloor_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
# Copyright 2020 Akretion (http://www.akretion.com)
# Copyright 2020 BCIM
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
"name": "Shopfloor Base",
"summary": "Core module for creating mobile apps",
"version": "16.0.1.0.0",
"development_status": "Beta",
"category": "Inventory",
"website": "https://github.com/OCA/wms",
"author": "Camptocamp, BCIM, Akretion, Odoo Community Association (OCA)",
"maintainers": ["guewen", "simahawk", "sebalix"],
"license": "LGPL-3",
"application": True,
"depends": [
"jsonifier",
"base_rest",
"component",
"base_sparse_field",
"endpoint_route_handler",
],
"data": [
"data/module_category_data.xml",
"data/server_action.xml",
"security/groups.xml",
"security/ir.model.access.csv",
"views/shopfloor_app.xml",
"views/shopfloor_menu.xml",
"views/shopfloor_scenario_views.xml",
"views/shopfloor_profile_views.xml",
"views/menus.xml",
],
"demo": [
"demo/res_users_demo.xml",
"demo/shopfloor_scenario_demo.xml",
"demo/shopfloor_menu_demo.xml",
"demo/shopfloor_profile_demo.xml",
],
}
36 changes: 36 additions & 0 deletions shopfloor_base/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Support actions available from any Service Components.

To use an Action Component, a Service component

Difference with Service components:

* Public methods of a Service Components are exposed in the REST API,
Action Components are never exposed

An Action component can be get from Service or Action Components using
``self._actions_for(usage)``.

The goal of the Action Components is to share common actions
and processes between Services, avoid having too much logic in
Services.

"""
from . import base_action
from . import data
from . import data_detail
from . import schema
from . import schema_detail
from . import message
from . import search
from . import savepoint
from . import lock

# TODO: kept in shopfloor -> review if these must stay there
# from . import change_package_lot
# from . import schema_detail
# from . import completion_info
# from . import location_content_transfer_sorter
# from . import move_line_search
# from . import stock
# from . import inventory
51 changes: 51 additions & 0 deletions shopfloor_base/actions/base_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
# Copyright 2021 ACSONE SA/NV (http://www.acsone.eu)
# @author Simone Orsi <simahawk@gmail.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo.addons.base_rest.controllers.main import _PseudoCollection
from odoo.addons.component.core import AbstractComponent, WorkContext


def get_actions_collection(env):
return _PseudoCollection("shopfloor.action", env)


def get_actions_for(
component_instance, usage, propagate_kwargs=None, collection=None, **kw
):
"""Return an Action Component for a usage.

Action Components are the components supporting the business logic of
the processes, so we can limit the code in services and other components
to the minimum and share methods.
"""
propagate_kwargs = component_instance.work._propagate_kwargs[:] + (
propagate_kwargs or []
)
# propagate custom arguments (such as menu ID/profile ID)
kwargs = {
attr_name: getattr(component_instance.work, attr_name)
for attr_name in propagate_kwargs
if attr_name not in ("collection", "components_registry")
and hasattr(component_instance.work, attr_name)
}
kwargs.update(kw)
actions_collection = collection or get_actions_collection(component_instance.env)
work = WorkContext(collection=actions_collection, **kwargs)
return work.component(usage=usage)


class ShopFloorProcessAction(AbstractComponent):
"""Base Component for actions"""

_name = "shopfloor.process.action"
_collection = "shopfloor.action"
_usage = "actions"

def _actions_for(self, usage):
return self.component(usage=usage)

@property
def msg_store(self):
return self._actions_for("message")
41 changes: 41 additions & 0 deletions shopfloor_base/actions/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo.addons.component.core import Component

from ..utils import ensure_model


class DataAction(Component):
"""Provide methods to share data structures

The methods should be used in Service Components, so we try to
have similar data structures across scenarios.
"""

_name = "shopfloor.data.action"
_inherit = "shopfloor.process.action"
_usage = "data"

def _jsonify(self, recordset, parser, multi=False, **kw):
# TODO: drop this ctx flag for v15 as `jsonifier` makes it default
res = recordset.with_context(jsonifier__date_user_tz=False).jsonify(parser)
if not multi:
return res[0] if res else None
return res

def _simple_record_parser(self):
return ["id", "name"]

def _select_value_to_label(self, rec, fname):
return rec._fields[fname].convert_to_export(rec[fname], rec)

@ensure_model("res.partner")
def partner(self, record, **kw):
return self._jsonify(record, self._partner_parser, **kw)

def partners(self, record, **kw):
return self.partner(record, multi=True)

@property
def _partner_parser(self):
return ["id", "display_name:name"]
12 changes: 12 additions & 0 deletions shopfloor_base/actions/data_detail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo.addons.component.core import Component


class DataDetailAction(Component):
"""Provide extra data on top of data action."""

_name = "shopfloor.data.detail.action"
_inherit = "shopfloor.data.action"
_usage = "data_detail"
Loading