Asset should be takes date from the invoice date rather than current date

Bug #935564 reported by Ana Juaristi Olalde
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3
OpenERP Community Backports (Addons)
Fix Released
Undecided
Pedro Manuel Baeza
6.1
Fix Released
Undecided
Pedro Manuel Baeza

Bug Description

This one could be one requirement only in our country:

Creating the account move the taken data is:
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account_asset/account_asset.py line 358

 depreciation_date = line.asset_id.prorata and line.asset_id.purchase_date or time.strftime('%Y-%m-%d')

This is the purchase data or the moment where user pushes the wizard button to calculate asset account_moves

In our country it should be simply:
depreciation_date = line.depreciation_date

That is the account movement data is the one set in account.asset.depreciation.line

Related branches

Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

That is... the required changes would be:
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account_asset/account_asset_invoice.py line 51

                vals = {
                    'name': line.name,
                    'code': line.invoice_id.number or False,
                    'category_id': line.asset_category_id.id,
                    '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,
                }

ADD field:
                    'purchase_date' : line.invoice_id.date_invoice,

-----

On same point the default values of asset should be taken from asset category instead of being hardcoded on asset defaults:

                    'method': line.asset_category_id.method,
                    'method_number': line.asset_category_id.method_number,
                    'method_time': line.asset_category_id.method_time,
                    'method_period': line.asset_category_id.method_period,
                    'method_progress_factor': line.asset_category_id.method_progress_factor,
                    'method_end': line.asset_category_id.method_end,
                    'prorata': line.asset_category_id.prorata,

And... I think that are all little bugs I found in account_asset modules. Wishing it will be helpful:

Ana

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Ana,

I am totally agree with you, the date should be takes the purchase date (invoice date) instead of current date.

Currently it takes the current date. I have checked your suggestion and it works fine while setting
 'purchase_date' : line.invoice_id.date_invoice,

on asset_create method.

Thanks for reporting and valuable solution!

summary: - Several bug account_asset 4
+ Asset should be takes date from the invoice date rather than current
+ date
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Ana,

Sorry I missed to explain...your 2nd point.

To be continued....

I have checked your another point. Yes, you are right. The default values of asset should be taken from asset category i.e method, method_number etc... But currently it is working correct as you said, The assets entry created form invoice takes all this values based on asset category, It's not hard-corded.

So I am confirming this issue only for date issue.

Thanks and correct me If I am worng!

Amit Parik (amit-parik)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Ana,

Thanks for the reporting!

This issue has been fixed on lp:~openerp-dev/openobject-addons/trunk-bug-935564-amp with following revision no and id.
rev no : 6679
6679 <email address hidden>

Thank you!

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Hello Amit, it was confirmed in 6.1 too ?

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

fixed in trunk.
Thanks for the good contribution.

Changed in openobject-addons:
status: Fix Committed → Fix Released
Changed in ocb-addons:
assignee: nobody → Pedro Manuel Baeza (pedro.baeza)
status: New → Fix Released
status: Fix Released → Fix Committed
Changed in ocb-addons:
status: Fix Committed → Won't Fix
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.