From a3f64fdab1e95e128a1385d86d3c13e154d57494 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 30 Oct 2021 15:05:14 +0200 Subject: [PATCH] account_asset_management: improve and cleanup views --- .../models/account_asset_line.py | 4 +- .../views/account_asset.xml | 144 +++++++++--------- .../views/account_asset_group.xml | 2 +- .../views/account_asset_profile.xml | 98 +++++++++--- .../views/account_move.xml | 7 +- 5 files changed, 157 insertions(+), 98 deletions(-) diff --git a/account_asset_management/models/account_asset_line.py b/account_asset_management/models/account_asset_line.py index d7a93ad07..1d478482b 100644 --- a/account_asset_management/models/account_asset_line.py +++ b/account_asset_management/models/account_asset_line.py @@ -288,12 +288,12 @@ class AccountAssetLine(models.Model): self.ensure_one() return { "name": _("Journal Entry"), - "view_mode": "tree,form", + "view_mode": "form", + "res_id": self.move_id.id, "res_model": "account.move", "view_id": False, "type": "ir.actions.act_window", "context": self.env.context, - "domain": [("id", "=", self.move_id.id)], } def unlink_move(self): diff --git a/account_asset_management/views/account_asset.xml b/account_asset_management/views/account_asset.xml index a008823cf..243264c28 100644 --- a/account_asset_management/views/account_asset.xml +++ b/account_asset_management/views/account_asset.xml @@ -35,7 +35,13 @@ /> -
+ +
- + + - + - - + @@ -116,16 +122,12 @@ /> - - - + + - - + + - - - - + - - - -
- - - - - - - - - - - + - - - - + + + + +
@@ -312,16 +286,30 @@ - - - - - - - - - - + + + + + + + + + + + + + @@ -334,28 +322,30 @@ string="Draft" name="draft" domain="[('state', '=', 'draft')]" - help="Draft Assets" /> - - + + + + @@ -364,13 +354,31 @@ name="partner_id" filter_domain="[('partner_id', 'child_of', self)]" /> - + + + + @@ -379,8 +387,6 @@ Assets account.asset tree,form - - Journal Items diff --git a/account_asset_management/views/account_asset_group.xml b/account_asset_management/views/account_asset_group.xml index bf7b15f2a..f557df8e0 100644 --- a/account_asset_management/views/account_asset_group.xml +++ b/account_asset_management/views/account_asset_group.xml @@ -27,7 +27,7 @@ - + diff --git a/account_asset_management/views/account_asset_profile.xml b/account_asset_management/views/account_asset_profile.xml index db2b7b373..eef37c3e0 100644 --- a/account_asset_management/views/account_asset_profile.xml +++ b/account_asset_management/views/account_asset_profile.xml @@ -6,17 +6,29 @@ account.asset.profile
+ + +
+
- - + + name="company_id" + widget="selection" + groups="base.group_multi_company" + /> @@ -30,38 +42,43 @@ + name="method_number" + attrs="{'invisible': [('method_time', 'not in', ['number', 'year'])], 'required': [('method_time', 'in', ['number', 'year'])]}" + /> + name="use_leap_years" + attrs="{'invisible': [('days_calc', '=', True)]}" + /> + name="method_progress_factor" + attrs="{'invisible': [('method', 'in', ['linear', 'linear-limit'])], 'required': [('method', 'in', ['degressive', 'degr-linear', 'degr-limit'])]}" + /> + name="prorata" + attrs="{'readonly':[('method_time','!=','year')]}" + /> + groups="analytic.group_analytic_accounting" + string="Analytic Information" + > - + +
@@ -71,9 +88,22 @@ - - - + + + + + + + + + + + + @@ -84,6 +114,24 @@ + + + + + +
diff --git a/account_asset_management/views/account_move.xml b/account_asset_management/views/account_move.xml index b6f0c6c05..0039dae60 100644 --- a/account_asset_management/views/account_move.xml +++ b/account_asset_management/views/account_move.xml @@ -45,8 +45,13 @@ + -