Skip to content

Commit

Permalink
1. Hide tombol load jika sudah diconfirm
Browse files Browse the repository at this point in the history
2. Kosongkan lines apabila ada perubahan pada date_start, date_end, cb_group_id, accounting_category_id
  • Loading branch information
mikevhe18 committed Jan 6, 2025
1 parent 9a4d0ea commit 06236f9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions bssb_core_banking_asset/models/cb_asset_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,15 @@ def action_load_depreciation_line(self):
for document in self:
document._load_depreciation_line()

@api.onchange(
"date_start",
"date_end",
"cb_group_id",
"accounting_category_id",
)
def onchange_depreciation_line_ids(self):
self.depreciation_line_ids.unlink()

@api.multi
def _load_depreciation_line(self):
self.ensure_one()
Expand Down
8 changes: 7 additions & 1 deletion bssb_core_banking_asset/views/cb_asset_batch_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@
<field name="manual_depreciation_amount" />
<field name="final_depreciation_amount" />
</group>
<button name="action_load_depreciation_line" type="object" string="Load" help="Load depreciation line with matching criteria"/>
<button
name="action_load_depreciation_line"
type="object"
string="Load"
help="Load depreciation line with matching criteria"
attrs="{'invisible': [('state', '!=', 'draft')]}"
/>
<field name="depreciation_line_ids">
<tree>
<field name="asset_id"/>
Expand Down

0 comments on commit 06236f9

Please # to comment.