[IMP] field name of height_uom_id,weight_uom_id,height_uom_id,product_uom_weight1,product_uom_weight2 and add kg in weight,net weight

bzr revid: shp@tinyerp.com-20121204105829-g3z94mu5cr8fqr3v
This commit is contained in:
pankita shah (Open ERP) 2012-12-04 16:28:29 +05:30
parent e9f6d5db19
commit 016aa2cc07
4 changed files with 29 additions and 16 deletions

View File

@ -243,10 +243,10 @@
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<field name="company_id" position="before">
<label for="weight" string="weight"/>
<label for="weight" string="Weight"/>
<div>
<field name="weight" class="oe_inline"/>
<field name="product_uom_weight" nolabel="1" class="oe_inline"/>
<field name="weight_uom_id" nolabel="1" class="oe_inline"/>
</div>
<field name="weight_net" groups="base.group_no_one"/>
</field>
@ -283,8 +283,16 @@
<field name="inherit_id" ref="stock.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='main_grp']" position="inside">
<field name="weight"/>
<field name="weight_net" groups="base.group_no_one"/>
<label for="weight" string="Weight"/>
<div>
<field name="weight" class="oe_inline"/>
<field name="weight_uom_id" nolabel="1" class="oe_inline"/>
</div>
<label for="weight_net" string="Net Weight"/>
<div>
<field name="weight_net" groups="base.group_no_one" class="oe_inline"/>
<field name="weight_net_uom_id" nolabel="1" class="oe_inline"/>
</div>
</xpath>
</field>
</record>

View File

@ -66,7 +66,7 @@ class stock_picking(osv.osv):
}),
'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
'number_of_packages': fields.integer('Number of Packages'),
'product_uom_weight': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",),
'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",),
}
def _prepare_shipping_invoice_line(self, cr, uid, picking, invoice, context=None):
@ -135,7 +135,7 @@ class stock_picking(osv.osv):
return result
_defaults = {
'product_uom_weight': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('kg'))], context=c)[0],
'weight_uom_id': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('kg'))], context=c)[0],
}
stock_picking()
@ -174,8 +174,13 @@ class stock_move(osv.osv):
store={
'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20),
}),
'weight_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",),
'weight_net_uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True,readonly="1",help="Unit of Measure (Unit of Measure) is the unit of measurement for Weight",),
}
_defaults = {
'weight_uom_id': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('kg'))], context=c)[0],
'weight_net_uom_id': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('kg'))], context=c)[0],
}
stock_move()
# Redefinition of the new fields in order to update the model stock.picking.out in the orm

View File

@ -784,9 +784,9 @@ class product_packaging(osv.osv):
'height': fields.float('Height', help='The height of the package'),
'width': fields.float('Width', help='The width of the package'),
'length': fields.float('Length', help='The length of the package'),
'product_uom_width': fields.many2one('product.uom', 'Unit of Measure',readonly="1", required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for width",),
'product_uom_length': fields.many2one('product.uom', 'Unit of Measure', readonly="1",required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Length",),
'product_uom_height': fields.many2one('product.uom', 'Unit of Measure',readonly="1", required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Height",),
'width_uom_id': fields.many2one('product.uom', 'Unit of Measure',readonly="1", required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for width",),
'length_uom_id': fields.many2one('product.uom', 'Unit of Measure', readonly="1",required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Length",),
'height_uom_id': fields.many2one('product.uom', 'Unit of Measure',readonly="1", required=True, help="Unit of Measure (Unit of Measure) is the unit of measurement for Height",),
}
@ -816,9 +816,9 @@ class product_packaging(osv.osv):
'rows' : lambda *a : 3,
'sequence' : lambda *a : 1,
'ul' : _get_1st_ul,
'product_uom_width': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0],
'product_uom_length': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0],
'product_uom_height': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0]
'width_uom_id': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0],
'length_uom_id': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0],
'height_uom_id': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('cm'))], context=c)[0]
}

View File

@ -566,18 +566,18 @@
<label for="height" string="Height"/>
<div>
<field name="height" class="oe_inline"/>
<field name="product_uom_height" nolabel="1" class="oe_inline"/>
<field name="height_uom_id" nolabel="1" class="oe_inline"/>
</div>
<label for="width" string="Width"/>
<div>
<field name="width" class="oe_inline"/>
<field name="product_uom_width" nolabel="1" class="oe_inline"/>
<field name="width_uom_id" nolabel="1" class="oe_inline"/>
</div>
<newline/>
<label for="length" string="Length"/>
<div>
<field name="length" class="oe_inline"/>
<field name="product_uom_length" nolabel="1" class="oe_inline"/>
<field name="length_uom_id" nolabel="1" class="oe_inline"/>
</div>
<newline/>
<separator colspan="6" string="Other Info"/>