← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~lin-yu/purchase-wkfl/add_product_supplier_info into lp:purchase-wkfl

 

LIN Yu has proposed merging lp:~lin-yu/purchase-wkfl/add_product_supplier_info into lp:purchase-wkfl.

Requested reviews:
  Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c): code review, no tests
  LIN Yu (lin-yu)
  Pedro Manuel Baeza (pedro.baeza): test
  Guewen Baconnier @ Camptocamp (gbaconnier-c2c)

For more details, see:
https://code.launchpad.net/~lin-yu/purchase-wkfl/add_product_supplier_info/+merge/194777

Add Module Product Supplier Info
* Modify Codes to adapt rules
* Add a specific View for Product Supplier
-- 
https://code.launchpad.net/~lin-yu/purchase-wkfl/add_product_supplier_info/+merge/194777
Your team Purchase Core Editors is subscribed to branch lp:purchase-wkfl.
=== 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-11-12 01:45:26 +0000
@@ -0,0 +1,24 @@
+# -*- 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	2013-11-12 01:45:26 +0000
@@ -0,0 +1,52 @@
+# -*- 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': """
+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.
+    """,
+    'author': 'Elico Corp',
+    'website': 'http://www.elico-corp.com',
+    'images': [
+               'static/images/product_supplier_info.png'
+               ],
+    '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	2013-11-12 01:45:26 +0000
@@ -0,0 +1,56 @@
+# -*- 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 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):
+        context = context or {}
+        res = {}
+        product_obj = self.pool.get('product.product')
+        for record in self.browse(cr, uid, ids, context=context):
+            res[record.id] = {}
+            product = product_obj.browse(cr, uid, record.product_id.id, context=context)
+            res[record.id]['qty_available'] = product.qty_available
+            res[record.id]['virtual_available'] = product.virtual_available
+        return res
+
+    _columns = {
+        # It cannot be done with related fields because product_id points to
+        # product.template, not product.product
+        'qty_available': fields.function(
+            _product_available, multi='qty_available', type='float',
+            string="Quantity On Hand"),
+        'virtual_available': fields.function(
+            _product_available, multi='virtual_available', type='float',
+            string="Forecasted Quantity"),
+        'delay' : fields.integer('Delivery Lead Time', required=True,
+                                 group_operator="avg",
+                                 help="Lead time in days between the confirmation of the purchase order and the reception of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning."
+                                 ),
+    }
+
+# 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-11-12 01:45:26 +0000
@@ -0,0 +1,75 @@
+<?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="priority">90</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_name" string="Supplier Product Name"/>
+                    <field name="product_id" string="Product"/>
+                    <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="priority">99</field>
+            <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 by 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-11-12 01:45:26 +0000
@@ -0,0 +1,12 @@
+<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>
+       <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="../images/product_supplier_info.png">
+        </div>
+    </div>
+</section>

=== added directory 'product_supplier_info/static/images'
=== added file 'product_supplier_info/static/images/product_supplier_info.png'
Binary files product_supplier_info/static/images/product_supplier_info.png	1970-01-01 00:00:00 +0000 and product_supplier_info/static/images/product_supplier_info.png	2013-11-12 01:45:26 +0000 differ

Follow ups