Skip to content

Commit

Permalink
[UPD] ssi_stock
Browse files Browse the repository at this point in the history
* Add IWO and IWI
  • Loading branch information
andhit-r committed Nov 14, 2023
1 parent d79f26a commit 7cedd92
Show file tree
Hide file tree
Showing 7 changed files with 225 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ssi_stock/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"views/lost_views.xml",
"views/adjustment_in_views.xml",
"views/adjustment_out_views.xml",
"views/interwarehouse_in_views.xml",
"views/interwarehouse_out_views.xml",
],
"demo": [],
}
14 changes: 14 additions & 0 deletions ssi_stock/data/location_type_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,19 @@
<field name="is_warehouse_location" eval="0" />
</record>

<record id="location_type_push" model="location_type">
<field name="name">Inter-Warehouse Push</field>
<field name="code">IWS</field>
<field name="usage">transit</field>
<field name="is_warehouse_location" eval="1" />
</record>

<record id="location_type_pull" model="location_type">
<field name="name">Inter-Warehouse Pull</field>
<field name="code">IWL</field>
<field name="usage">transit</field>
<field name="is_warehouse_location" eval="1" />
</record>

</data>
</odoo>
29 changes: 29 additions & 0 deletions ssi_stock/data/stock_picking_type_category_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,34 @@
<field name="direction">outgoing</field>
</record>

<record id="picking_category_iwo" model="picking_type_category">
<field name="name">Inter-Warehouse Out</field>
<field name="code">IWO</field>
<field name="direction">outgoing</field>
<field name="default_source_location_type_id" ref="location_type_main_stock" />
<field
name="allowed_source_location_type_ids"
eval="[(6, 0, [ref('location_type_main_stock'),ref('location_type_stock')])]"
/>
<field
name="allowed_destination_location_type_ids"
eval="[(6, 0, [ref('location_type_push')])]"
/>
</record>

<record id="picking_category_iwi" model="picking_type_category">
<field name="name">Inter-Warehouse In</field>
<field name="code">IWI</field>
<field name="direction">outgoing</field>
<field name="default_source_location_type_id" ref="location_type_main_stock" />
<field
name="allowed_source_location_type_ids"
eval="[(6, 0, [ref('location_type_main_stock'),ref('location_type_stock')])]"
/>
<field
name="allowed_destination_location_type_ids"
eval="[(6, 0, [ref('location_type_pull')])]"
/>
</record>
</data>
</odoo>
28 changes: 28 additions & 0 deletions ssi_stock/security/ir_module_category_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,32 @@
<field name="name">Adjustment Out</field>
<field name="parent_id" ref="inventory_data_ownership_module_category" />
</record>

<!-- Inter-Warehouse Out-->
<record id="interwarehouse_out_module_category" model="ir.module.category">
<field name="name">Inter-Warehouse Out</field>
<field name="parent_id" ref="inventory_workflow_module_category" />
</record>

<record
id="interwarehouse_out_data_ownership_module_category"
model="ir.module.category"
>
<field name="name">Inter-Warehouse Out</field>
<field name="parent_id" ref="inventory_data_ownership_module_category" />
</record>

<!-- Inter-Warehouse In-->
<record id="interwarehouse_in_module_category" model="ir.module.category">
<field name="name">Inter-Warehouse In</field>
<field name="parent_id" ref="inventory_workflow_module_category" />
</record>

<record
id="interwarehouse_in_data_ownership_module_category"
model="ir.module.category"
>
<field name="name">Inter-Warehouse In</field>
<field name="parent_id" ref="inventory_data_ownership_module_category" />
</record>
</odoo>
94 changes: 94 additions & 0 deletions ssi_stock/security/res_group_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -508,4 +508,98 @@
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>

<!-- Inter-Warehouse Out-->
<record id="interwarehouse_out_viewer_group" model="res.groups">
<field name="name">Viewer</field>
<field name="category_id" ref="interwarehouse_out_module_category" />
</record>

<record id="interwarehouse_out_user_group" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="interwarehouse_out_module_category" />
<field name="implied_ids" eval="[(4, ref('interwarehouse_out_viewer_group'))]" />
</record>

