addons14/account_asset_management/models/account_asset.py
def _compute_year_amount(
        self, residual_amount, depreciation_start_date, depreciation_stop_date, entry
    ):
        """
        Localization: override this method to change the degressive-linear
        calculation logic according to local legislation.
        """
        if self.method_time != "year":
            raise UserError(
                _(
                    "The '_compute_year_amount' method is only intended for "
                    "Time Method 'Number of Years'."
                )
            )
        year_amount_linear = self._get_amount_linear(
            depreciation_start_date, depreciation_stop_date, entry
        )
        if self.method == "linear":
            return year_amount_linear
        if self.method == "linear-limit":
            if (residual_amount - year_amount_linear) < self.salvage_value:
                return residual_amount - self.salvage_value
            else:
                return year_amount_linear
        year_amount_degressive = residual_amount * self.method_progress_factor
        if self.method == "degressive":
            return year_amount_degressive
        if self.method == "degr-linear":
            if year_amount_linear > year_amount_degressive:
                return min(year_amount_linear, residual_amount)
            else:
                return min(year_amount_degressive, residual_amount)
        if self.method == "degr-limit":
            if (residual_amount - year_amount_degressive) < self.salvage_value:
                return residual_amount - self.salvage_value
            else:
                return year_amount_degressive
        else:
            raise UserError(_("Illegal value %s in asset.method.") % self.method)

        Localization: override this method to change the degressive-linear
        calculation logic according to local legislation.
        
override this method to change the degressive-linear
calculation logic according to local legislation.
override this method to change the degressive - linear calculation logic according to local legislation .
def _compute_year_amount(
        self, residual_amount, depreciation_start_date, depreciation_stop_date, entry
    ):
        if self.method_time != "year":
            raise UserError(
                _(
                    "The '_compute_year_amount' method is only intended for "
                    "Time Method 'Number of Years'."
                )
            )
        year_amount_linear = self._get_amount_linear(
            depreciation_start_date, depreciation_stop_date, entry
        )
        if self.method == "linear":
            return year_amount_linear
        if self.method == "linear-limit":
            if (residual_amount - year_amount_linear) < self.salvage_value:
                return residual_amount - self.salvage_value
            else:
                return year_amount_linear
        year_amount_degressive = residual_amount * self.method_progress_factor
        if self.method == "degressive":
            return year_amount_degressive
        if self.method == "degr-linear":
            if year_amount_linear > year_amount_degressive:
                return min(year_amount_linear, residual_amount)
            else:
                return min(year_amount_degressive, residual_amount)
        if self.method == "degr-limit":
            if (residual_amount - year_amount_degressive) < self.salvage_value:
                return residual_amount - self.salvage_value
            else:
                return year_amount_degressive
        else:
            raise UserError(_("Illegal value %s in asset.method.") % self.method)
def _compute_year_amount ( self , residual_amount , depreciation_start_date , depreciation_stop_date , entry ) : if self . method_time != "year" : raise UserError ( _ ( "The '_compute_year_amount' method is only intended for " "Time Method 'Number of Years'." ) ) year_amount_linear = self . _get_amount_linear ( depreciation_start_date , depreciation_stop_date , entry ) if self . method == "linear" : return year_amount_linear if self . method == "linear-limit" : if ( residual_amount - year_amount_linear ) < self . salvage_value : return residual_amount - self . salvage_value else : return year_amount_linear year_amount_degressive = residual_amount * self . method_progress_factor if self . method == "degressive" : return year_amount_degressive if self . method == "degr-linear" : if year_amount_linear > year_amount_degressive : return min ( year_amount_linear , residual_amount ) else : return min ( year_amount_degressive , residual_amount ) if self . method == "degr-limit" : if ( residual_amount - year_amount_degressive ) < self . salvage_value : return residual_amount - self . salvage_value else : return year_amount_degressive else : raise UserError ( _ ( "Illegal value %s in asset.method." ) % self . method )
Localization: override this method to change the degressive-linear
calculation logic according to local legislation.
Localization : override this method to change the degressive - linear calculation logic according to local legislation .
"""
        Localization: override this method to change the degressive-linear
        calculation logic according to local legislation.
        """
self
residual_amount
depreciation_start_date
depreciation_stop_date
entry