Skip to content

Commit

Permalink
Merge PR #603 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jun 19, 2019
2 parents 29d3954 + 23e80d2 commit 750f865
Show file tree
Hide file tree
Showing 21 changed files with 853 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup/_metapackage/VERSION.txt
@@ -1 +1 @@
12.0.20190529.1
12.0.20190619.0
1 change: 1 addition & 0 deletions setup/_metapackage/setup.py
Expand Up @@ -21,6 +21,7 @@
'odoo12-addon-stock_orderpoint_move_link',
'odoo12-addon-stock_orderpoint_purchase_link',
'odoo12-addon-stock_orderpoint_uom',
'odoo12-addon-stock_packaging',
'odoo12-addon-stock_picking_procure_method',
'odoo12-addon-stock_request',
'odoo12-addon-stock_request_picking_type',
Expand Down
6 changes: 6 additions & 0 deletions setup/stock_packaging/.eggs/README.txt
@@ -0,0 +1,6 @@
This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

This directory caches those eggs to prevent repeated downloads.

However, it is safe to delete this directory.

1 change: 1 addition & 0 deletions setup/stock_packaging/odoo/addons/stock_packaging
6 changes: 6 additions & 0 deletions setup/stock_packaging/setup.py
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
84 changes: 84 additions & 0 deletions stock_packaging/README.rst
@@ -0,0 +1,84 @@
===============
Stock Packaging
===============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_packaging
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_packaging
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/12.0
:alt: Try me on Runbot

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

This modules allows to propagate the product packaging through
the stock moves.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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/stock-logistics-warehouse/issues/new?body=module:%20stock_packaging%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
~~~~~~~

* ACSONE SA/NV

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

* Laetita Gangloff <laetitia.gangloff@acsone.eu>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Denis Roussel <denis.roussel@acsone.eu>

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

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

|maintainer-rousseldenis|

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_packaging>`_ 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 stock_packaging/__init__.py
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions stock_packaging/__manifest__.py
@@ -0,0 +1,21 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Stock Packaging',
'summary': """
Allows to propagate packaging through stock flows""",
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'development_status': 'Beta',
'maintainers': ['rousseldenis'],
'website': 'https://github.com/OCA/stock-logistics-workflow',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'depends': [
'stock',
'packaging_uom',
],
'data': [
'views/stock_rule.xml',
],
}
30 changes: 30 additions & 0 deletions stock_packaging/i18n/stock_packaging.pot
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_packaging
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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: stock_packaging
#: model:ir.model.fields,field_description:stock_packaging.field_stock_rule__propagate_product_packaging
msgid "Propagate Product Packaging"
msgstr ""

#. module: stock_packaging
#: model:ir.model,name:stock_packaging.model_stock_move
msgid "Stock Move"
msgstr ""

#. module: stock_packaging
#: model:ir.model,name:stock_packaging.model_stock_rule
msgid "Stock Rule"
msgstr ""

2 changes: 2 additions & 0 deletions stock_packaging/models/__init__.py
@@ -0,0 +1,2 @@
from . import stock_move
from . import stock_rule
17 changes: 17 additions & 0 deletions stock_packaging/models/stock_move.py
@@ -0,0 +1,17 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class StockMove(models.Model):

_inherit = 'stock.move'

def _prepare_procurement_values(self):
vals = super()._prepare_procurement_values()
if self.product_packaging and \
self.rule_id and \
self.rule_id.propagate_product_packaging:
vals.update({'product_packaging': self.product_packaging.id})
return vals
38 changes: 38 additions & 0 deletions stock_packaging/models/stock_rule.py
@@ -0,0 +1,38 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class StockRule(models.Model):

_inherit = 'stock.rule'

propagate_product_packaging = fields.Boolean(
default=True,
)

def _get_stock_move_values(
self, product_id, product_qty, product_uom, location_id, name,
origin, values, group_id):
"""
If stock rule has propagate_product_packaging enabled, update
stock move with it.
:param product_id:
:param product_qty:
:param product_uom:
:param location_id:
:param name:
:param origin:
:param values:
:param group_id:
:return:
"""
res = super()._get_stock_move_values(
product_id, product_qty, product_uom, location_id, name, origin,
values, group_id)
if 'product_packaging' in values:
res.update({
'product_packaging': values.get('product_packaging')
})
return res
3 changes: 3 additions & 0 deletions stock_packaging/readme/CONTRIBUTORS.rst
@@ -0,0 +1,3 @@
* Laetita Gangloff <laetitia.gangloff@acsone.eu>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Denis Roussel <denis.roussel@acsone.eu>
2 changes: 2 additions & 0 deletions stock_packaging/readme/DESCRIPTION.rst
@@ -0,0 +1,2 @@
This modules allows to propagate the product packaging through
the stock moves.
Empty file.
Empty file.
Binary file added stock_packaging/static/description/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 750f865

Please sign in to comment.