mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
'name': 'Assets Management',
|
||||
'version': '11.0.1.0.0',
|
||||
'version': '11.0.1.0.1',
|
||||
'license': 'AGPL-3',
|
||||
'depends': [
|
||||
'account_fiscal_year',
|
||||
|
||||
@@ -1005,7 +1005,7 @@ msgid "This amount represent the initial value of the asset.\n"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_asset_management
|
||||
#: code:addons/account_asset_management/models/account_move.py:135
|
||||
#: code:addons/account_asset_management/models/account_move.py:139
|
||||
#, python-format
|
||||
msgid "This option should only be used for a single id at a time."
|
||||
msgstr ""
|
||||
@@ -1070,7 +1070,7 @@ msgstr ""
|
||||
|
||||
#. module: account_asset_management
|
||||
#: code:addons/account_asset_management/models/account_move.py:69
|
||||
#: code:addons/account_asset_management/models/account_move.py:130
|
||||
#: code:addons/account_asset_management/models/account_move.py:134
|
||||
#, python-format
|
||||
msgid "You are not allowed to link an accounting entry to an asset.\n"
|
||||
"You should generate such entries from the asset."
|
||||
@@ -1109,7 +1109,7 @@ msgid "You cannot change an accounting entry linked to an asset depreciation lin
|
||||
msgstr ""
|
||||
|
||||
#. module: account_asset_management
|
||||
#: code:addons/account_asset_management/models/account_move.py:126
|
||||
#: code:addons/account_asset_management/models/account_move.py:130
|
||||
#, python-format
|
||||
msgid "You cannot change an accounting item linked to an asset depreciation line."
|
||||
msgstr ""
|
||||
|
||||
@@ -116,15 +116,19 @@ class AccountMoveLine(models.Model):
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
if (
|
||||
self.mapped('asset_id') and
|
||||
set(vals).intersection(FIELDS_AFFECTS_ASSET_MOVE_LINE) and
|
||||
not (
|
||||
self.env.context.get('allow_asset_removal') and
|
||||
list(vals.keys()) == ['asset_id'])
|
||||
):
|
||||
raise UserError(
|
||||
_("You cannot change an accounting item "
|
||||
"linked to an asset depreciation line."))
|
||||
# Check if at least one asset is linked to a move
|
||||
linked_asset = False
|
||||
for move in self:
|
||||
linked_asset = move.asset_id
|
||||
if linked_asset:
|
||||
raise UserError(
|
||||
_("You cannot change an accounting item "
|
||||
"linked to an asset depreciation line."))
|
||||
if vals.get('asset_id'):
|
||||
raise UserError(
|
||||
_("You are not allowed to link "
|
||||
|
||||
Reference in New Issue
Block a user