[FIX]rename some label and use a radio widget as filter for new inventory

bzr revid: csn@openerp.com-20130923145301-m10zd239g5jitmn3
This commit is contained in:
Cedric Snauwaert 2013-09-23 16:53:01 +02:00
parent a6b678ff66
commit 3eeb395e24
3 changed files with 38 additions and 11 deletions

View File

@ -1812,7 +1812,7 @@ class stock_inventory(osv.osv):
_columns = {
'name': fields.char('Inventory Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Name."),
'date': fields.datetime('Creation Date', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Create Date."),
'date': fields.datetime('Inventory Date', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Create Date."),
'date_done': fields.datetime('Date done', help="Inventory Validation Date."),
'line_ids': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', readonly=False, states={'done': [('readonly', True)]}, help="Inventory Lines."),
'move_ids': fields.one2many('stock.move', 'inventory_id', 'Created Moves', help="Inventory Moves."),
@ -1824,6 +1824,7 @@ class stock_inventory(osv.osv):
'partner_id': fields.many2one('res.partner', 'Owner', readonly=True, states={'draft': [('readonly', False)]}, help="Specify Owner to focus your inventory on a particular Owner."),
'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', readonly=True, states={'draft': [('readonly', False)]}, help="Specify Lot/Serial Number to focus your inventory on a 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'),
'filter': fields.selection([('product', 'Product'), ('owner', 'Owner'), ('product_owner','Product & Owner'), ('lot','Lot/Serial Number'), ('pack','Pack'), ('none', 'None')], 'Selection Filter'),
}
def _default_stock_location(self, cr, uid, context=None):

View File

@ -118,16 +118,20 @@
</group>
<group>
<field name="date"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<div class="oe_grey" colspan="4">Specify filters to focus your inventory a on particular product, lot, pack and product's owner.</div>
<group>
<field name="product_id" domain="[('type','=','product')]"/>
<field name="lot_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<label for="filter"/>
<div colspan="4">
<field name="filter" widget='radio'/>
</div>
</group>
<group>
<field name="partner_id"/>
<field name="package_id"/>
<field name="product_id" domain="[('type','=','product')]" attrs="{'invisible': [('filter', 'not in', ('product', 'product_owner'))]}"/>
<field name="lot_id" attrs="{'invisible': [('filter', '!=', 'lot')]}"/>
<field name="partner_id" attrs="{'invisible': [('filter', 'not in', ('owner', 'product_owner'))]}"/>
<field name="package_id" attrs="{'invisible': [('filter', '!=', 'pack')]}"/>
</group>
</group>
<notebook attrs="{'invisible':[('state','=','draft')]}">
@ -147,8 +151,27 @@
</tree>
</field>
</page>
<page string="Stock Moves" attrs="{'invisible': [('state', '!=', 'done')]}">
<field name="move_ids"/>
<page string="Inventory Adjustments" attrs="{'invisible': [('state', '!=', 'done')]}">
<field name="move_ids">
<tree colors="grey:scrapped == True" string="Stock Moves">
<field name="product_id"/>
<field name="product_uom_qty" on_change="onchange_quantity(product_id, product_uom_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"/>
<field name="picking_id" invisible="1" />
<field name="create_date" invisible="1" />
<field name="date_expected" invisible="1" />
<button name="%(stock.move_scrap)d"
string="Scrap Products" type="action"
icon="terp-gtk-jump-to-ltr" context="{'scrap': True}"
states="draft,waiting,confirmed,assigned"
groups="base.group_user"/>
<field name="scrapped" invisible="1"/>
<field name="location_id" groups="stock.group_locations"/>
<field name="location_dest_id" groups="stock.group_locations"/>
<field name="state"/>
</tree>
</field>
</page>
</notebook>
</sheet>
@ -480,11 +503,11 @@
<field name="arch" type="xml">
<form string="Warehouse" version="7.0">
<sheet>
<label for="name" class="oe_edit_only"/>
<label for="name" class="oe_edit_only" string="Warehouse Short Name"/>
<h1><field name="name"/></h1>
<group>
<group>
<field name="lot_stock_id" groups="stock.group_locations"/>
<field name="lot_stock_id" groups="stock.group_locations" string="Inventory Location"/>
</group>
<group>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>

View File

@ -182,7 +182,10 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="route_id" attrs="{'invisible': [('route_id', '=', False)]}"/>
<button name="%(action_view_stock_configure_wh)d" string="Configure this warehouse" type="action" attrs="{'invisible': [('route_id', '!=', False)]}"/>
</xpath>
<xpath expr="//group[last()]" position="after">
<button name="%(action_view_stock_configure_wh)d" class="oe_right oe_highlight" string="Configure this warehouse" type="action" attrs="{'invisible': [('route_id', '!=', False)]}"/>
</xpath>
</field>
</record>