Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
7832 Vistas

Hi,

I'm working on account assets in Odoo 11 and I created an asset with the below information:


Computation Method : Linear

Time Method Based On : Number of Entries

Prorata Temporis : True

Number of Depreciations : 48

Number of Months in a Period: 1


When I save the record, the Depreciations created is 49 not 48

I checked the code and I found the below method increased number of 
Depreciations by 1 if Prorata Temporis equal True and I don't know why they do that? 


Any one know why they do that?

def _compute_board_undone_dotation_nb(self, depreciation_date, total_days):
undone_dotation_number = self.method_number
if self.method_time == 'end':
end_date = datetime.strptime(self.method_end, DF).date()
undone_dotation_number = 0
while depreciation_date <= end_date:
depreciation_date = date(depreciation_date.year, depreciation_date.month, depreciation_date.day) + relativedelta(months=+self.method_period)
undone_dotation_number += 1
if self.prorata:
undone_dotation_number +=
1
return undone_dotation_number
Avatar
Descartar
Mejor respuesta

Hi,
Please check the calculation for depreciation lines with prorata temporis in odoo11 asset management,
We can check with an example:

Date: 04/22/2020
Gross Value:    $ 10,000.00
Salvage Value:  $ 5,000.00
Computation Method : Linear
Time Method Based On : Number of Entries
Prorata Temporis : True
Number of Depreciation : 1
Number of Months in a Period: 1
In this condition we get 2 depreciation lines

First for 04/22/2020 to 04/30/2020
Calculation is as follows
5000/30 = 166.6667 (Since we calculate monthly,divide residual value by number of days of the month)
To calculate depreciation for the month April :
166.6667 * 9 ( Number of days remaining in the month) = 1500

Second  for 05/01/2020 to 05/21/2020
So the calculation for depreciation is 166.67 * 21 = 3500.0007(round it to 3500), Where 21 is the number of days in the next month to meet the total number of days of the month.

Here, the total number of days for the month of April is 30. So it is 30-9 =21
Even if we are calculating for 1 month, 2 months are taken into consideration for calculating the depreciation line (9 days from April and 21 days from May). If given Date as “04/01/2020”, there will be only 1 depreciation line for the month.


Hope it helps

Avatar
Descartar