Skip to content

Commit

Permalink
Merge 238c028 into b63a1ac
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitavaghela committed Dec 16, 2019
2 parents b63a1ac + 238c028 commit f635c5c
Show file tree
Hide file tree
Showing 13 changed files with 636 additions and 0 deletions.
79 changes: 79 additions & 0 deletions stock_location_limit_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
============================
Stock Location Limit Product
============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge2| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_location_limit_product
:alt: OCA/stock-logistics-warehouse
.. |badge3| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3|

This module allows you to define a limit by product quantity on a stock location. This limit can later be used to track the capacity available of the location.


**Table of contents**

.. contents::
:local:

Configuration
=============

In Inventory Settings, Go to
Inventory > Configuration > Warehouse Management > Locations
Select or create a location
Enter the limits by selecting a product and entering the quantity


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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/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 <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_location_limit_product%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Open Source Integrators
* Odoo Community Association (OCA)

Contributors
~~~~~~~~~~~~

* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Nikita Vaghela <nikita.vaghela.serpentcs@gmail.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_location_limit_product>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions stock_location_limit_product/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from . import models
23 changes: 23 additions & 0 deletions stock_location_limit_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

{
'name': 'Stock Location Limit Product',
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'author': 'Open Source Integrators, Odoo Community Association (OCA),',
'website': "https://github.com/OCA/stock-logistics-warehouse",
'summary': """Add a limit by product quantity on a stock location.
This limit can later be used to track the capacity
available of the location.""",
'category': 'Warehouse',
'depends': [
'stock',
],
'data': [
'security/ir.model.access.csv',
'views/stock_location_view.xml',
],
'installable': True,
}
6 changes: 6 additions & 0 deletions stock_location_limit_product/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from . import stock_location_limit
from . import stock_location
13 changes: 13 additions & 0 deletions stock_location_limit_product/models/stock_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import fields, models


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

limit_ids = fields.One2many('stock.location.limit',
'location_id',
'Limits')
31 changes: 31 additions & 0 deletions stock_location_limit_product/models/stock_location_limit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import fields, models


class StockLocationLimit(models.Model):
_name = 'stock.location.limit'
_description = 'Stock Location Limit Product'
_rec_name = 'product_id'

_sql_constraints = [
('product_uniq', 'unique(product_id,location_id)',
'Product and Location must be unique!'),
]

product_id = fields.Many2one(
'product.product',
string='Product',
)
qty = fields.Float('Maximum Quantity')
uom_id = fields.Many2one(
'uom.uom',
related='product_id.uom_id',
string='UoM',
)
location_id = fields.Many2one(
'stock.location',
string='Location',
)
3 changes: 3 additions & 0 deletions stock_location_limit_product/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Go to Inventory > Configuration > Warehouse Management > Locations
Select or create a location
Enter the limits by selecting a product and entering the quantity
7 changes: 7 additions & 0 deletions stock_location_limit_product/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* Open Source Integrators <https://www.@opensourceintegrators.com>

* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>

* Serpent Consulting Services Pvt. Ltd. <https://www.serpentcs.com>

* Nikita Vaghela <nikita.vaghela.serpentcs@gmail.com>
3 changes: 3 additions & 0 deletions stock_location_limit_product/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module allows you to define a limit by product quantity
on a stock location.This limit can later be used to track
the capacity available of the location.
2 changes: 2 additions & 0 deletions stock_location_limit_product/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_stock_location_limit,access_stock_location_limit_user,model_stock_location_limit,base.group_user,1,1,1,0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f635c5c

Please sign in to comment.