<record id="interwarehouse_out_validator_group" model="res.groups">
<field name="name">Validator</field>
<field name="category_id" ref="interwarehouse_out_module_category" />
<field name="implied_ids" eval="[(4, ref('interwarehouse_out_user_group'))]" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>

<!-- Inter-Warehouse Out: Data Ownership -->
<record id="interwarehouse_out_company_group" model="res.groups">
<field name="name">Company</field>
<field name="category_id" ref="interwarehouse_out_data_ownership_module_category" />
</record>

<record id="interwarehouse_out_company_child_group" model="res.groups">
<field name="name">Company and All Child Companies</field>
<field name="category_id" ref="interwarehouse_out_data_ownership_module_category" />
<field name="implied_ids" eval="[(4, ref('interwarehouse_out_company_group'))]" />
</record>

<record id="interwarehouse_out_all_group" model="res.groups">
<field name="name">All</field>
<field name="category_id" ref="interwarehouse_out_data_ownership_module_category" />
<field
name="implied_ids"
eval="[(4, ref('interwarehouse_out_company_child_group'))]"
/>
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>

<!-- Inter-Warehouse In-->
<record id="interwarehouse_in_viewer_group" model="res.groups">
<field name="name">Viewer</field>
<field name="category_id" ref="interwarehouse_in_module_category" />
</record>

<record id="interwarehouse_in_user_group" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="interwarehouse_in_module_category" />
<field name="implied_ids" eval="[(4, ref('interwarehouse_in_viewer_group'))]" />
</record>

<record id="interwarehouse_in_validator_group" model="res.groups">
<field name="name">Validator</field>
<field name="category_id" ref="interwarehouse_in_module_category" />
<field name="implied_ids" eval="[(4, ref('interwarehouse_in_user_group'))]" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>

<!-- Inter-Warehouse In: Data Ownership -->
<record id="interwarehouse_in_company_group" model="res.groups">
<field name="name">Company</field>
<field name="category_id" ref="interwarehouse_in_data_ownership_module_category" />
</record>

<record id="interwarehouse_in_company_child_group" model="res.groups">
<field name="name">Company and All Child Companies</field>
<field name="category_id" ref="interwarehouse_in_data_ownership_module_category" />
<field name="implied_ids" eval="[(4, ref('interwarehouse_in_company_group'))]" />
</record>

<record id="interwarehouse_in_all_group" model="res.groups">
<field name="name">All</field>
<field name="category_id" ref="interwarehouse_in_data_ownership_module_category" />
<field
name="implied_ids"
eval="[(4, ref('interwarehouse_in_company_child_group'))]"
/>
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
</odoo>
29 changes: 29 additions & 0 deletions ssi_stock/views/interwarehouse_in_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 OpenSynergy Indonesia
Copyright 2022 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="interwarehouse_in_action" model="ir.actions.act_window">
<field name="name">Inter-Warehouse In</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.picking</field>
<field name="view_mode">tree,form</field>
<field
name="domain"
eval="[('picking_type_category_id','=',ref('ssi_stock.picking_category_iwi'))]"
/>
<field
name="context"
eval="{'default_picking_type_category_id':ref('ssi_stock.picking_category_iwi')}"
/>
</record>

<menuitem
id="interwarehouse_in_menu"
name="Inter-Warehouse In"
parent="menu_incoming_movement"
groups="interwarehouse_in_viewer_group"
action="interwarehouse_in_action"
sequence="20"
/>
</odoo>
29 changes: 29 additions & 0 deletions ssi_stock/views/interwarehouse_out_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 OpenSynergy Indonesia
Copyright 2022 PT. Simetri Sinergi Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="interwarehouse_out_action" model="ir.actions.act_window">
<field name="name">Inter-Warehouse Out</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.picking</field>
<field name="view_mode">tree,form</field>
<field
name="domain"
eval="[('picking_type_category_id','=',ref('ssi_stock.picking_category_iwo'))]"
/>
<field
name="context"
eval="{'default_picking_type_category_id':ref('ssi_stock.picking_category_iwo')}"
/>
</record>

<menuitem
id="interwarehouse_out_menu"
name="Inter-Warehouse Out"
parent="menu_outgoing_movement"
groups="interwarehouse_out_viewer_group"
action="interwarehouse_out_action"
sequence="20"
/>
</odoo>

0 comments on commit 7cedd92

Please sign in to comment.