mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
@@ -59,8 +59,10 @@ class AccountMove(models.Model):
|
||||
|
||||
def write(self, vals):
|
||||
if set(vals).intersection(FIELDS_AFFECTS_ASSET_MOVE):
|
||||
deprs = self.env["account.asset.line"].search(
|
||||
[("move_id", "in", self.ids), ("type", "=", "depreciate")]
|
||||
deprs = (
|
||||
self.env["account.asset.line"]
|
||||
.sudo()
|
||||
.search([("move_id", "in", self.ids), ("type", "=", "depreciate")])
|
||||
)
|
||||
if deprs:
|
||||
raise UserError(
|
||||
|
||||
Reference in New Issue
Block a user