← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~agilebg/openerp-product-attributes/adding_product_supplier_info_7 into lp:openerp-product-attributes

 

Alex Comba - Agile BG has proposed merging lp:~agilebg/openerp-product-attributes/adding_product_supplier_info_7 into lp:openerp-product-attributes.

Commit message:
[ADD] module product_supplier_info

Requested reviews:
  Product Core Editors (product-core-editors)

For more details, see:
https://code.launchpad.net/~agilebg/openerp-product-attributes/adding_product_supplier_info_7/+merge/216911

I added and cleaned up the module product_supplier_info extracted from lp:~openerp-community/openobject-addons/elico-7.0 using https://launchpad.net/bazaar-extractor 

Please also see the related MP: https://code.launchpad.net/~agilebg/openobject-addons/removing_product_supplier_info_from_elico-7.0/+merge/216907
-- 
https://code.launchpad.net/~agilebg/openerp-product-attributes/adding_product_supplier_info_7/+merge/216911
Your team Product Core Editors is requested to review the proposed merge of lp:~agilebg/openerp-product-attributes/adding_product_supplier_info_7 into lp:openerp-product-attributes.
=== added directory 'product_supplier_info'
=== added file 'product_supplier_info/__init__.py'
--- product_supplier_info/__init__.py	1970-01-01 00:00:00 +0000
+++ product_supplier_info/__init__.py	2014-04-23 15:17:26 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
+#    Author: Yannick Gouin <yannick.gouin@xxxxxxxxxxxxxx>
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import product
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'product_supplier_info/__openerp__.py'
--- product_supplier_info/__openerp__.py	1970-01-01 00:00:00 +0000
+++ product_supplier_info/__openerp__.py	2014-04-23 15:17:26 +0000
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
+#    Author: LIN Yu <lin.yu@xxxxxxxxxxxxxx>
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+{
+    'name': 'Product Supplier Info',
+    'version': '1.1',
+    'category': 'Product',
+    'summary': 'Product Supplier Info',
+    'description': """
+Product Supplier Info
+==================================================
+This module categorizes each product item by supplier.
+It allows for users to be able to view a compiled list
+of products supplied by the supplier.
+
+Users can also directly add new products to the supplier's list.
+
+Contributors
+------------
+
+* Alex Comba <alex.comba@xxxxxxxxxxx>
+""",
+    'author': 'Elico Corp',
+    'website': 'http://www.elico-corp.com',
+    'license': 'AGPL-3',
+    'depends': [
+        'product', 'stock',
+    ],
+    'data': [
+        'product_view.xml',
+    ],
+    'test': [],
+    'demo': [],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'product_supplier_info/product.py'
--- product_supplier_info/product.py	1970-01-01 00:00:00 +0000
+++ product_supplier_info/product.py	2014-04-23 15:17:26 +0000
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
+#    Author: Yannick Gouin <yannick.gouin@xxxxxxxxxxxxxx>
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import orm, fields
+import openerp.addons.decimal_precision as dp
+
+
+class product_supplierinfo(orm.Model):
+    _inherit = 'product.supplierinfo'
+
+    def _product_available(
+            self, cr, uid, ids,
+            field_names=None, arg=False, context=None
+    ):
+        if not field_names:
+            field_names = []
+        if context is None:
+            context = {}
+        res = {}
+        for id in ids:
+            res[id] = {}.fromkeys(field_names, 0.0)
+            supplier_info = self.browse(cr, uid, id)
+            for f in field_names:
+                if f == 'qty_available':
+                    res[id][f] = supplier_info.product_id.qty_available
+                if f == 'virtual_available':
+                    res[id][f] = supplier_info.product_id.virtual_available
+        return res
+
+    _columns = {
+        'product_id': fields.many2one(
+            'product.product', 'Product',
+            select=1, ondelete='cascade', required=True
+        ),
+        'qty_available': fields.function(
+            _product_available, multi='qty_available', type='float',
+            digits_compute=dp.get_precision('Product Unit of Measure'),
+            string="Quantity On Hand"
+        ),
+        'virtual_available': fields.function(
+            _product_available, multi='qty_available', type='float',
+            digits_compute=dp.get_precision('Product Unit of Measure'),
+            string="Forecasted Quantity"
+        ),
+    }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== added file 'product_supplier_info/product_view.xml'
--- product_supplier_info/product_view.xml	1970-01-01 00:00:00 +0000
+++ product_supplier_info/product_view.xml	2014-04-23 15:17:26 +0000
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+
+        <record id="view_product_supplierinfo_search" model="ir.ui.view">
+            <field name="name">product.supplierinfo.search</field>
+            <field name="model">product.supplierinfo</field>
+            <field name="arch" type="xml">
+                <search string="Product Supplier Info">
+                	<field name="name" string="Supplier"/>
+                	<field name="product_code" string="Supplier Product Code"/>
+                    <field name="product_name" string="Supplier Product Code"/>
+                    <field name="product_id" />
+                    <group  expand='1' string='Group by...' groups="base.group_extended">
+                       <filter string='Product Code' name='supplier_code' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'product_code'}" />
+                       <filter string='Product' name='product' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'product_id'}" />
+                       <filter string='Supplier' name='supplier' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'name'}" />
+                    </group>
+                </search>
+            </field>
+        </record>
+        
+        <record id="view_product_supplierinfo_tree1" model="ir.ui.view">
+            <field name="name">product.supplierinfo.tree1</field>
+            <field name="model">product.supplierinfo</field>
+            <field name="arch" type="xml">
+            	<tree string="Supplier Information" editable="top">
+                    <field name="sequence" widget="handle"/>
+                    <field name="product_code" string="Supplier Product Code"/>
+                    <field name="product_id" string="Product Name"/>
+                    <field name="product_name" string="Supplier Product Name"/>
+                    <field name="name"/>
+                    <field name="delay"/>
+                    <field name="qty_available"/>
+                    <field name="virtual_available"/>
+                    <field name="min_qty"/>
+                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                </tree>
+            </field>
+        </record>
+        <record id="view_product_supplierinfo_form1" model="ir.ui.view">
+            <field name="name">product.supplierinfo.form1</field>
+            <field name="model">product.supplierinfo</field>
+            <field name="inherit_id" ref="product.product_supplierinfo_form_view"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='sequence']" position="before">
+                    <field name="product_id"/>
+                </xpath>
+            </field>
+        </record>
+        
+
+        <record id="action_product_supplier_info" model="ir.actions.act_window">
+            <field name="name">Product Supplier Info</field>
+            <field name="res_model">product.supplierinfo</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="view_id" ref="view_product_supplierinfo_tree1"/>
+            <field name="search_view_id" ref="view_product_supplierinfo_search"/>
+            <field name="context">{'search_default_supplier':1,'group_by':[]}</field>
+        </record>
+
+	    <menuitem
+	        id="menu_product_supplier_info"
+	        name="Product Suppliers"
+	        sequence="15"
+	        action="action_product_supplier_info"
+	        parent="stock.menu_stock_product"/>
+    </data>
+</openerp>

