-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.0.1.0.0] stock_inventory_workflow_policy_discrepancy
- Loading branch information
Showing
9 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
20
stock_inventory_workflow_policy_discrepancy/__openerp__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
} |
6 changes: 6 additions & 0 deletions
6
stock_inventory_workflow_policy_discrepancy/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
16 changes: 16 additions & 0 deletions
16
stock_inventory_workflow_policy_discrepancy/models/stock_inventory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
26 changes: 26 additions & 0 deletions
26
stock_inventory_workflow_policy_discrepancy/models/stock_location.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Binary file added
BIN
+14.4 KB
stock_inventory_workflow_policy_discrepancy/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
stock_inventory_workflow_policy_discrepancy/views/stock_inventory_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
20 changes: 20 additions & 0 deletions
20
stock_inventory_workflow_policy_discrepancy/views/stock_location_views.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |