Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-addons_issue6_warehouse-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons_issue6_warehouse-mma/+merge/121754

Hello, 

I have made some improvements in Warehouse which are as follows

1] Added appropriate groups on some fields
2] set default location on location as per type [in, out]
3] Fixed Value-error: No such external ID currently defined in the system: 
base.menu_definitions
4] Fixed click on upstream Traceability -> JavaScript error
5] removed icon on button
6] make a tree and form view for move and set in move_line
7] set a domain on product filed 
8] Added a right object on tree view
9] Replaced act_window with Button [import Inventory]

Thanks,
Mayur
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons_issue6_warehouse-mma/+merge/121754
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-addons_issue6_warehouse-mma.
=== modified file 'crm_claim/crm_claim_menu.xml'
--- crm_claim/crm_claim_menu.xml	2012-07-18 13:14:03 +0000
+++ crm_claim/crm_claim_menu.xml	2012-08-29 05:43:20 +0000
@@ -50,9 +50,9 @@
             parent="base.menu_aftersale" action="crm_case_categ_claim0" sequence="1"/>
 
         <!-- Claim Stages -->
+        <menuitem id="base.menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60"/>
         <menuitem id="base.menu_project_config_project" name="Stages" parent="base.menu_definitions" sequence="1"/>
         <menuitem id="menu_claim_stage_view" name="Claim Stages" action="crm_claim_stage_act" parent="base.menu_project_config_project" sequence="20"/>
-        <menuitem id="base.menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60"/>
 
     </data>
 </openerp>

=== modified file 'procurement/procurement.py'
--- procurement/procurement.py	2012-08-13 05:14:11 +0000
+++ procurement/procurement.py	2012-08-29 05:43:20 +0000
@@ -554,7 +554,7 @@
         'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True),
         'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"),
         'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"),