=== added directory 'product_supplier_info/static'
=== added directory 'product_supplier_info/static/description'
=== added file 'product_supplier_info/static/description/index.html'
--- product_supplier_info/static/description/index.html	1970-01-01 00:00:00 +0000
+++ product_supplier_info/static/description/index.html	2014-04-23 15:17:26 +0000
@@ -0,0 +1,17 @@
+<section class="oe_container">
+    <div class="oe_row">
+    <h2 class="oe_slogan">product_supplier_info Module</h2> 
+    <h3 class="oe_slogan">Categorise supplier product by Supplier name</h3>
+    <h4 class="oe_slogan"><a href="http://www.elico-corp.com";>By Elico Corp</a></h4>
+       <p>This module categorizes each product item by supplier.It allows for users to be able to view a compiled list of products supplied by the supplier.  </p>
+               
+                <p>Users can also directly add new products to the supplier's list.</p>
+        <div class="oe_row_img oe_centered oe_mt32">
+            <img class="oe_picture oe_screenshot" src="product_supplier_info.png">
+        </div>
+    </div>
+     <div class="oe_row oe_centeralign oe_more_space">
+            <a href="http://www.elico-corp.com/saas/"; class="oe_button oe_big">Start your <span class="oe_emph">free</span> trial</a>
+        </div>
+        <h4 class="oe_slogan">or</h4>
+</section>

=== added file 'product_supplier_info/static/description/product_supplier_info.png'
Binary files product_supplier_info/static/description/product_supplier_info.png	1970-01-01 00:00:00 +0000 and product_supplier_info/static/description/product_supplier_info.png	2014-04-23 15:17:26 +0000 differ