bugfix in raise

This commit is contained in:
Luc De Meyer
2018-09-03 20:50:11 +02:00
committed by Akim Juillerat
parent 1d2c7910fd
commit 5bb98b33b1
3 changed files with 1 additions and 7 deletions

View File

@@ -4,7 +4,7 @@
{
'name': 'Assets Management',
'version': '10.0.3.0.1',
'version': '10.0.3.0.2',
'license': 'AGPL-3',
'depends': [
'account_fiscal_year',

View File

@@ -734,7 +734,6 @@ class AccountAsset(models.Model):
"""
if self.method_time != 'year':
raise UserError(
_("Programming Error"),
_("The '_compute_year_amount' method is only intended for "
"Time Method 'Number of Years."))

View File

@@ -30,7 +30,6 @@ class AccountMove(models.Model):
('type', 'in', ['depreciate', 'remove'])])
if deprs and not self._context.get('unlink_from_asset'):
raise UserError(
_('Error!'),
_("You are not allowed to remove an accounting entry "
"linked to an asset."
"\nYou should remove such entries from the asset."))
@@ -46,7 +45,6 @@ class AccountMove(models.Model):
[('move_id', '=', move.id), ('type', '=', 'depreciate')])
if deprs:
raise UserError(
_('Error!'),
_("You cannot change an accounting entry "
"linked to an asset depreciation line."))
return super(AccountMove, self).write(vals)
@@ -70,7 +68,6 @@ class AccountMoveLine(models.Model):
def create(self, vals, **kwargs):
if vals.get('asset_id') and not self._context.get('allow_asset'):
raise UserError(
_('Error!'),
_("You are not allowed to link "
"an accounting entry to an asset."
"\nYou should generate such entries from the asset."))
@@ -107,12 +104,10 @@ class AccountMoveLine(models.Model):
if not (self.env.context.get('allow_asset_removal') and
vals.keys() == ['asset_id']):
raise UserError(
_('Error!'),
_("You cannot change an accounting item "
"linked to an asset depreciation line."))
if vals.get('asset_id'):
raise UserError(
_('Error!'),
_("You are not allowed to link "
"an accounting entry to an asset."
"\nYou should generate such entries from the asset."))