-        'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]),
+        'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','!=','service')]),
         'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True),
         'product_min_qty': fields.float('Minimum Quantity', required=True,
             help="When the virtual stock goes below the Min Quantity specified for this field, OpenERP generates "\

=== modified file 'stock/stock_view.xml'
--- stock/stock_view.xml	2012-08-15 22:30:38 +0000
+++ stock/stock_view.xml	2012-08-29 05:43:20 +0000
@@ -106,6 +106,7 @@
             <field name="arch" type="xml">
                 <form string="Physical Inventory" version="7.0">
                 <header>
+                    <button name="%(action_view_stock_fill_inventory)d" string="Import Inventory" type="action" class="oe_highlight"/>
                     <button name="action_confirm" states="draft" string="Confirm Inventory" type="object" class="oe_highlight"/>
                     <button name="action_done" states="confirm" string="Validate Inventory" type="object" class="oe_highlight"/>
                     <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
@@ -777,115 +778,18 @@
                     </group>
                     <notebook>
                         <page string="Products">
-                            <field name="move_lines" context="{'address_in_id': partner_id}">
-                                <tree colors="grey:scrapped == True" string="Stock Moves">
-                                    <field name="product_id"/>
-                                    <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
-                                    <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
-                                    <field name="product_uos" groups="product.group_uos"/>
-                                    <button name="%(stock.move_scrap)d"
-                                        string="Scrap Products" type="action"
-                                        icon="gtk-convert" context="{'scrap': True}"
-                                        states="draft,waiting,confirmed,assigned"
-                                        groups="base.group_user"/>
-                                    <field name="scrapped" invisible="1"/>
-                                    <field name="prodlot_id" groups="stock.group_production_lot"/>
-                                    <button
-                                        name="%(stock.track_line)d"
-                                        string="Split in Serial Number"
-                                        groups="stock.group_production_lot"
-                                        type="action" icon="terp-stock_effects-object-colorize"
-                                        states="draft,waiting,confirmed,assigned"/>
-                                    <field groups="stock.group_tracking_lot" name="tracking_id"/>
-                                    <button name="setlast_tracking" string="Put in current pack" type="object"
-                                        attrs="{'invisible': [('tracking_id','&lt;&gt;',False)]}"
-                                        icon="terp-stock_effects-object-colorize"
-                                        groups="stock.group_tracking_lot"
-                                        states="draft,assigned,confirmed"/>
-                                    <button name="%(split_into)d" string="Put in a new pack" type="action"
-                                        groups="product.group_stock_packaging"
-                                        icon="terp-stock_effects-object-colorize"
-                                        states="draft,assigned,confirmed"/>
-                                    <field name="location_dest_id" groups="stock.group_locations"/>
-                                    <field name="state"/>
-                                </tree>
-                                <form string="Stock Moves" version="7.0">
-                                    <header>
-                                        <span groups="base.group_user">
-                                            <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
-                                            <button name="action_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/>
-                                            <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-find"/>
-                                        </span>
-                                        <field name="state" widget="statusbar" statusbar_visible="draft,assigned,done"/>
-                                    </header>
-                                    <group>
-                                        <group>
-                                            <field name="name" invisible="1"/>
-                                            <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)"/>
-                                            <label for="product_qty"/>
-                                            <div>
-                                                <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" class="oe_inline"/>
-                                                <field name="product_uom" string="Unit Of Measure" groups="product.group_uom" class="oe_inline"/>
-                                                <button name="%(stock.move_scrap)d"
-                                                        string="Scrap" type="action"
-                                                        icon="gtk-convert" context="{'scrap': True}"
-                                                        states="draft,waiting,confirmed,assigned"
-                                                        groups="base.group_user"/>
-                                            </div>
-                                            <label for="product_uos_qty" groups="product.group_uos"/>
-                                            <div groups="product.group_uos">
-                                                <field name="product_uos_qty" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" class="oe_inline"/>
-                                                <field name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" class="oe_inline"/>
-                                            </div>
-                                            <field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]"/>
-                                        </group>
-                                        <group>
-                                            <field name="create_date" invisible="1"/>
-                                            <field name="date"/>
-                                            <field name="date_expected" on_change="onchange_date(date,date_expected)"/>
-                                        </group>
-
-                                        <group string="Locations" groups="stock.group_locations">
-                                            <field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
-                                            <field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
-                                        </group>
-
-                                        <group groups="stock.group_tracking_lot" string="Traceability">
-                                            <label for="tracking_id"/>
-                                            <div>
-                                                <field name="tracking_id" groups="stock.group_tracking_lot" class="oe_inline"/>
-                                                <button name="%(split_into)d" string="New Pack" type="action"
-                                                      groups="product.group_stock_packaging"
-                                                      icon="terp-stock_effects-object-colorize"
-                                                      states="draft,assigned,confirmed"/>
-                                            </div>
-
-                                            <label for="prodlot_id"/>
-                                            <div>
-                                                <field name="prodlot_id" groups="stock.group_production_lot"
-                                                    context="{'location_id':location_id, 'product_id':product_id}"
-                                                    domain="[('product_id','=?',product_id)]"
-                                                    on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id, product_uom)" class="oe_inline"/>
-                                                <button name="%(track_line)d"
-                                                    groups="stock.group_tracking_lot"
-                                                    states="draft,waiting,confirmed,assigned"
-                                                    string="Split" type="action" icon="terp-stock_effects-object-colorize"/>
-                                            </div>
-                                        </group>
-                                    </group>
-                                </form>
-                            </field>
+                            <field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
                         </page>
                         <page string="Additional Info">
                             <group>
                                 <group>
                                     <field name="move_type"/>
-                                    <field name="type" groups="base.group_user"/>
+                                    <field name="type" groups="base.group_no_one"/>
                                     <field name="auto_picking" groups="base.group_user"/>
                                 </group>
                                 <group>
                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
-                                    <field name="date_done"/>
+                                    <field name="date_done" groups="base.group_no_one"/>
                                 </group>
                             </group>
                         </page>
@@ -970,7 +874,7 @@
         
         <record id="view_picking_out_tree" model="ir.ui.view">
             <field name="name">stock.picking.out.tree</field>
