Skip to content

Commit

Permalink
[8.0.1.0.0] stock_picking_unexpected_product_transfer_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Jan 27, 2019
1 parent 2022da8 commit 4ea7aff
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 0 deletions.
48 changes: 48 additions & 0 deletions stock_picking_unexpected_product_transfer_policy/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===================================
Unexpected Product Transfer Policy
===================================


Installation
============

To install this module, you need to:

1. Clone the branch 8.0 of the repository https://github.com/open-synergy/opnsynid-stock-logistics-warehouse
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Setting -> Modules -> Local Modules*
5. Search For *Unexpected Product Transfer Policy*
6. Install the module

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

Bugs are tracked on `GitHub Issues
<https://github.com/open-synergy/opnsynid-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.


Credits
=======

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

* Michael Viriyananda <viriyananda.michael@gmail.com>
* Andhitia Rama <andhitia.r@gmail.com>

Maintainer
----------

.. image:: https://opensynergy-indonesia.com/logo.png
:alt: OpenSynergy Indonesia
:target: https://opensynergy-indonesia.com

This module is maintained by the OpenSynergy Indonesia.
7 changes: 7 additions & 0 deletions stock_picking_unexpected_product_transfer_policy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import (
models,
)
19 changes: 19 additions & 0 deletions stock_picking_unexpected_product_transfer_policy/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Unexpected Product Transfer Policy",
"version": "8.0.1.0.0",
"category": "Stock Management",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"stock",
],
"data": [
"views/stock_picking_type_views.xml",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import (
stock_picking_type,
stock_picking,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, api, _
from openerp.exceptions import Warning as UserError


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

@api.model
def _create_extra_moves(self, picking):
if not picking.picking_type_id.allow_unexpected_product_transfer:
str_msg = _("Not allowed to make unexpected product transfer")
raise UserError(str_msg)
_super = super(StockPicking, self)
return _super._create_extra_moves(picking)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, fields


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

allow_unexpected_product_transfer = fields.Boolean(
string="Allow Unexpected Product Transfer",
default=True,
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="stock_picking_type_view_form" model="ir.ui.view">
<field name="name">Stock Picking Type Policy Form</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//field[@name='warehouse_id']" position="after">
<field name="allow_unexpected_product_transfer"/>
</xpath>
</data>
</field>
</record>
</data>
</openerp>

0 comments on commit 4ea7aff

Please sign in to comment.