Skip to content

Commit

Permalink
[8.0.1.0.0] stock_inventory_workflow_policy_discrepancy
Browse files Browse the repository at this point in the history
  • Loading branch information
andhit-r committed Nov 11, 2018
1 parent d528ebd commit 7475d6a
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 0 deletions.
48 changes: 48 additions & 0 deletions stock_inventory_workflow_policy_discrepancy/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

=======================================================
Stock Inventory Workflow Policy - Discrepancy Extension
=======================================================


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-workflow
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 *Stock Inventory Workflow Policy - Discrepancy Extension*
6. Install the module

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

Bugs are tracked on `GitHub Issues
<https://github.com/open-synergy/opnsynid-stock-logistics-workflow/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.
5 changes: 5 additions & 0 deletions stock_inventory_workflow_policy_discrepancy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
20 changes: 20 additions & 0 deletions stock_inventory_workflow_policy_discrepancy/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Stock Inventory Workflow Policy - Discrepancy Extension",
"version": "8.0.1.0.0",
"category": "Accounting & Finance",
"website": "https://opensynergy-indonesia.com",
"author": "OpenSynergy Indonesia",
"license": "AGPL-3",
"installable": True,
"depends": [
"stock_inventory_discrepancy",
],
"data": [
"views/stock_location_views.xml",
"views/stock_inventory_views.xml",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

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

from openerp import models, fields


class StockInventory(models.Model):
_inherit = "stock.inventory"

force_ok = fields.Boolean(
string="Can Force Validation",
compute="_compute_policy",
store=False,
readonly=True,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields, api


class StockLocation(models.Model):
_inherit = "stock.location"

inventory_adjustment_force_grp_ids = fields.Many2many(
string="Allowed To Force Validation Inventory Adjustment",
comodel_name="res.groups",
relation="rel_inventory_adjustment_allowed_force_groups",
column1="location_id",
column2="group_id",
)

@api.model
def _get_inventory_adjustment_button_policy_map(self):
_super = super(StockLocation, self)
result = _super._get_inventory_adjustment_button_policy_map()
result.append(
("force_ok", "inventory_adjustment_force_grp_ids")
)
return result
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,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="stock_inventory_view_form" model="ir.ui.view">
<field name="name">stock.inventory form</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock_inventory_workflow_policy.stock_inventory_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='validate_ok']" position="after">
<field name="force_ok"/>
</xpath>
</field>
</record>

<record id="stock_inventory_view_form_1" model="ir.ui.view">
<field name="name">stock.inventory form</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock_inventory_discrepancy.view_inventory_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_force_done']" position="attributes">
<attribute name="groups"/>
<attribute name="attrs">{'invisible':['|','|',('state','!=','pending'),('force_ok','=',False),('over_discrepancy_line_count', '=', 0)]}</attribute>
<attribute name="states"/>
</xpath>
<xpath expr="//button[@name='action_done']" position="attributes">
<attribute name="groups"/>
<attribute name="attrs">{'invisible':['|',('state','!=','confirm'),('validate_ok','=',False)]}</attribute>
<attribute name="states"/>
</xpath>
</field>
</record>

</data>
</openerp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<openerp>
<data>

<record id="stock_location_view_form" model="ir.ui.view">
<field name="name">stock.location.form invetory policy</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock_inventory_workflow_policy.stock_location_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='inventory_adjustment_validate_grp_ids']" position="after">
<field name="inventory_adjustment_force_grp_ids" widget="many2many_tags"/>
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit 7475d6a

Please sign in to comment.