-            <field name="model">stock.picking</field>
+            <field name="model">stock.picking.out</field>
             <field name="arch" type="xml">
                 <tree colors="blue:state == 'draft';grey:state == 'cancel';red:state not in ('cancel', 'done') and min_date &lt; current_date" string="Delivery Orders">
                     <field name="name"/>
@@ -1000,7 +904,7 @@
                         <button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight"/>
                     </xpath>
                     <xpath expr="/form/header//button[@name='action_process']" position="replace">
-                        <button name="action_process" states="assigned" string="Deliver" type="object" icon="gtk-go-forward" class="oe_highlight"/>
+                        <button name="action_process" states="assigned" string="Deliver" type="object" class="oe_highlight"/>
                     </xpath>
                     <xpath expr="/form/header//field[@name='state']" position="replace">
                         <field name="state" nolabel="1" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" statusbar_colors='{"auto":"blue", "confirmed":"blue"}'/>
@@ -1008,6 +912,9 @@
                     <xpath expr="//field[@name='partner_id']" position="replace">
                         <field name="partner_id" on_change="onchange_partner_in(partner_id)"  colspan="4" string="Customer"/>
                     </xpath>
+                    <xpath expr="//field[@name='move_lines']" position="replace">
+                        <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'out', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
+                    </xpath>
                     <xpath expr="/form/sheet" position="after">
                         <div class="oe_chatter">
                             <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
@@ -1131,6 +1038,9 @@
                     <xpath expr="//field[@name='partner_id']" position="replace">
                         <field name="partner_id" on_change="onchange_partner_in(partner_id)"  colspan="4" string="Supplier"/>
                     </xpath>
+                    <xpath expr="//field[@name='move_lines']" position="replace">
+                        <field name="move_lines" context="{'address_in_id': partner_id, 'picking_type': 'in', 'form_view_ref':'view_move_picking_form', 'tree_view_ref':'view_move_picking_tree'}"/>
+                    </xpath>
                     <xpath expr="/form/sheet" position="after">
                         <div class="oe_chatter">
                             <field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
@@ -1205,7 +1115,7 @@
         </record>
         <menuitem action="action_picking_tree4" id="menu_action_picking_tree4" parent="menu_stock_warehouse_mgmt" sequence="1"/>
 
-        <menuitem action="action_picking_tree6" id="menu_action_picking_tree6" parent="menu_stock_warehouse_mgmt" sequence="2"/>
+        <menuitem action="action_picking_tree6" id="menu_action_picking_tree6" parent="menu_stock_warehouse_mgmt" sequence="2" groups="stock.group_locations"/>
 
         <record id="view_move_tree" model="ir.ui.view">
             <field name="name">stock.move.tree</field>
@@ -1249,6 +1159,44 @@
             </field>
         </record>
 
+        <record id="view_move_picking_tree" model="ir.ui.view">
+            <field name="name">stock.move.tree</field>
+            <field name="model">stock.move</field>
+            <field name="arch" type="xml">
+                <tree colors="grey:scrapped == True" string="Stock Moves">
+                    <field name="product_id"/>
+                    <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+                    <field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
+                    <field name="product_uos" groups="product.group_uos"/>
+                    <button name="%(stock.move_scrap)d"
+                       string="Scrap Products" type="action"
+                       icon="gtk-convert" context="{'scrap': True}"
+                       states="draft,waiting,confirmed,assigned"
+                       groups="base.group_user"/>
+                    <field name="scrapped" invisible="1"/>
+                    <field name="prodlot_id" groups="stock.group_production_lot"/>
+                    <button
+                       name="%(stock.track_line)d"
+                       string="Split in Serial Number"
+                       groups="stock.group_production_lot"
+                       type="action" icon="terp-stock_effects-object-colorize"
+                       states="draft,waiting,confirmed,assigned"/>
+                     <field groups="stock.group_tracking_lot" name="tracking_id"/>
+                     <button name="setlast_tracking" string="Put in current pack" type="object"
+                        attrs="{'invisible': [('tracking_id','&lt;&gt;',False)]}"
+                        icon="terp-stock_effects-object-colorize"
+                        groups="stock.group_tracking_lot"
+                        states="draft,assigned,confirmed"/>
+                     <button name="%(split_into)d" string="Put in a new pack" type="action"
+                        groups="product.group_stock_packaging"
+                        icon="terp-stock_effects-object-colorize"
+                        states="draft,assigned,confirmed"/>
+                      <field name="location_dest_id" groups="stock.group_locations"/>
+                      <field name="state"/>
+                </tree>
+            </field>
+        </record>
+
         <record id="view_move_form" model="ir.ui.view">
             <field name="name">stock.move.form</field>
             <field name="model">stock.move</field>
