[IMP] UoM useability
bzr revid: fp@tinyerp.com-20121013100905-nsljyzxuzg2omoct
This commit is contained in:
commit
d95f09a3b2
|
@ -109,8 +109,8 @@ class product_uom(osv.osv):
|
|||
|
||||
_order = "name"
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True, translate=True),
|
||||
'category_id': fields.many2one('product.uom.categ', 'Unit of Measure Category', required=True, ondelete='cascade',
|
||||
'name': fields.char('Unit of Measure', size=64, required=True, translate=True),
|
||||
'category_id': fields.many2one('product.uom.categ', 'Category', required=True, ondelete='cascade',
|
||||
help="Quantity conversions may happen automatically between Units of Measure in the same category, according to their respective ratios."),
|
||||
'factor': fields.float('Ratio', required=True,digits=(12, 12),
|
||||
help='How many times this Unit of Measure is smaller than the reference Unit of Measure in this category:\n'\
|
||||
|
@ -126,7 +126,7 @@ class product_uom(osv.osv):
|
|||
'active': fields.boolean('Active', help="By unchecking the active field you can disable a unit of measure without deleting it."),
|
||||
'uom_type': fields.selection([('bigger','Bigger than the reference Unit of Measure'),
|
||||
('reference','Reference Unit of Measure for this category'),
|
||||
('smaller','Smaller than the reference Unit of Measure')],'Unit of Measure Type', required=1),
|
||||
('smaller','Smaller than the reference Unit of Measure')],'Type', required=1),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
|
|
@ -412,7 +412,6 @@
|
|||
<tree string="Units of Measure">
|
||||
<field name="name"/>
|
||||
<field name="category_id"/>
|
||||
<field name="factor"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -426,19 +425,22 @@
|
|||
<group>
|
||||
<field name="name"/>
|
||||
<field name="category_id"/>
|
||||
<field name="active"/>
|
||||
<field name="uom_type" on_change="onchange_type(uom_type)"/>
|
||||
<label for="factor"/>
|
||||
<div>
|
||||
<field name="factor" attrs="{'invisible':[('uom_type','!=','smaller')]}"/>
|
||||
<field name="factor_inv" attrs="{'invisible':[('uom_type','!=','bigger')]}"/>
|
||||
<p attrs="{'invisible':[('uom_type','!=','smaller')]}" class="oe_grey">
|
||||
e.g: 1 * (reference unit) = ratio * (this unit)
|
||||
</p>
|
||||
<p attrs="{'invisible':[('uom_type','!=','bigger')]}" class="oe_grey">
|
||||
e.g: 1 * (this unit) = ratio * (reference unit)
|
||||
</p>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="uom_type" on_change="onchange_type(uom_type)"/>
|
||||
<p attrs="{'invisible':[('uom_type','!=','smaller')]}" colspan="2">
|
||||
e.g: 1 * (reference unit) = ratio * (this unit)
|
||||
</p>
|
||||
<p attrs="{'invisible':[('uom_type','!=','bigger')]}" colspan="2">
|
||||
e.g: 1 * (this unit) = ratio * (reference unit)
|
||||
</p>
|
||||
<field name="active"/>
|
||||
<field name="rounding"/>
|
||||
<field name="factor" attrs="{'invisible':[('uom_type','!=','smaller')]}"/>
|
||||
<field name="factor_inv" attrs="{'invisible':[('uom_type','!=','bigger')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue