[IMP] account_asset: Improved condition and added necessary changes.
bzr revid: uco@tinyerp.com-20110527133854-jy21rj1sezo79lev
This commit is contained in:
parent
a798f06d1a
commit
4d0f29fa25
|
@ -38,12 +38,15 @@ class account_invoice_line(osv.osv):
|
|||
def move_line_get_item(self, cr, uid, line, context={}):
|
||||
asset_obj = self.pool.get('account.asset.asset')
|
||||
res = super(account_invoice_line, self).move_line_get_item(cr, uid, line, context)
|
||||
if line.invoice_id and line.invoice_id.type not in ['out_invoice', 'out_refund']:
|
||||
if line.asset_category_id:
|
||||
if line.invoice_id and line.invoice_id.type not in ('out_invoice', 'out_refund') and line.asset_category_id:
|
||||
vals = {
|
||||
'name': line.product_id and (line.name + ": " + line.product_id.name) or line.name,
|
||||
'category_id': line.asset_category_id.id,
|
||||
'purchase_value': line.price_subtotal
|
||||
'purchase_value': line.price_subtotal,
|
||||
'period_id': line.invoice_id.period_id.id,
|
||||
'partner_id': line.invoice_id.partner_id.id,
|
||||
'company_id': line.invoice_id.company_id.id,
|
||||
'currency_id': line.invoice_id.currency_id.id,
|
||||
}
|
||||
asset_id = asset_obj.create(cr, uid, vals, context=context)
|
||||
if line.asset_category_id.open_asset:
|
||||
|
|
Loading…
Reference in New Issue