@@ -1327,6 +1275,80 @@
             </field>
         </record>
 
+        <record id="view_move_picking_form" model="ir.ui.view">
+            <field name="name">stock.move.form</field>
+            <field name="model">stock.move</field>
+            <field eval="4" name="priority"/>
+            <field name="arch" type="xml">
+            <form string="Stock Moves" version="7.0">
+                <header>
+                    <span groups="base.group_user">
+                        <button name="force_assign" states="confirmed" string="Force Availability" type="object"/>
+                        <button name="action_confirm" states="draft" string="Confirm" type="object"/>
+                        <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object"/>
+                    </span>
+                        <field name="state" widget="statusbar" statusbar_visible="draft,assigned,done"/>
+                </header>
+                <group>
+                    <group>
+                        <field name="name" invisible="1"/>
+                        <field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)"/>
+                        <label for="product_qty"/>
+                        <div>
+                            <field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" class="oe_inline"/>
+                            <field name="product_uom" string="Unit Of Measure" groups="product.group_uom" class="oe_inline"/>
+                            <button name="%(stock.move_scrap)d"
+                                string="Scrap" type="action"
+                                icon="gtk-convert" context="{'scrap': True}"
+                                states="draft,waiting,confirmed,assigned"
+                                groups="base.group_user"/>
+                        </div>
+                            <label for="product_uos_qty" groups="product.group_uos"/>
+                            <div groups="product.group_uos">
+                                <field name="product_uos_qty" on_change="onchange_uos_quantity(product_id, product_uos_qty, product_uos, product_uom)" class="oe_inline"/>
+                                <field name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" class="oe_inline"/>
+                            </div>
+                            <field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]"/>
+                            </group>
+                            <group>
+                                <field name="create_date" invisible="1"/>
+                                <field name="date"/>
+                                <field name="date_expected" on_change="onchange_date(date,date_expected)"/>
+                            </group>
+
+                            <group string="Locations" groups="stock.group_locations">
+                                <field name="location_id" domain="[('usage','&lt;&gt;','view')]"/>
+                                <field name="location_dest_id" domain="[('usage','=','internal')]" groups="stock.group_locations"/>
+                            </group>
+
+                            <group groups="stock.group_tracking_lot" string="Traceability">
+                                <label for="tracking_id"/>
+                                <div>
+                                    <field name="tracking_id" groups="stock.group_tracking_lot" class="oe_inline"/>
+                                      <button name="%(split_into)d" 
+                                            string="New Pack" type="action"
+                                            groups="product.group_stock_packaging"
+                                            icon="terp-stock_effects-object-colorize"
+                                            states="draft,assigned,confirmed"/>
+                                 </div>
+
+                                  <label for="prodlot_id"/>
+                                  <div>
+                                        <field name="prodlot_id" groups="stock.group_production_lot"
+                                            context="{'location_id':location_id, 'product_id':product_id}"
+                                            domain="[('product_id','=?',product_id)]"
+                                            on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id, product_uom)" class="oe_inline"/>
+                                        <button name="%(track_line)d"
+                                            groups="stock.group_tracking_lot"
+                                            states="draft,waiting,confirmed,assigned"
+                                            string="Split" type="action" icon="terp-stock_effects-object-colorize"/>
+                            </div>
+                        </group>
+                    </group>
+                </form>
+            </field>
+        </record>
+
         <record id="view_move_search" model="ir.ui.view">
             <field name="name">stock.move.search</field>
             <field name="model">stock.move</field>

