[14.0][ADD] account_asset_low_value

This commit is contained in:
Kitti U
2021-09-08 16:06:00 +07:00
committed by Saran440
parent b4ba942f8e
commit c20ad0dc10
17 changed files with 826 additions and 0 deletions

View 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()