commit
d0f718c83f
@ -59,8 +59,10 @@ class AccountMove(models.Model):
|
|||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if set(vals).intersection(FIELDS_AFFECTS_ASSET_MOVE):
|
if set(vals).intersection(FIELDS_AFFECTS_ASSET_MOVE):
|
||||||
deprs = self.env["account.asset.line"].search(
|
deprs = (
|
||||||
[("move_id", "in", self.ids), ("type", "=", "depreciate")]
|
self.env["account.asset.line"]
|
||||||
|
.sudo()
|
||||||
|
.search([("move_id", "in", self.ids), ("type", "=", "depreciate")])
|
||||||
)
|
)
|
||||||
if deprs:
|
if deprs:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
|
Loading…
Reference in New Issue
Block a user