[MRG] improved view,improved yml,help on fields lp:~openerp-dev/openobject-addons/trunk-physical_inventory-sunil
bzr revid: tpa@tinyerp.com-20130903064255-1jd28v7bxjtf3jri
This commit is contained in:
@@ -1696,10 +1696,10 @@ class stock_inventory(osv.osv):
|
||||
'state': fields.selection([('draft', 'Draft'), ('cancel', 'Cancelled'), ('confirm', 'In Progress'), ('done', 'Validated')], 'Status', readonly=True, select=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'location_id': fields.many2one('stock.location', 'Location', required=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', help="Product Name"),
|
||||
'package_id': fields.many2one('stock.quant.package', 'Pack'),
|
||||
'partner_id': fields.many2one('res.partner', 'Owner'),
|
||||
'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', help="Forces to specify a Serial Number for all moves generated by Inventoty"),
|
||||
'product_id': fields.many2one('product.product', 'Product', help="Select Product to Specify filters to focus your inventory a on particular product"),
|
||||
'package_id': fields.many2one('stock.quant.package', 'Pack', help="Select Pack to Specify filters to focus your inventory a on particular Pack"),
|
||||
'partner_id': fields.many2one('res.partner', 'Owner', help="Select Owner to Specify filters to focus your inventory a on particular Owner"),
|
||||
'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', help="Select Lot/Serial Number to Specify filters to focus your inventory a on particular Lot/Serial Number"),
|
||||
'move_ids_exist': fields.function(_get_move_ids_exist, type='boolean', string=' Stock Move Exists?', help='technical field for attrs in view'),
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<button name="prepare_inventory" states="draft" string="Start 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"/>
|
||||
<button name="action_cancel_inventory" states="confirm,done" string="Cancel Inventory" type="object"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
@@ -131,7 +131,7 @@
|
||||
</group>
|
||||
<notebook attrs="{'invisible':[('state','=','draft')]}">
|
||||
<page string="Inventory Details" >
|
||||
<button name="set_checked_qty" states="confirm" icon="gtk-go-forward" string="Set Checked Quantity to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
|
||||
<button name="set_checked_qty" states="confirm" string="⇒ Set Checked Quantity to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
|
||||
<field name="line_ids" string="Inventory Details">
|
||||
<tree string="Inventory Details" editable="bottom" colors="blue: product_qty != real_qty">
|
||||
<field context="{'location':location_id, 'uom':product_uom_id, 'to_date':parent.date}" name="product_id" on_change="on_change_product_id(location_id,product_id,product_uom_id,parent.date)" domain="[('type','=','product')]"/>
|
||||
@@ -139,7 +139,7 @@
|
||||
<field name="product_qty" string="Checked Quantity"/>
|
||||
<field name="product_uom_id" groups="product.group_uom"/>
|
||||
<field name="prod_lot_id"/>
|
||||
<field name="package_id" readonly="1"/>
|
||||
<field name="package_id"/>
|
||||
<field domain="[('usage','=','internal')]" name="location_id" groups="stock.group_locations"/>
|
||||
<field name="state" invisible="True"/>
|
||||
</tree>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
-
|
||||
In order to test the inventory, I create a new product
|
||||
-
|
||||
!record {model: product.product, id: inventory_product}:
|
||||
name: inventory prod
|
||||
type: product
|
||||
!record {model: product.product, id: inventory_product}:
|
||||
name: inventory prod
|
||||
type: product
|
||||
-
|
||||
I create an inventory for this product only
|
||||
-
|
||||
@@ -67,8 +67,8 @@
|
||||
self.prepare_inventory(cr, uid, [ref('inventory_test1')], context=context)
|
||||
inv = self.browse(cr, uid, ref('inventory_test1'), context=context)
|
||||
assert inv.line_ids and len(inv.line_ids) == 1, "Wrong number of inventory lines."
|
||||
assert len(inv.line_ids[0].product_qty) == 10, "Wrong quantity in inventory line."
|
||||
assert len(inv.line_ids[0].product_id.id) == ref('inventory_product'), "Wrong product in inventory line."
|
||||
assert inv.line_ids[0].product_qty == 10, "Wrong quantity in inventory line."
|
||||
assert inv.line_ids[0].product_id.id == ref('inventory_product'), "Wrong product in inventory line."
|
||||
-
|
||||
I modify the inventory line and set the quantity to 20 product on this new inventory
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user