diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-08-22 15:08:41 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-08-22 15:08:41 +0700 |
| commit | b18cc1ec5c6ecb7529f0f87d359f4bb09b5a50f8 (patch) | |
| tree | a8b0e1adda757f292bc391958f5fc6918ae940c1 /indoteknik_custom/models | |
| parent | e04b5f23c7ad55353f15699dc1a539506b74d988 (diff) | |
add feature close fixed asset
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/account_asset.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/account_asset.py b/indoteknik_custom/models/account_asset.py new file mode 100644 index 00000000..bd5f9adb --- /dev/null +++ b/indoteknik_custom/models/account_asset.py @@ -0,0 +1,12 @@ +from odoo import fields, models, api, _ +from odoo.exceptions import AccessError, UserError, ValidationError + + +class AccountAsset(models.Model): + _inherit = 'account.asset.asset' + + def action_close_asset(self): + for asset in self: + if asset.value > 0: + raise UserError("Asset masih mempunyai Value") + asset.state = 'close' |