=== modified file 'stock/wizard/stock_fill_inventory.py'
--- stock/wizard/stock_fill_inventory.py	2012-08-07 11:34:14 +0000
+++ stock/wizard/stock_fill_inventory.py	2012-08-29 05:43:20 +0000
@@ -25,11 +25,21 @@
 class stock_fill_inventory(osv.osv_memory):
     _name = "stock.fill.inventory"
     _description = "Import Inventory"
+
+    def _default_location(self, cr, uid, ids, context=None):
+        location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context)
+        return location_id.id
+
     _columns = {
         'location_id': fields.many2one('stock.location', 'Location', required=True),
         'recursive': fields.boolean("Include children",help="If checked, products contained in child locations of selected location will be included as well."),
         'set_stock_zero': fields.boolean("Set to zero",help="If checked, all product quantities will be set to zero to help ensure a real physical inventory is done"),
     }
+
+    _defaults = {
+        'location_id': _default_location,
+    }
+
     def view_init(self, cr, uid, fields_list, context=None):
         """
          Creates view dynamically and adding fields at runtime.

=== modified file 'stock/wizard/stock_fill_inventory_view.xml'
--- stock/wizard/stock_fill_inventory_view.xml	2012-08-09 06:05:16 +0000
+++ stock/wizard/stock_fill_inventory_view.xml	2012-08-29 05:43:20 +0000
@@ -8,8 +8,8 @@
               <form string="Import Inventory" version="7.0">
                   <separator string="Import current product inventory from the following location"/>
                   <group>
-                      <field name="location_id"/>
-                      <field name="recursive"/>
+                      <field name="location_id" groups="stock.group_locations"/>
+                      <field name="recursive" groups="stock.group_locations"/>
                       <field name="set_stock_zero"/>
                   </group>
                   <footer>
@@ -21,14 +21,16 @@
             </field>
         </record>
 
-         <act_window name="Import Inventory"
-            res_model="stock.fill.inventory"
-            src_model="stock.inventory"
-            view_mode="form"
-            target="new"
-            context="{'search_default_in_location':1}"
-            key2="client_action_multi"
-            id="action_view_stock_fill_inventory"/>
-
+        <record id="action_view_stock_fill_inventory" model="ir.actions.act_window">
+            <field name="name">Import Inventory</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">stock.fill.inventory</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">form</field>
+            <field name="view_id" ref="view_stock_fill_inventory"/>
+            <field name="target">new</field>
+            <field name="context">{'search_default_in_location':1}</field>
+        </record>
+            
     </data>
 </openerp>

=== modified file 'stock/wizard/stock_move_view.xml'
--- stock/wizard/stock_move_view.xml	2012-08-09 06:05:16 +0000
+++ stock/wizard/stock_move_view.xml	2012-08-29 05:43:20 +0000
@@ -48,7 +48,7 @@
                             <field name="product_qty" class="oe_inline"/>
                             <field name="product_uom" class="oe_inline" readonly="1"/>
                         </div>
-                        <field name="location_id" string="Scrap Location" domain="[('usage','&lt;&gt;','view'),('scrap_location','=',True)]" widget="selection"/>
+                        <field name="location_id" string="Scrap Location" domain="[('usage','&lt;&gt;','view'),('scrap_location','=',True)]" widget="selection" groups="stock.group_locations"/>
                     </group>
                     <footer>
                         <button name="move_scrap" string="Ok" type="object" class="oe_highlight"  />

=== modified file 'stock/wizard/stock_traceability.py'
--- stock/wizard/stock_traceability.py	2012-01-31 13:36:57 +0000
+++ stock/wizard/stock_traceability.py	2012-08-29 05:43:20 +0000
@@ -42,7 +42,7 @@
         lot_id = ids
         if context is None:
             context = {}
-        type1 = context.get('type', 'move_history_ids2')
+        type1 = 'type' in context and context['type'] or 'move_history_ids2'
         field = context.get('field', 'tracking_id')
         obj = self.pool.get('stock.move')
         ids = obj.search(cr, uid, [(field, 'in',lot_id)])

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to