commit
d0f718c83f
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user