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

[14.0][ADD] shopfloor_reception_purchase_partner_ref #605

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions setup/shopfloor_purchase_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,
)
6 changes: 6 additions & 0 deletions setup/shopfloor_reception_purchase_partner_ref/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,
)
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,
)
9 changes: 6 additions & 3 deletions shopfloor/actions/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ def _location_parser(self):
("barcode", lambda rec, fname: rec[fname] if rec[fname] else rec.name),
]

@ensure_model("stock.picking")
def picking(self, record, **kw):
def _get_picking_parser(self, record, **kw):
parser = self._picking_parser
# progress is a heavy computed field,
# and it may reduce performance significatively
# when dealing with a large number of pickings.
# Thus, we make it optional.
if "with_progress" in kw:
parser.append("progress")
return self._jsonify(record, parser, **kw)
return parser

@ensure_model("stock.picking")
def picking(self, record, **kw):
return self._jsonify(record, self._get_picking_parser(record, **kw), **kw)

def pickings(self, record, **kw):
return self.picking(record, multi=True)
Expand Down
81 changes: 81 additions & 0 deletions shopfloor_purchase_base/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
=======================
Shopfloor Purchase 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-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_purchase_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_purchase_base
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/wms&target_branch=14.0
:alt: Try me on Runboat

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

This is a glue module between `shopfloor` and `l10n_eu_product_adr`

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

* MT Software

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

* Matthieu Méquignon <[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-mt-software-de| image:: https://github.com/mt-software-de.png?size=40px
:target: https://github.com/mt-software-de
:alt: mt-software-de

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

|maintainer-mt-software-de|

This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/14.0/shopfloor_purchase_base>`_ 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_purchase_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import actions
17 changes: 17 additions & 0 deletions shopfloor_purchase_base/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2023 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Shopfloor Purchase Base",
"summary": "Module for Shopfloor Purchase Data connection",
"version": "14.0.1.0.0",
"category": "Inventory",
"website": "https://github.com/OCA/wms",
"author": "MT Software, Odoo Community Association (OCA)",
"maintainers": ["mt-software-de"],
"license": "AGPL-3",
"depends": [
"shopfloor",
"purchase",
],
"data": [],
}
2 changes: 2 additions & 0 deletions shopfloor_purchase_base/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import data
from . import schema
28 changes: 28 additions & 0 deletions shopfloor_purchase_base/actions/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2023 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.addons.component.core import Component
from odoo.addons.shopfloor_base.utils import ensure_model


class DataAction(Component):
_inherit = "shopfloor.data.action"

def _get_purchase_order_parser(self, **kw):
res = self._simple_record_parser()
res += [
"partner_ref",
]
return res

@ensure_model("purchase.order")
def purchase_order(self, record, **kw):
parser = self._get_purchase_order_parser(**kw)
return self._jsonify(record, parser, **kw)

def _get_picking_parser(self, record, **kw):
parser = super()._get_picking_parser(record, **kw)
if kw.get("with_purchase_order"):
parser.append(
("purchase_id:purchase_order", self._get_purchase_order_parser(**kw))
)
return parser
25 changes: 25 additions & 0 deletions shopfloor_purchase_base/actions/schema.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2023 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.addons.component.core import Component


class ShopfloorSchemaAction(Component):
_inherit = "shopfloor.schema.action"

def purchase_order(self):
return {
"id": {"required": True, "type": "integer"},
"name": {"type": "string", "nullable": False, "required": True},
"partner_ref": {"type": "string", "nullable": True, "required": False},
}

def picking(self, **kw):
res = super().picking(**kw)
res.update(
{
"purchase_order": self._schema_dict_of(
self.purchase_order(), required=False
)
}
)
return res
1 change: 1 addition & 0 deletions shopfloor_purchase_base/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Michael Tietz (MT Software) <[email protected]>
1 change: 1 addition & 0 deletions shopfloor_purchase_base/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a glue module between `shopfloor` and `l10n_eu_product_adr`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading