Vauxoo / depreciation

For Venezuela Not for all the team.
0 stars 1 forks source link

On Depreciation Overriding. #2

Open alcarpio15 opened 8 years ago

alcarpio15 commented 8 years ago

As needed to conclude creating the Method to compute the Initial Adjustment, the main step to take now is to apply the Adjustment Factor on the Depreciation Lines provided by Odoo's Native Asset Module.

Unfortunately, there's an aspect of how Odoo natively handles the computing of an Asset's Depreciation Board that might clash severely with the process: The fact its Compute Method assumes the Depreciation happens in a Yearly basis when an Asset has no posted entries to its name (a common event when adding historical Asset data), despite the Asset Model's innate capability to also set the Depreciation Intervals to a shorter amount of months might lead to the awkward situation where an Asset can end up being depreciated months before its actual purchase.

And while there's the Prorata Temporis field to anchor an Asset to its purchase date, it also changes the Depreciation to work on a near Daily basis, which trades an extreme for another and the way said Depreciation gets computed might not fit some cases.

So the main thing to do is to ensure the Method can be more aware of the length of months between two Depreciation Dates and can pick an Initial Depreciation Date that reflects that awareness.

Now, some key counseling and second opinions is desired regarding how to deal with this issue before implementing a solution given a few factors:

alcarpio15 commented 8 years ago

@moylop260 , @zaoral , @nhomar : Is there's anything else I should have in mind while I work on the Override?

moylop260 commented 8 years ago

The best to answer is @hbto I can give you my opinion for a cool override methods in order to avoid conflicts with other override inherit for cases where is imposible use a normal inherit with super + my functionality

  1. Add a custom field
  2. Create a custom method decorator
  3. Create a inherit method with decorator to override.
nhomar commented 8 years ago

@alcarpio15

This will apply in all decisions on this development:

  1. If the behavior on odoo's base is a "error" make a proper issue in odoo/odoo and then link with your module (<< this is not the case here because odoo is not wrong, just the "Ajuste por Inflacion" considere a different approach).
  2. Then as 1 is False create your own method with your own button (as moylop mentioned), and copy-paste the part of the code you need from the official one you do not need to develop 100% of the logic).

Regards.