[IMP] stock.tracking, stock.production.lot: improve views and tooltips

bzr revid: odo@openerp.com-20100906143347-gxjg48cino3j46qo
This commit is contained in:
Olivier Dony 2010-09-06 16:33:47 +02:00
parent bc240ec607
commit b5cbbb8c53
2 changed files with 62 additions and 36 deletions

View File

@ -497,7 +497,7 @@ class stock_tracking(osv.osv):
_columns = {
'name': fields.char('Pack Reference', size=64, required=True, select=True),
'active': fields.boolean('Active', help="By unchecking the active field, you may hide a pack without deleting it."),
'serial': fields.char('Reference', size=64, select=True),
'serial': fields.char('Additional Reference', size=64, select=True, help="Other reference or serial number"),
'move_ids': fields.one2many('stock.move', 'tracking_id', 'Moves for this pack', readonly=True),
'date': fields.datetime('Creation Date', required=True),
}
@ -1344,14 +1344,15 @@ class stock_production_lot(osv.osv):
return ids
_columns = {
'name': fields.char('Serial Number', size=64, required=True, help="Unique serial number"),
'name': fields.char('Serial Number', size=64, required=True, help="Unique serial number, will be displayed as: PREFIX/SERIAL [INT_REF]"),
'ref': fields.char('Internal Reference', size=256, help="Internal reference number in case it differs from the manufacturer's serial number"),
'prefix': fields.char('Prefix', size=64, help="Optional prefix to prepend when displaying this serial number"),
'prefix': fields.char('Prefix', size=64, help="Optional prefix to prepend when displaying this serial number: PREFIX/SERIAL [INT_REF]"),
'product_id': fields.many2one('product.product', 'Product', required=True),
'date': fields.datetime('Creation Date', required=True),
'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select="2"),
'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select="2", help="Current quantity of products with this Production Lot Number available in company warehouses"),
'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'),
'company_id': fields.many2one('res.company', 'Company', select=True),
'move_ids': fields.one2many('stock.move', 'prodlot_id', 'Moves for this production lot', readonly=True),
}
_defaults = {
'date': time.strftime('%Y-%m-%d %H:%M:%S'),

View File

@ -157,23 +157,25 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Packs">
<notebook colspan="4">
<page string="General Information">
<field name="name" select="1"/>
<field name="serial" select="1"/>
<field name="date" select="1"/>
<field name="active" select="1"/>
<separator string="Traceability" colspan="4" />
<group colspan="2" col="2">
<button name="action_traceability" icon="gtk-go-up" string="Upstream traceability" type="object" context="{'type': '','field': ''}"/>
<button name="action_traceability" icon="gtk-go-down" string="Downstream traceability" type="object" context="{'type': 'move_history_ids','field': ''}"/>
</group>
</page>
<page string="Stock Move">
<field colspan="4" name="move_ids" nolabel="1" />
</page>
</notebook>
<group col="2" colspan="2">
<separator string="Pack Identification" colspan="2"/>
<field name="name"/>
<field name="serial"/>
<field name="date"/>
<field name="active" groups="base.group_extended"/>
</group>
<group col="2" colspan="2">
<separator string="Traceability" colspan="4"/>
<button name="action_traceability" icon="gtk-go-up" string="Upstream traceability" type="object"
context="{'type': '','field': ''}" colspan="2"/>
<button name="action_traceability" icon="gtk-go-down" string="Downstream traceability" type="object"
context="{'type': 'move_history_ids','field': ''}" colspan="2"/>
</group>
<notebook colspan="4">
<page string="Stock Moves">
<field colspan="2" name="move_ids" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
@ -215,6 +217,22 @@
</field>
</record>
<record model="ir.ui.view" id="search_stock_packs">
<field name="name">Pack Search</field>
<field name="model">stock.tracking</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Pack Search">
<group col="10" colspan="4">
<field name="name" />
<field name="serial" />
<field name="date" />
<field name="active" groups="base.group_extended"/>
</group>
</search>
</field>
</record>
<record id="view_production_lot_revision_form" model="ir.ui.view">
<field name="name">stock.production.lot.revision.form</field>
<field name="model">stock.production.lot.revision</field>
@ -251,21 +269,28 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Production Lot">
<field name="name"/>
<field name="ref"/>
<field name="prefix"/>
<field name="product_id"/>
<field name="stock_available"/>
<field name="date"/>
<notebook colspan="4">
<page string="General Information">
<field colspan="4" name="revisions" nolabel="1"/>
<group col="4" colspan="4">
<button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}" icon="gtk-go-up"/>
<button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}" icon="gtk-go-down"/>
</group>
</page>
</notebook>
<group col="4" colspan="2">
<separator string="Production Lot Identification" colspan="4"/>
<field name="product_id" colspan="4"/>
<field name="prefix" colspan="2"/>
<field name="name" colspan="2"/>
<field name="ref" colspan="4"/>
<field name="date" colspan="4"/>
</group>
<group col="2" colspan="2">
<separator string="Traceability" colspan="4"/>
<field name="stock_available" colspan="4"/>
<button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}" icon="gtk-go-up" colspan="2"/>
<button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}" icon="gtk-go-down" colspan="2"/>
</group>
<notebook colspan="4">
<page string="Revisions">
<field colspan="2" name="revisions" nolabel="1"/>
</page>
<page string="Stock Moves">
<field colspan="2" name="move_ids" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>