Skip to content

Commit

Permalink
Merge PR #2 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by andhit-r
  • Loading branch information
ssi-bot committed Aug 28, 2023
2 parents c857de7 + 1fdbc03 commit 59c9124
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 0 deletions.
47 changes: 47 additions & 0 deletions ssi_purchase_stock/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3

================================
Purchase + Inventory Integration
================================


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

To install this module, you need to:

1. Clone the branch 14.0 of the repository https://github.com/open-synergy/ssi-purchase
2. Add the path to this repository in your configuration (addons-path)
3. Update the module list
4. Go to menu *Apps -> Apps -> Main Apps*
5. Search For *Purchase + Inventory Integration*
6. Install the module

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

Bugs are tracked on `GitHub Issues
<https://github.com/open-synergy/ssi-purchase/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 <[email protected]>

Maintainer
----------

.. image:: https://simetri-sinergi.id/logo.png
:alt: PT. Simetri Sinergi Indonesia
:target: https://simetri-sinergi.id.com

This module is maintained by the PT. Simetri Sinergi Indonesia.
7 changes: 7 additions & 0 deletions ssi_purchase_stock/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import (
models,
)
22 changes: 22 additions & 0 deletions ssi_purchase_stock/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Purchase + Inventory Integration",
"version": "14.0.1.0.0",
"website": "https://simetri-sinergi.id",
"author": "PT. Simetri Sinergi Indonesia, OpenSynergy Indonesia",
"license": "LGPL-3",
"installable": True,
"application": True,
"depends": [
"purchase",
"stock",
],
"data": [
"security/res_group_data.xml",
"security/ir_rule_data.xml",
"views/stock_warehouse_views.xml",
],
"demo": [],
}
8 changes: 8 additions & 0 deletions ssi_purchase_stock/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import (
stock_warehouse,
res_users,
)
19 changes: 19 additions & 0 deletions ssi_purchase_stock/models/res_users.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import fields, models


class ResUsers(models.Model):
_name = "res.users"
_inherit = ["res.users"]

warehouse_purchase_ids = fields.Many2many(
string="Purchase Users",
comodel_name="stock.warehouse",
relation="rel_warehouse_2_purchase_user",
column2="warehouse_id",
column1="user_id",
)
19 changes: 19 additions & 0 deletions ssi_purchase_stock/models/stock_warehouse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 OpenSynergy Indonesia
# Copyright 2023 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import fields, models


class StockWarehouse(models.Model):
_name = "stock.warehouse"
_inherit = ["stock.warehouse"]

purchase_user_ids = fields.Many2many(
string="Purchase Users",
comodel_name="res.users",
relation="rel_warehouse_2_purchase_user",
column1="warehouse_id",
column2="user_id",
)
20 changes: 20 additions & 0 deletions ssi_purchase_stock/security/ir_rule_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 OpenSynergy Indonesia
Copyright 2023 PT. Simetri Sinergi Indonesia
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
<odoo>

<record id="purchase_order_warehouse_user_rule" model="ir.rule">
<field name="name">Purchase Order - Warehouse</field>
<field name="model_id" ref="purchase.model_purchase_order" />
<field name="groups" eval="[(4, ref('purchase_order_warehouse_group'))]" />
<field
name="domain_force"
>[('picking_type_id.warehouse_id.id','=',user.warehouse_purchase_ids.ids)]</field>
<field name="perm_unlink" eval="1" />
<field name="perm_write" eval="1" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
</record>

</odoo>
25 changes: 25 additions & 0 deletions ssi_purchase_stock/security/res_group_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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>


<!-- Data Ownership -->
<record id="purchase_order_warehouse_group" model="res.groups">
<field name="name">Warehouse</field>
<field
name="category_id"
ref="ssi_purchase.purchase_order_data_ownership_module_category"
/>
</record>

<record id="ssi_purchase.purchase_order_company_group" model="res.groups">
<field name="name">Company</field>
<field
name="category_id"
ref="ssi_purchase.purchase_order_data_ownership_module_category"
/>
<field name="implied_ids" eval="[(4, ref('purchase_order_warehouse_group'))]" />
</record>
</odoo>
Binary file added ssi_purchase_stock/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.
27 changes: 27 additions & 0 deletions ssi_purchase_stock/views/stock_warehouse_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="stock_warehouse_view_form" model="ir.ui.view">
<field name="name">stock.warehouse - form</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse" />
<field name="arch" type="xml">
<data>
<xpath expr="//notebook" position="inside">
<page name="purchase" string="Purchase">
<group name="purchase_1" colspan="4" col="2">
<field
name="purchase_user_ids"
widget="many2many_tags_avatar"
/>
</group>
</page>
</xpath>
</data>
</field>
</record>


</odoo>

0 comments on commit 59c9124

Please sign in to comment.