[IMP] in height,width,length add cm and imrove stock Journal, and imrove date_done field in incomming_shippment,internal moves and delivery order
bzr revid: shp@tinyerp.com-20121121071718-cl9dbck5nd37i9ei
This commit is contained in:
@@ -784,6 +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'),
|
||||
'uom_id': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True),
|
||||
'uom_id1': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True),
|
||||
'uom_id2': fields.related('uom_id', 'product_id', type='many2one', relation='product.uom', string='UoM', readonly=True),
|
||||
}
|
||||
|
||||
|
||||
@@ -809,10 +812,21 @@ class product_packaging(osv.osv):
|
||||
res = cr.fetchone()
|
||||
return (res and res[0]) or False
|
||||
|
||||
def _get_uom(self, cr, uid, context=None):
|
||||
try:
|
||||
product = self.pool.get('ir.model.data').get_object(cr, uid, 'product', 'product_uom_cm')
|
||||
except ValueError:
|
||||
# a ValueError is returned if the xml id given is not found in the table ir_model_data
|
||||
return False
|
||||
return product.id
|
||||
|
||||
_defaults = {
|
||||
'rows' : lambda *a : 3,
|
||||
'sequence' : lambda *a : 1,
|
||||
'ul' : _get_1st_ul,
|
||||
'uom_id': _get_uom,
|
||||
'uom_id1': _get_uom,
|
||||
'uom_id2': _get_uom,
|
||||
}
|
||||
|
||||
def checksum(ean):
|
||||
|
||||
@@ -547,26 +547,32 @@
|
||||
<field name="model">product.packaging</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Packaging" version="7.0">
|
||||
<group col="4">
|
||||
<field name="product_id"/>
|
||||
<newline/>
|
||||
<field name="ean"/>
|
||||
<field name="sequence" invisible="1"/>
|
||||
<newline/>
|
||||
<field name="qty"/>
|
||||
<field name="ul"/>
|
||||
<field name="weight_ul"/>
|
||||
<separator colspan="4" string="Palletization"/>
|
||||
<field name="ul_qty"/>
|
||||
<field name="rows"/>
|
||||
<field name="weight"/>
|
||||
<separator colspan="4" string="Pallet Dimension"/>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="length"/>
|
||||
<separator colspan="4" string="Other Info"/>
|
||||
<field colspan="4" name="name"/>
|
||||
</group>
|
||||
<group col="6">
|
||||
<field name="product_id"/>
|
||||
<newline/>
|
||||
<field name="ean"/>
|
||||
<newline/>
|
||||
<field name="qty"/>
|
||||
<field name="ul"/>
|
||||
<newline/>
|
||||
<field name="weight_ul"/>
|
||||
<newline/>
|
||||
<separator colspan="6" string="Palletization"/>
|
||||
<field name="ul_qty"/>
|
||||
<field name="rows"/>
|
||||
<newline/>
|
||||
<field name="weight"/>
|
||||
<separator colspan="6" string="Pallet Dimension"/>
|
||||
<field name="height"/>
|
||||
<field name="uom_id" nolabel="1"/>
|
||||
<field name="width"/>
|
||||
<field name="uom_id2" nolabel="1"/>
|
||||
<field name="length"/>
|
||||
<field name="uom_id1" nolabel="1"/>
|
||||
<newline/>
|
||||
<separator colspan="6" string="Other Info"/>
|
||||
<field colspan="4" name="name"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -530,7 +530,7 @@ class product_category(osv.osv):
|
||||
_columns = {
|
||||
'property_stock_journal': fields.property('account.journal',
|
||||
relation='account.journal', type='many2one',
|
||||
string='Stock journal', view_load=True,
|
||||
string='Stock Journal', view_load=True,
|
||||
help="When doing real-time inventory valuation, this is the Accounting Journal in which entries will be automatically posted when stock moves are processed."),
|
||||
'property_stock_account_input_categ': fields.property('account.account',
|
||||
type='many2one', relation='account.account',
|
||||
|
||||
@@ -655,7 +655,7 @@ class stock_picking(osv.osv):
|
||||
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
|
||||
store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"),
|
||||
'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
|
||||
store=True, type='datetime', string='Max. Expected Date', select=2),
|
||||
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
|
||||
@@ -3035,6 +3035,7 @@ class stock_picking_in(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'backorder_id': fields.many2one('stock.picking.in', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
|
||||
'date_done': fields.datetime('Date of Reception', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'state': fields.selection(
|
||||
[('draft', 'Draft'),
|
||||
('auto', 'Waiting Another Operation'),
|
||||
@@ -3080,6 +3081,7 @@ class stock_picking_out(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'backorder_id': fields.many2one('stock.picking.out', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True),
|
||||
'date_done': fields.datetime('Date of Delivery ', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
|
||||
'state': fields.selection(
|
||||
[('draft', 'Draft'),
|
||||
('auto', 'Waiting Another Operation'),
|
||||
|
||||
Reference in New Issue
Block a user