2
0

[IMP] account_asset_management: code cosmetics

This commit is contained in:
luc-demeyer 2015-06-01 19:54:36 +02:00 committed by Rodrigo
parent b963cc17ee
commit 2ba8b47612
2 changed files with 7 additions and 9 deletions

View File

@ -4,7 +4,7 @@
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
# Copyright (c) 2014-2015 Noviat nv/sa (www.noviat.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@ -31,8 +31,8 @@ class account_invoice(orm.Model):
def action_number(self, cr, uid, ids, context=None):
super(account_invoice, self).action_number(cr, uid, ids, context)
asset_obj = self.pool.get('account.asset.asset')
asset_line_obj = self.pool.get('account.asset.depreciation.line')
asset_obj = self.pool['account.asset.asset']
asset_line_obj = self.pool['account.asset.depreciation.line']
for inv in self.browse(cr, uid, ids):
move = inv.move_id
assets = [aml.asset_id for aml in
@ -102,7 +102,7 @@ class account_invoice_line(orm.Model):
cr, uid, ids, product_id,
partner_id, inv_type, fposition_id, account_id)
if account_id:
asset_category = self.pool.get('account.account').browse(
asset_category = self.pool['account.account'].browse(
cr, uid, account_id).asset_category_id
if asset_category:
vals = {'asset_category_id': asset_category.id}
@ -118,5 +118,3 @@ class account_invoice_line(orm.Model):
if line.asset_category_id:
res['asset_category_id'] = line.asset_category_id.id
return res
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,7 +7,7 @@
<field name="name">account.asset.category.form</field>
<field name="model">account.asset.category</field>
<field name="arch" type="xml">
<form string="Asset category" version="7.0">
<form string="Asset category">
<group>
<group>
<field name="name"/>
@ -75,7 +75,7 @@
<field name="name">account.asset.asset.form</field>
<field name="model">account.asset.asset</field>
<field name="arch" type="xml">
<form string="Asset" version="7.0">
<form string="Asset">
<header>
<button name="validate" states="draft" string="Confirm Asset" type="object" class="oe_highlight"/>
<button name="set_to_draft" states="open,close" string="Set to Draft" type="object" groups="account.group_account_manager"/>
@ -308,7 +308,7 @@
<field name="name">account.asset.history.form</field>
<field name="model">account.asset.history</field>
<field name="arch" type="xml">
<form string="Asset History" version="7.0">
<form string="Asset History">
<group>
<group>
<field name="name"/>