[IMP] stock_landed_costs : All the fields are readonly in 'open' state.

bzr revid: mdi@tinyerp.com-20140411131028-z5olzn8t9elmy3cm
This commit is contained in:
DJ Patel 2014-04-11 18:40:28 +05:30
parent 1ce2520ed3
commit a5ba8f22a9
2 changed files with 10 additions and 9 deletions

View File

@ -74,12 +74,12 @@ class stock_landed_cost(osv.osv):
return {'value': result}
_columns = {
'name': fields.char('Name', size=256, required=True),
'date': fields.date('Date', required=True),
'picking_ids': fields.many2many('stock.picking', string='Pickings'),
'cost_lines': fields.one2many('stock.landed.cost.lines', 'cost_id', 'Cost Lines'),
'valuation_adjustment_lines': fields.one2many('stock.valuation.adjustment.lines', 'cost_id', 'Valuation Adjustments'),
'description': fields.text('Item Description'),
'name': fields.char('Name', size=256, required=True, states={'open': [('readonly', True)]}),
'date': fields.date('Date', required=True, states={'open': [('readonly', True)]}),
'picking_ids': fields.many2many('stock.picking', string='Pickings', states={'open': [('readonly', True)]}),
'cost_lines': fields.one2many('stock.landed.cost.lines', 'cost_id', 'Cost Lines', states={'open': [('readonly', True)]}),
'valuation_adjustment_lines': fields.one2many('stock.valuation.adjustment.lines', 'cost_id', 'Valuation Adjustments', states={'open': [('readonly', True)]}),
'description': fields.text('Item Description', states={'open': [('readonly', True)]}),
'amount_total': fields.function(_total_amount, type='float', string='Total', digits_compute=dp.get_precision('Account'),
store={
'stock.landed.cost': (lambda self, cr, uid, ids, c={}: ids, ['cost_lines'], 20),
@ -275,9 +275,9 @@ class stock_valuation_adjustment_lines(osv.osv):
_columns = {
'name': fields.char('Description', size=256),
'cost_id': fields.many2one('stock.landed.cost', 'Landed Cost', required=True, ondelete='cascade'),
'cost_line_id': fields.many2one('stock.landed.cost.lines', 'Cost Line'),
'move_id': fields.many2one('stock.move', 'Stock Move'),
'account_move_id': fields.many2one('account.move', 'Journal Entry'),
'cost_line_id': fields.many2one('stock.landed.cost.lines', 'Cost Line', readonly=True),
'move_id': fields.many2one('stock.move', 'Stock Move', readonly=True),
'account_move_id': fields.many2one('account.move', 'Journal Entry', readonly=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
'quantity': fields.float('Quantity', digits_compute= dp.get_precision('Product Unit of Measure'), required=True),
'weight': fields.float('Weight', digits_compute= dp.get_precision('Product Unit of Measure')),

View File

@ -109,6 +109,7 @@
<tree string="Landed Costs">
<field name="name"/>
<field name="date"/>
<field name="state"/>
</tree>
</field>
</record>