[ADD] index file and misc changes
@ -68,6 +68,7 @@
|
||||
'account_asset_id': xfa_account_id,
|
||||
'account_depreciation_id': xfa_account_id,
|
||||
'account_depreciation_expense_id': expense_account_id,
|
||||
'prorata': 'fiscal_year',
|
||||
}
|
||||
self._update('account.asset.category', 'account_asset', vals, 'account_asset_category_electronics')
|
||||
vals = {
|
||||
@ -79,7 +80,7 @@
|
||||
'method_number': 6,
|
||||
'date': time.strftime('%Y-01-01'),
|
||||
'name': 'Basic Computer',
|
||||
'value': 23500.0,
|
||||
'value': 25000.0,
|
||||
'category_id': ref('account_asset_category_electronics'),
|
||||
}
|
||||
self._update('account.asset.asset', 'account_asset', vals, 'account_asset_asset_electronics')
|
@ -123,6 +123,8 @@ class AccountAssetAsset(models.Model):
|
||||
help="It is the amount you plan to have that you cannot depreciate.")
|
||||
invoice_id = fields.Many2one('account.invoice', string='Invoice', states={'draft': [('readonly', False)]}, copy=False)
|
||||
type = fields.Selection(related="category_id.type", string='Type', required=True)
|
||||
customer_invoice_count = fields.Integer(string="Invoice",
|
||||
compute="count_invoice")
|
||||
|
||||
@api.onchange('prorata')
|
||||
def onchange_prorata(self):
|
||||
@ -161,19 +163,21 @@ class AccountAssetAsset(models.Model):
|
||||
@api.multi
|
||||
def count_invoice(self):
|
||||
for self_obj in self:
|
||||
count = self.env['account.invoice'].search_count(
|
||||
[('asset_id', '=', self_obj.id)])
|
||||
count = self_obj.invoice_id.search_count(
|
||||
[('asset_id', '=', self_obj.id), ('type', '=', 'in_invoice')])
|
||||
self_obj.invoice_count = count
|
||||
customer_invoice_count = self_obj.invoice_id.search_count(
|
||||
[('asset_id', '=', self_obj.id), ('type', '=', 'out_invoice')])
|
||||
self_obj.customer_invoice_count = customer_invoice_count
|
||||
|
||||
def redirect_to_invoice(self):
|
||||
return {
|
||||
'name': (_('Invoices')),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.invoice',
|
||||
'domain': [('asset_id', '=', self.id)]
|
||||
}
|
||||
if self._context.get('customer'):
|
||||
action = self.env.ref('account.action_invoice_tree1').read()[0]
|
||||
action['domain'] = [('asset_id', '=', self.id), ('type', '=', 'out_invoice')]
|
||||
else:
|
||||
action = self.env.ref('account.action_invoice_tree2').read()[0]
|
||||
action['domain'] = [('asset_id', '=', self.id), ('type', '=', 'in_invoice')]
|
||||
return action
|
||||
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
|
BIN
addons/account_asset/static/description/account_asset_sc_01.png
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_02.png
Normal file
After Width: | Height: | Size: 86 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_03.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_04.png
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_05.png
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_06.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_07.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_08.png
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_09.png
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_10.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
addons/account_asset/static/description/account_asset_sc_11.png
Normal file
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 16 KiB |
304
addons/account_asset/static/description/index.html
Normal file
@ -0,0 +1,304 @@
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Type Configuration</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_01.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Type Configuration</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
<ul>
|
||||
<li><b>Asset Account: </b> Account used to record the purchase of the asset at its original price.</li>
|
||||
<li><b>Depreciation Entries: </b> Account used in the depreciation entries, to decrease the asset value.</li>
|
||||
<li><b>Depreciation Entries: Expense Account: </b>Account used in the periodical entries, to record a part of the asset as expense.</li>
|
||||
<li><b>Number of Depreciations: </b>The number of depreciations needed to depreciate your asset.</li>
|
||||
<li><b>Computation Method: </b>Choose the method to use to compute the amount of depreciation lines. <br>* Linear: Calculated on basis of: Gross Value / Number of Depreciations. <br>
|
||||
* Degressive: Calculated on basis of: Residual Value * Degressive Factor.</li>
|
||||
<li><b>Period Length: </b>State here the time between 2 depreciations, in months.</li>
|
||||
<li><b>Time Method: </b>Choose the method to use to compute the dates and number of entries.
|
||||
<br> * Number of Entries: Fix the number of entries and the time between 2 depreciations.
|
||||
<br> * Ending Date: Choose the time between 2 depreciations and the date the depreciations won't go beyond.</li>
|
||||
<li><b>Prorata: </b>Indicates that the first depreciation entry for this asset have to be done from the purchase date or first of January or fiscal year.</li>
|
||||
<li><b>Auto-confirm Assets: </b>Check this if you want to automatically confirm the assets of this category when created by invoices.</li>
|
||||
<li><b>Group Journal Entries: </b>Check this if you want to group the generated entries by categories.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_02.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Type Configuration</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
<ul>
|
||||
<li><b>Asset: </b>Your asset product.</li>
|
||||
<li><b>Gross Value: </b> Asset original price.</li>
|
||||
<li><b>Salvage Value: </b> It is the amount you plan to have that you cannot depreciate.</li>
|
||||
<li><b>Residual Value: </b> Gross Value - Salvage Value - (Depricated Line Amount)</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Depreciations Information</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_03.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Type Configuration</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
<ul>
|
||||
<li><b>Computation Method: </b>Choose the method to use to compute the amount of depreciation lines. <br>* Linear: Calculated on basis of: Gross Value / Number of Depreciations. <br>
|
||||
* Degressive: Calculated on basis of: Residual Value * Degressive Factor.</li>
|
||||
<li><b>Time Method Based: </b>Choose the method to use to compute the dates and number of entries.
|
||||
<br> * Number of Entries: Fix the number of entries and the time between 2 depreciations.
|
||||
<br> * Ending Date: Choose the time between 2 depreciations and the date the depreciations won't go beyond.</li>
|
||||
<li><b>Prorata: </b>Indicates that the first depreciation entry for this asset have to be done from the purchase date or first of January or fiscal year.</li>
|
||||
<li><b>Number of Depreciations: </b>The number of depreciations needed to depreciate your asset.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Depreciations Board</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_04.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Depreciations Board</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
<ul>
|
||||
<li>
|
||||
Calculate depreciations line based on Computation Method, Time Method Based, Prorata and Number of Depreciations.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Confirm</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_05.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Confirm</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
<ul>
|
||||
<li>
|
||||
You can view red toggle button for force fully create line of depreciations.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Depreciations line</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_06.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
<ul>
|
||||
<li>
|
||||
You can view here line of depreciations and you can also cancel particular depreciations line entry using Cancel Entry button.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Sale Asset</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_07.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
We can sale asset directly to particular customer.
|
||||
<ul>
|
||||
<li> <b> Sale Date </b>: Define here asset sale date.</li>
|
||||
<li> <b> Sale Value </b>: It will calculated amount by default Sale Date wise.</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Close and Invoice</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_08.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Asset Close and Invoice</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
Here remove other depreciations line which is greater than Sale Date.
|
||||
You can also view Customer Invoice button.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Invoice</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_09.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Invoice</h3>
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
Customer Invoice details.
|
||||
If you created asset by Vendor Bills then it display Vendor Invoice button in asset form.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Scrap Asset</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_10.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
If your products that are damaged or that are unusable then you can use Scrap.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Scrap Details</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_11.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
Just define the details related to Scrap Product. Once product is scrap it become Inactive.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<h3 class="oe_slogan">Report</h3>
|
||||
<div class="oe_span12">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<img src="account_asset_sc_report.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container">
|
||||
<div class="row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<p class="mt32 text-justify">
|
||||
You can print report for Start Date to End Date.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
@ -164,9 +164,12 @@
|
||||
<button class="oe_stat_button" name="open_entries" type="object" icon="fa-pencil">
|
||||
<field string="Dep. Entries" name="entry_count" widget="statinfo" />
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button" name="redirect_to_invoice" type="object" icon="fa-pencil" attrs="{'invisible': [('invoice_count', '=', 0)]}">
|
||||
<field name="invoice_count" widget="statinfo"/>
|
||||
<button class="oe_inline oe_stat_button" string="Vendor Invoice" name="redirect_to_invoice" type="object" icon="fa-pencil" attrs="{'invisible': [('invoice_count', '=', 0)]}">
|
||||
</button>
|
||||
<button class="oe_inline oe_stat_button" context="{'customer': True}" string="Customer Invoice" name="redirect_to_invoice" type="object" icon="fa-pencil" attrs="{'invisible': [('customer_invoice_count', '=', 0)]}">
|
||||
</button>
|
||||
<field name="invoice_count" widget="statinfo" invisible="1"/>
|
||||
<field name="customer_invoice_count" widget="statinfo" invisible="1"/>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
|
@ -32,11 +32,14 @@ class SaleAssetWizard(models.TransientModel):
|
||||
amount += line.amount
|
||||
last_date = line.depreciation_date
|
||||
else:
|
||||
if not last_date:
|
||||
if not last_date and line.sequence != 1:
|
||||
last_date = line.depreciation_date
|
||||
delta, total_days = \
|
||||
self.get_days(last_date, self.sale_date)
|
||||
amount += (line.amount * delta.days) / total_days
|
||||
days, total_days = \
|
||||
self.get_days(last_date, self.sale_date)
|
||||
else:
|
||||
days, total_days = \
|
||||
self.get_days(self.asset_id.date, self.sale_date)
|
||||
amount += (line.amount * days) / total_days
|
||||
break
|
||||
self.depreciated_amount = amount
|
||||
self.sale_value = self.asset_id.value_residual - amount
|
||||
@ -63,7 +66,7 @@ class SaleAssetWizard(models.TransientModel):
|
||||
delta = sale_date - last_depreciation_date
|
||||
year = last_depreciation_date.year
|
||||
total_days = (year % 4) and 365 or 366
|
||||
return delta, total_days
|
||||
return delta.days, total_days
|
||||
|
||||
@api.multi
|
||||
def last_line_info(self):
|
||||
@ -77,11 +80,13 @@ class SaleAssetWizard(models.TransientModel):
|
||||
last_line = line
|
||||
else:
|
||||
last_line = line
|
||||
if not last_date:
|
||||
if not last_date and line.sequence != 1:
|
||||
last_date = line.depreciation_date
|
||||
else:
|
||||
last_date = self.asset_id.date
|
||||
break
|
||||
delta, total_days = self.get_days(last_date, sale_date)
|
||||
amount = (last_line.amount * delta.days) / total_days
|
||||
days, total_days = self.get_days(last_date, sale_date)
|
||||
amount = (last_line.amount * days) / total_days
|
||||
return last_line, amount
|
||||
|
||||
def sale_asset(self):
|
||||
|
@ -25,7 +25,7 @@
|
||||
</record>
|
||||
|
||||
<record id="asset_scrap_action" model="ir.actions.act_window">
|
||||
<field name="name">scrap.asset.wizard</field>
|
||||
<field name="name">Scrap Asset</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">scrap.asset.wizard</field>
|
||||
<field name="view_type">form</field>
|
||||
|