Skip to content

Commit

Permalink
Add shopfloor_checkout_done
Browse files Browse the repository at this point in the history
  • Loading branch information
JuMiSanAr committed Feb 13, 2024
1 parent c114af4 commit 813ec88
Show file tree
Hide file tree
Showing 12 changed files with 599 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/shopfloor_checkout_done/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,
)
86 changes: 86 additions & 0 deletions shopfloor_checkout_done/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
=======================
Shopfloor Checkout Done
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9a6a9672d9e7e68f347f7df95e83665de1796e38958445e3e2ece6b5f681193a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |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%2Fwms-lightgray.png?logo=github
:target: https://github.com/OCA/wms/tree/14.0/shopfloor_checkout_done
: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_checkout_done
: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/wms&target_branch=14.0
:alt: Try me on Runboat

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

This module overrides the put_in_pack method from stock.picking
so that it marks lines as shopfloor_checkout_done
when putting them in a pack from the backend.

This is done to make sure that these lines are displayed
in the shopfloor frontend even if they're handled in the backend.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/wms/issues/new?body=module:%20shopfloor_checkout_done%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

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

* Juan Miguel Sánchez Arce <[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.

This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/14.0/shopfloor_checkout_done>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions shopfloor_checkout_done/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions shopfloor_checkout_done/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Shopfloor Checkout Done",
"summary": "Marks lines as shopfloor checkout done when put in a pack in the backend",
"version": "14.0.1.0.0",
"development_status": "Alpha",
"category": "Inventory",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"shopfloor",
],
"website": "https://github.com/OCA/wms",
"installable": True,
}
1 change: 1 addition & 0 deletions shopfloor_checkout_done/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_picking
21 changes: 21 additions & 0 deletions shopfloor_checkout_done/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class Picking(models.Model):
_inherit = "stock.picking"

def _put_in_pack(self, move_line_ids, create_package_level=True):
"""
Marks the corresponding move lines as 'shopfloor_checkout_done'
when the package is created in the backend.
"""
new_package = super()._put_in_pack(move_line_ids, create_package_level)
lines = self.move_line_ids.filtered(
lambda p: p.result_package_id == new_package
)
lines.write({"shopfloor_checkout_done": True})
return new_package
1 change: 1 addition & 0 deletions shopfloor_checkout_done/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Juan Miguel Sánchez Arce <[email protected]>
6 changes: 6 additions & 0 deletions shopfloor_checkout_done/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This module overrides the put_in_pack method from stock.picking
so that it marks lines as shopfloor_checkout_done
when putting them in a pack from the backend.

This is done to make sure that these lines are displayed
in the shopfloor frontend even if they're handled in the backend.
Loading

0 comments on commit 813ec88

Please sign in to comment.