← Back to team overview

openerp-community team mailing list archive

[Merge] lp:~lin-yu/openobject-addons/elico-7.0 into lp:~openerp-community/openobject-addons/elico-7.0

 

LIN Yu has proposed merging lp:~lin-yu/openobject-addons/elico-7.0 into lp:~openerp-community/openobject-addons/elico-7.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~lin-yu/openobject-addons/elico-7.0/+merge/180476

[ADD] Product Supplier Info

-- 
https://code.launchpad.net/~lin-yu/openobject-addons/elico-7.0/+merge/180476
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openobject-addons/elico-7.0.
=== 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	2013-08-16 05:44:12 +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/>.
+#
+##############################################################################
+import product
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== added file 'product_supplier_info/__openerp__.py'
--- product_supplier_info/__openerp__.py	1970-01-01 00:00:00 +0000
+++ product_supplier_info/__openerp__.py	2013-08-16 05:44:12 +0000
@@ -0,0 +1,47 @@
+# -*- 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.0',
+    'category': 'purchase',
+    'sequence': 19,
+    'summary': 'Product Supplier Info',
+    'description': """
+Add a specific View for Supplier 
+==================================================
+    """,
+    'author': 'Elico Corp',
+    'website': 'http://www.elico-corp.com',
+    'images' : [],
+    'depends': ['product','stock'],#TO REMOVE joomlaconnector for standard
+    'data': [
+        'product_view.xml',
+    ],
+    'test': [],
+    'demo': [],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== added file 'product_supplier_info/product.py'
--- product_supplier_info/product.py	1970-01-01 00:00:00 +0000
+++ product_supplier_info/product.py	2013-08-16 05:44:12 +0000
@@ -0,0 +1,54 @@
+# -*- 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 wil    l 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 osv import osv, fields
+from openerp import tools
+from tools.translate import _
+import openerp.addons.decimal_precision as dp
+
+class product_supplierinfo(osv.osv):
+    _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"),
+    }
+product_supplierinfo()
+
+# 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	2013-08-16 05:44:12 +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_from1" model="ir.ui.view">
+            <field name="name">product.supplierinfo.from1</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="purchase.menu_procurement_management_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	2013-08-16 05:44:12 +0000
@@ -0,0 +1,17 @@
+<section class="oe_container">
+    <div class="oe_row oe_spaced">
+        <h2 class="oe_slogan">product_supplier_info Module</h2>
+        <h3 class="oe_slogan">Categorise supplier product by Supplier name</h3>
+        <div class="oe_span6">
+            <div class="oe_row_img oe_centered">
+                <img src="product_supplier_info.png" width="20%" height="30%" alt="" class="oe_picture oe_screenshot">
+            </div>
+        </div>
+        <div class="oe_span6">
+            <p class="oe_mt32">This module categorizes each product item by supplier. This 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.&nbsp;</p>
+ 				<div class="oe_centeralign oe_websiteonly">
+                <a href="http://www.elico-corp.com"; class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
+            </div>
+        </div>
+    </div>
+</section>
\ No newline at end of file

=== 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	2013-08-16 05:44:12 +0000 differ

Follow ups