Merge pull request #128 from ursais/14.0-pms_stock

[ADD] pms_stock
This commit is contained in:
Maxime Chambreuil
2022-04-12 12:00:24 -05:00
committed by GitHub
13 changed files with 173 additions and 0 deletions

81
pms_stock/README.rst Normal file
View File

@@ -0,0 +1,81 @@
===========
PMS - Stock
===========
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| 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
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpms-lightgray.png?logo=github
:target: https://github.com/OCA/pms/tree/14.0/pms_stock
:alt: OCA/pms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pms-14-0/pms-14-0-pms_stock
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/293/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows you to manage the content of a property.
**Table of contents**
.. contents::
:local:
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pms/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/pms/issues/new?body=module:%20pms_stock%0Aversion:%2014.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
~~~~~~~
* Hardik-OSI Open Source Integrators
Contributors
~~~~~~~~~~~~
* Hardik-OSI
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.
.. |maintainer-Hardik-OSI| image:: https://github.com/Hardik-OSI.png?size=40px
:target: https://github.com/Hardik-OSI
:alt: Hardik-OSI
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-Hardik-OSI|
This module is part of the `OCA/pms <https://github.com/OCA/pms/tree/14.0/pms_stock>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

2
pms_stock/__init__.py Normal file
View File

@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

14
pms_stock/__manifest__.py Normal file
View File

@@ -0,0 +1,14 @@
# Copyright (c) 2022 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "PMS - Stock",
"summary": "Manage the content of a property.",
"version": "14.0.1.0.0",
"category": "stock",
"website": "https://github.com/OCA/pms",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"maintainers": ["Hardik-OSI"],
"license": "AGPL-3",
"depends": ["pms_base", "stock"],
"data": ["views/pms_property.xml"],
}

View File

@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import pms_property

View File

@@ -0,0 +1,9 @@
# Copyright (c) 2022 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class PmsProperty(models.Model):
_inherit = "pms.property"
stock_location_id = fields.Many2one("stock.location", string="Inventory Location")

View File

@@ -0,0 +1,4 @@
* Go to Properties > Master Data > Properties
* Create or edit a property
* Go to the Inventory tab
* Set the stock location

View File

@@ -0,0 +1,9 @@
* Open Source Integrators <http://www.opensourceintegrators.com>
* Zachary Willhide-James <zwillhidejames@opensourceintegrators.com>
* Kent Davis <kdavis@opensourceintegrators.com>
* Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
* Hardik Suthar <hsuthar@opensourceintegrators.com>

View File

@@ -0,0 +1 @@
This module allows you to manage the content of a property.

View File

@@ -0,0 +1,3 @@
* Go to Properties > Master Data > Properties
* Select a property
* Click on "Content" to get the list of products and quantities stored in the property

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,41 @@
<odoo>
<!-- Used in location -->
<record model="ir.actions.act_window" id="location_open_content">
<field name="context">{'search_default_productgroup': 1}</field>
<field name="domain">[('location_id', 'child_of', stock_location_id)]</field>
<field name="name">Content</field>
<field name="res_model">stock.quant</field>
</record>
<record id="view_pms_property_form_stock" model="ir.ui.view">
<field name="name">pms.property.form.pms.stock</field>
<field name="model">pms.property</field>
<field name="inherit_id" ref="pms_base.view_pms_property_form" />
<field name="priority">99999</field>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="inventory" string="Inventory">
<group id="stock">
<group id="stock-left">
<field name="stock_location_id" />
</group>
<group id="stock-right" />
</group>
</page>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button
string="Content"
class="oe_stat_button"
icon="fa-cubes"
name="%(pms_stock.location_open_content)d"
context="{'stock_location_id': stock_location_id}"
type="action"
attrs="{'invisible': [('stock_location_id', '=', False)]}"
/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
../../../../pms_stock

6
setup/pms_stock/setup.py Normal file
View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)