(self, table, start_date, stop_date)
return line_dates
Add last depreciation date when method is percentage.
Add last depreciation date when method is percentage.
Add last depreciation date when method is percentage .
def _compute_line_dates(self, table, start_date, stop_date):
        """Add last depreciation date when method is percentage."""
        line_dates = super()._compute_line_dates(table, start_date, stop_date)
        if self.method_time == "percentage":
            if not line_dates or line_dates[-1] < stop_date:
                if self.method_period == "month":
                    line_date = stop_date + relativedelta(day=31)
                if self.method_period == "quarter":
                    m = [x for x in [3, 6, 9, 12] if x >= stop_date.month][0]
                    line_date = stop_date + relativedelta(month=m, day=31)
                elif self.method_period == "year":
                    line_date = stop_date + relativedelta(month=12, day=31)
                line_dates.append(line_date)
        return line_dates
def _compute_line_dates ( self , table , start_date , stop_date ) : line_dates = super ( ) . _compute_line_dates ( table , start_date , stop_date ) if self . method_time == "percentage" : if not line_dates or line_dates [ - 1 ] < stop_date : if self . method_period == "month" : line_date = stop_date + relativedelta ( day = 31 ) if self . method_period == "quarter" : m = [ x for x in [ 3 , 6 , 9 , 12 ] if x >= stop_date . month ] [ 0 ] line_date = stop_date + relativedelta ( month = m , day = 31 ) elif self . method_period == "year" : line_date = stop_date + relativedelta ( month = 12 , day = 31 ) line_dates . append ( line_date ) return line_dates