Mayur Maheshwari(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-addons_issue6_warehouse-mma into
lp:openobject-addons.
Requested reviews:
Purnendu Singh (OpenERP) (psi-tinyerp)
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-09-04 08:37:18 +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 'delivery/delivery_view.xml'
--- delivery/delivery_view.xml 2012-08-08 12:19:50 +0000
+++ delivery/delivery_view.xml 2012-09-04 08:37:18 +0000
@@ -259,10 +259,10 @@
<record id="view_picking_withweight_internal_move_form" model="ir.ui.view">
<field name="name">stock.picking_withweight.internal.move.form.view</field>
- <field name="model">stock.picking</field>
- <field name="inherit_id" ref="stock.view_picking_form"/>
+ <field name="model">stock.move</field>
+ <field name="inherit_id" ref="stock.view_move_picking_tree"/>
<field name="arch" type="xml">
- <xpath expr="/form/sheet/notebook/page/field[@name='move_lines']/tree/field[@name='product_uom']" position="after">
+ <xpath expr="//field[@name='product_uom']" position="after">
<field name="weight"/>
<field name="weight_net" groups="base.group_no_one"/>
</xpath>
@@ -306,7 +306,7 @@
<record id="view_delivery_order_inherit_stock" model="ir.ui.view">
<field name="name">stock.picking.out.form</field>
- <field name="model">stock.picking</field>
+ <field name="model">stock.picking.out</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<xpath expr="/form/header//button[@string='Create Invoice/Refund']" position="after">
=== modified file 'mrp/board_manufacturing_view.xml'
--- mrp/board_manufacturing_view.xml 2012-08-09 06:05:16 +0000
+++ mrp/board_manufacturing_view.xml 2012-09-04 08:37:18 +0000
@@ -31,7 +31,8 @@
icon="terp-graph"
id="menu_board_manufacturing"
parent="base.menu_reporting_dashboard"
- sequence="30"/>
+ sequence="30"
+ groups="group_mrp_manager"/>
</data>
</openerp>
=== modified file 'procurement/procurement.py'
--- procurement/procurement.py 2012-08-13 05:14:11 +0000
+++ procurement/procurement.py 2012-09-04 08:37:18 +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 'purchase/board_purchase_view.xml'
--- purchase/board_purchase_view.xml 2012-08-09 06:05:16 +0000
+++ purchase/board_purchase_view.xml 2012-09-04 08:37:18 +0000
@@ -85,7 +85,8 @@
icon="terp-graph"
id="menu_board_purchase"
parent="base.menu_reporting_dashboard"
- sequence="20"/>
+ sequence="20"
+ groups="group_purchase_manager"/>
</data>
</openerp>
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2012-08-15 20:13:20 +0000
+++ purchase/purchase.py 2012-09-04 08:37:18 +0000
@@ -543,6 +543,7 @@
'partner_id': order.dest_address_id.id or order.partner_id.id,
'move_dest_id': order_line.move_dest_id.id,
'state': 'draft',
+ 'type':'in',
'purchase_line_id': order_line.id,
'company_id': order.company_id.id,
'price_unit': order_line.price_unit
=== modified file 'purchase/stock_view.xml'
--- purchase/stock_view.xml 2012-08-31 17:51:53 +0000
+++ purchase/stock_view.xml 2012-09-04 08:37:18 +0000
@@ -31,7 +31,7 @@
<field name="purchase_id"/>
</xpath>
<xpath expr="//field[@name='company_id']" position="after">
- <field name="warehouse_id"/>
+ <field name="warehouse_id" groups="stock.group_locations"/>
</xpath>
</field>
</record>
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-08-29 09:48:28 +0000
+++ sale/sale.py 2012-09-04 08:37:18 +0000
@@ -870,6 +870,7 @@
'sale_line_id': line.id,
'tracking_id': False,
'state': 'draft',
+ 'type':'out',
#'state': 'waiting',
'note': '\n'.join(line.name.split('\n')[1:]),
'company_id': order.company_id.id,
=== modified file 'sale/sale_view.xml'
--- sale/sale_view.xml 2012-08-30 12:19:27 +0000
+++ sale/sale_view.xml 2012-09-04 08:37:18 +0000
@@ -450,7 +450,7 @@
<menuitem id="menu_sale_quotations"
action="action_order_tree5" parent="base.menu_sales"
- sequence="4"/>
+ sequence="4" groups="base.group_sale_salesman_all_leads"/>
<record id="action_order_tree" model="ir.actions.act_window">
<field name="name">Old Quotations</field>
=== modified file 'stock/report/report_stock_move_view.xml'
--- stock/report/report_stock_move_view.xml 2012-08-21 08:47:22 +0000
+++ stock/report/report_stock_move_view.xml 2012-09-04 08:37:18 +0000
@@ -6,7 +6,8 @@
id="stock.next_id_61"
name="Warehouse"
sequence="15"
- parent="base.menu_reporting"/>
+ parent="base.menu_reporting"
+ groups="group_stock_manager"/>
<record id="view_stock_tree" model="ir.ui.view">
<field name="name">report.stock.move.tree</field>
=== modified file 'stock/security/ir.model.access.csv'
--- stock/security/ir.model.access.csv 2012-08-09 09:44:38 +0000
+++ stock/security/ir.model.access.csv 2012-09-04 08:37:18 +0000
@@ -21,11 +21,11 @@
access_stock_production_lot_user,stock.production.lot user,model_stock_production_lot,stock.group_stock_user,1,1,1,1
access_stock_production_lot_revision,stock.production.lot.revision,model_stock_production_lot_revision,stock.group_stock_user,1,1,1,1
access_stock_move_manager,stock.move manager,model_stock_move,stock.group_stock_manager,1,1,0,0
-access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,0,0,0
+access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,1,1,0
access_stock_move_warehouse_manager,stock.move.manager,model_stock_move,stock.group_stock_manager,1,1,1,1
-access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,0,0,0
+access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,1,1,0
access_stock_inventory_manager,stock.inventory manager,model_stock_inventory,stock.group_stock_manager,1,1,1,1
-access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,0,0,0
+access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,1,1,0
access_stock_inventory_line_manager,stock.inventory.line manager,model_stock_inventory_line,stock.group_stock_manager,1,1,1,1
access_stock_report_prodlots,stock.report.prodlots,model_stock_report_prodlots,stock.group_stock_manager,1,0,0,0
access_stock_location_sale_manager,stock.location sale manager,model_stock_location,base.group_sale_manager,1,0,0,0
=== modified file 'stock/stock.py'
--- stock/stock.py 2012-08-29 09:48:28 +0000
+++ stock/stock.py 2012-09-04 08:37:18 +0000
@@ -1653,6 +1653,7 @@
# used for colors in tree views:
'scrapped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scrapped', readonly=True),
+ 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
}
def _check_location(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids, context=context):
@@ -1732,10 +1733,25 @@
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.company_id.partner_id.id
+ def _default_move_type(self, cr, uid, context=None):
+ """ Gets default type of move
+ @return: type
+ """
+ if context is None:
+ context = {}
+ picking_type = context.get('picking_type')
+ type = 'internal'
+ if picking_type == 'in':
+ type = 'in'
+ elif picking_type == 'out':
+ type = 'out'
+ return type
+
_defaults = {
'location_id': _default_location_source,
'location_dest_id': _default_location_destination,
'partner_id': _default_destination_address,
+ 'type': _default_move_type,
'state': 'draft',
'priority': '1',
'product_qty': 1.0,
@@ -1889,6 +1905,26 @@
result['location_dest_id'] = loc_dest_id
return {'value': result}
+ def onchange_move_type(self, cr, uid, ids, type, context=None):
+ """ On change of move type gives sorce and destination location.
+ @param type: Move Type
+ @return: Dictionary of values
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ location_source_id = False
+ location_dest_id = False
+ if type == 'in':
+ location_source_id = 'stock_location_suppliers'
+ location_dest_id = 'stock_location_stock'
+ elif type == 'out':
+ location_source_id = 'stock_location_stock'
+ location_dest_id = 'stock_location_customers'
+ if location_source_id:
+ location_model, location_source_id = mod_obj.get_object_reference(cr, uid, 'stock', location_source_id)
+ if location_dest_id:
+ location_model, location_dest_id = mod_obj.get_object_reference(cr, uid, 'stock', location_dest_id)
+ return {'value':{'location_id': location_source_id, 'location_dest_id': location_dest_id}}
+
def onchange_date(self, cr, uid, ids, date, date_expected, context=None):
""" On change of Scheduled Date gives a Move date.
@param date_expected: Scheduled Date
=== modified file 'stock/stock_view.xml'
--- stock/stock_view.xml 2012-09-03 13:45:03 +0000
+++ stock/stock_view.xml 2012-09-04 08:37:18 +0000
@@ -106,8 +106,9 @@
<field name="arch" type="xml">
<form string="Physical Inventory" version="7.0">
<header>
- <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_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" groups="stock.group_stock_user"/>
+ <button name="action_done" states="confirm" string="Validate Inventory" type="object" class="oe_highlight" groups="stock.group_stock_manager"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name="action_cancel_inventory" states="draft,confirm,done" string="Cancel Inventory" type="object"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm"/>
@@ -779,115 +780,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','<>',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','<>','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>
@@ -972,7 +876,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 < current_date" string="Delivery Orders">
<field name="name"/>
@@ -1002,7 +906,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"}'/>
@@ -1010,6 +914,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"/>
@@ -1133,6 +1040,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"/>
@@ -1207,7 +1117,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>
@@ -1218,6 +1128,7 @@
<field name="name"/>
<field name="picking_id" string="Reference"/>
<field name="origin"/>
+ <field name="type" on_change="onchange_move_type(type)"/>
<field name="create_date" invisible="1" groups="base.group_no_one"/>
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, False)"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
@@ -1251,6 +1162,45 @@
</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 eval="4" name="priority"/>
+ <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','<>',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>
@@ -1292,6 +1242,7 @@
</group>
<group name="origin_grp" string="Origin">
<field name="picking_id"/>
+ <field name="type" on_change="onchange_move_type(type)"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="create_date" groups="base.group_no_one"/>
</group>
@@ -1329,6 +1280,81 @@
</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="2" 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)"/>
+ <field name="type" invisible="1"/>
+ <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','<>','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>
@@ -1380,6 +1406,21 @@
</p>
</field>
</record>
+
+ <record model="ir.actions.act_window.view" id="action_stock_move_tree_all">
+ <field name="sequence" eval="1"/>
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="view_move_tree"/>
+ <field name="act_window_id" ref="action_move_form2"/>
+ </record>
+
+ <record model="ir.actions.act_window.view" id="action_stock_move_form_all">
+ <field name="sequence" eval="3"/>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_move_form"/>
+ <field name="act_window_id" ref="action_move_form2"/>
+ </record>
+
<menuitem action="action_move_form2" id="menu_action_move_form2" parent="menu_traceability" sequence="3"/>
<!--
=== 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-09-04 08:37:18 +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-09-04 08:37:18 +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-09-04 08:37:18 +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','<>','view'),('scrap_location','=',True)]" widget="selection"/>
+ <field name="location_id" string="Scrap Location" domain="[('usage','<>','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-09-04 08:37:18 +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