mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[14.0][ADD] account_asset_low_value
This commit is contained in:
17
account_asset_low_value/wizard/account_asset_remove.py
Normal file
17
account_asset_low_value/wizard/account_asset_remove.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountAssetRemove(models.TransientModel):
|
||||
_inherit = "account.asset.remove"
|
||||
|
||||
def remove(self):
|
||||
self.ensure_one()
|
||||
asset_id = self.env.context.get("active_id")
|
||||
asset = self.env["account.asset"].browse(asset_id)
|
||||
if asset.low_value:
|
||||
asset.write({"state": "removed", "date_remove": self.date_remove})
|
||||
return True
|
||||
return super().remove()
|
||||
Reference in New Issue
Block a user