Skip to content

Commit

Permalink
[IMP] account_asset_management: simplify,refactor manual depreciation
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Apr 28, 2024
1 parent 56d31f9 commit 8f89c5a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
8 changes: 0 additions & 8 deletions account_asset_management/models/account_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ class AccountAsset(models.Model):
states=READONLY_STATES,
check_company=True,
)
depreciation_line_manual_ids = fields.One2many(
comodel_name="account.asset.line",
inverse_name="asset_id",
string="Depreciation Lines (manual)",
copy=False,
states=READONLY_STATES,
check_company=True,
)
company_id = fields.Many2one(
comodel_name="res.company",
string="Company",
Expand Down
48 changes: 1 addition & 47 deletions account_asset_management/views/account_asset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@
</div>
<field
name="depreciation_line_ids"
readonly="1"
attrs="{'invisible':[('editable_lines', '=', True)]}"
attrs="{'readonly':[('editable_lines', '=', False)]}"
mode="tree"
options="{'reload_on_button': true}"
>
Expand Down Expand Up @@ -245,51 +244,6 @@
</group>
</form>
</field>
<field
name="depreciation_line_manual_ids"
attrs="{'invisible':[('editable_lines', '!=', True)]}"
can_create="true"
mode="tree"
options="{'reload_on_button': true}"
>
<tree
string="Asset Lines"
decoration-info="(move_check == False) and (init_entry == False)"
editable="bottom"
>
<field name="type" />
<field name="line_date" />
<field name="depreciated_value" readonly="1" />
<field name="amount" />
<field name="remaining_value" readonly="1" />
<field name="init_entry" string="Init" />
<field name="move_check" />
<field name="parent_state" invisible="1" />
<button
name="create_move"
icon="fa-cog"
string="Create Move"
type="object"
attrs="{'invisible': ['|', '|', ('init_entry', '=', True), ('move_check', '!=', False), ('parent_state', '!=', 'open')]}"
/>
<button
name="open_move"
icon="fa-folder-open-o"
string="View Move"
type="object"
attrs="{'invisible': [('move_check', '!=', True)]}"
/>
<button
name="unlink_move"
icon="fa-times"
string="Delete Move"
type="object"
confirm="Are you sure ?"
groups="account.group_account_manager"
attrs="{'invisible': [('move_check', '!=', True)]}"
/>
</tree>
</field>
</page>
<page string="History">
<field name="account_move_line_ids" readonly="1">
Expand Down

0 comments on commit 8f89c5a

Please sign in to comment.