Browse Source

Initial Commit

pull/11/merge
SHEREEF PT 8 years ago
parent
commit
8a6082d8a5
  1. 23
      cybro_product_stock_balance/__init__.py
  2. 46
      cybro_product_stock_balance/__openerp__.py
  3. 25
      cybro_product_stock_balance/models/__init__.py
  4. 60
      cybro_product_stock_balance/models/product_internal_locations.py
  5. 41
      cybro_product_stock_balance/models/stock_warehouse.py
  6. 2
      cybro_product_stock_balance/security/ir.model.access.csv
  7. BIN
      cybro_product_stock_balance/static/description/cybro_logo.png
  8. BIN
      cybro_product_stock_balance/static/description/dev.png
  9. BIN
      cybro_product_stock_balance/static/description/icon.png
  10. 56
      cybro_product_stock_balance/static/description/index.html
  11. BIN
      cybro_product_stock_balance/static/description/product_in_stock.png
  12. 24
      cybro_product_stock_balance/views/product_internal_stock.xml
  13. 15
      cybro_product_stock_balance/views/stock_warehouse.xml

23
cybro_product_stock_balance/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Sreejith P(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import models

46
cybro_product_stock_balance/__openerp__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Sreejith P(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Available Stock in Product Form',
'version': '8.0',
'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions',
'website': 'http://www.cybrosys.com',
'summary': 'Estimate Inventory Levels By Warehouses in Product Form',
'depends': [
'product',
'stock'
],
'category': 'Warehouse',
'data': [
'views/product_internal_stock.xml',
'security/ir.model.access.csv',
],
'demo': [
],
'license': 'AGPL-3',
'images': ['static/description/banner.jpg'],
'installable': True,
'auto_install': False
}

25
cybro_product_stock_balance/models/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Sreejith P(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import stock_warehouse
import product_internal_locations

60
cybro_product_stock_balance/models/product_internal_locations.py

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Sreejith P(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import fields, models, api
class ProductForm(models.Model):
_inherit = 'product.template'
internal_location = fields.One2many('stock.quantity', 'product_id', compute='get_product_qty')
def get_product_qty(self):
location_list = []
product_list = []
obj_location = self.env['stock.location'].search([('usage', '=', 'internal')])
for i in obj_location:
location_list.append(i.id)
obj_product = self.env['product.product'].search([('product_tmpl_id', '=', self.id)])
for i in obj_product:
obj_quant = self.env['stock.quant'].search([('product_id', '=', i.id),
('location_id', 'in', location_list)])
for obj in obj_quant:
move_line = {'product_id': obj.product_id.id,
'stock_location': obj.location_id.id,
'qty_on_hand': obj.qty,
}
product_list.append(move_line)
for i in product_list:
self.internal_location |= self.env['stock.quantity'].create(i)
class InternalLocation(models.Model):
_name = 'stock.quantity'
stock_location = fields.Many2one('stock.location', string='Location Name')
qty_on_hand = fields.Float('On Hand')
forecast = fields.Float('Forecast')
incoming_qty = fields.Float('Incoming Quantity')
outgoing_qty = fields.Float('Outgoing Quantity')
product_id = fields.Many2one('product.template', string='Product')

41
cybro_product_stock_balance/models/stock_warehouse.py

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2009-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Sreejith P(<http://www.cybrosys.com>)
# you can modify it under the terms of the GNU LESSER
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
#
# It is forbidden to publish, distribute, sublicense, or sell copies
# of the Software or modified copies of the Software.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
#
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields
class StockWarehouse(models.Model):
_inherit = 'stock.warehouse'
location_ids = fields.One2many('stock.location', 'location_id', compute='get_location')
def get_location(self):
for this in self:
obj_warehouse = this.env['stock.warehouse'].browse(this.id).view_location_id
obj_location = this.env['stock.location'].search([('usage', '=', 'internal')])
locations_list = []
if this.code:
for i in obj_location:
if i.complete_name.find(obj_warehouse.complete_name) != -1:
locations_list.append(i.id)
this.location_ids = locations_list

2
cybro_product_stock_balance/security/ir.model.access.csv

@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_internal_stock,internal.stock,model_stock_quantity,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_internal_stock internal.stock model_stock_quantity base.group_user 1 1 1 1

BIN
cybro_product_stock_balance/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
cybro_product_stock_balance/static/description/dev.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
cybro_product_stock_balance/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

56
cybro_product_stock_balance/static/description/index.html

@ -0,0 +1,56 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Stock Balance by Locations</h2>
<h3 class="oe_slogan">Estimate inventory levels by warehouses right on a product form</h3>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="dev.png">
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<p>The app goal is to provide you with instant outlook of how many units of this product are stocked at internal location.</p>
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<p class="oe_mt32">
<p>The estimation is provided right on a product form (the tab Inventory) as a table, where each line represents an internal location</p>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="product_in_stock.png">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;" href="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;"
href="http://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</section>

BIN
cybro_product_stock_balance/static/description/product_in_stock.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

24
cybro_product_stock_balance/views/product_internal_stock.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record id="product_form_location" model="ir.ui.view">
<field name="name">Product Locations</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@string='Stock and Expected Variations']" position="after">
<group string="Stock Balance By Locations">
<seperator>
<field name="internal_location">
<tree string="Internal Location">
<field name="stock_location"/>
<field name="qty_on_hand"/>
</tree>
</field>
</seperator>
</group>
</xpath>
</field>
</record>
</data>
</openerp>

15
cybro_product_stock_balance/views/stock_warehouse.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record id="sale_warehouse_one2many" model="ir.ui.view">
<field name="name">sale warehouse</field>
<field name="model">stock.warehouse</field>
<field name="inherit_id" ref="stock.view_warehouse"/>
<field name="arch" type="xml">
<xpath expr="//group" position="after">
<field name="location_ids"/>
</xpath>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save