account_asset_management: improve and cleanup views
This commit is contained in:
parent
89ea045c31
commit
445dc250be
@ -288,12 +288,12 @@ class AccountAssetLine(models.Model):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return {
|
return {
|
||||||
"name": _("Journal Entry"),
|
"name": _("Journal Entry"),
|
||||||
"view_mode": "tree,form",
|
"view_mode": "form",
|
||||||
|
"res_id": self.move_id.id,
|
||||||
"res_model": "account.move",
|
"res_model": "account.move",
|
||||||
"view_id": False,
|
"view_id": False,
|
||||||
"type": "ir.actions.act_window",
|
"type": "ir.actions.act_window",
|
||||||
"context": self.env.context,
|
"context": self.env.context,
|
||||||
"domain": [("id", "=", self.move_id.id)],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def unlink_move(self):
|
def unlink_move(self):
|
||||||
|
@ -35,7 +35,13 @@
|
|||||||
/>
|
/>
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box">
|
<widget
|
||||||
|
name="web_ribbon"
|
||||||
|
title="Archived"
|
||||||
|
bg_color="bg-danger"
|
||||||
|
attrs="{'invisible': [('active', '=', True)]}"
|
||||||
|
/>
|
||||||
|
<div class="oe_button_box" name="button_box">
|
||||||
<button
|
<button
|
||||||
name="open_entries"
|
name="open_entries"
|
||||||
string="Journal Entries"
|
string="Journal Entries"
|
||||||
@ -50,7 +56,7 @@
|
|||||||
<field name="name" class="oe_inline" />
|
<field name="name" class="oe_inline" />
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<group colspan="4" col="4">
|
<group col="4">
|
||||||
<field name="code" />
|
<field name="code" />
|
||||||
<field
|
<field
|
||||||
name="company_id"
|
name="company_id"
|
||||||
@ -79,10 +85,11 @@
|
|||||||
widget="monetary"
|
widget="monetary"
|
||||||
options="{'currency_field': 'company_currency_id'}"
|
options="{'currency_field': 'company_currency_id'}"
|
||||||
/>
|
/>
|
||||||
|
<field name="active" invisible="1" />
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
<page string="General">
|
<page string="General">
|
||||||
<group colspan="4" col="4">
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field
|
<field
|
||||||
name="purchase_value"
|
name="purchase_value"
|
||||||
@ -105,8 +112,7 @@
|
|||||||
<field name="date_remove" />
|
<field name="date_remove" />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<separator string="Other Information" colspan="4" />
|
<group col="4" string="Other Information">
|
||||||
<group colspan="4" col="4">
|
|
||||||
<field name="profile_id" />
|
<field name="profile_id" />
|
||||||
<field name="group_ids" widget="many2many_tags" />
|
<field name="group_ids" widget="many2many_tags" />
|
||||||
<field name="partner_id" />
|
<field name="partner_id" />
|
||||||
@ -116,16 +122,12 @@
|
|||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="analytic_tag_ids"
|
name="analytic_tag_ids"
|
||||||
groups="analytic.group_analytic_accounting"
|
groups="analytic.group_analytic_tags"
|
||||||
widget="many2many_tags"
|
widget="many2many_tags"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group colspan="4">
|
<group>
|
||||||
<group>
|
<group string="Depreciation Dates">
|
||||||
<separator
|
|
||||||
string="Depreciation Dates"
|
|
||||||
colspan="2"
|
|
||||||
/>
|
|
||||||
<field name="method_time" required="1" />
|
<field name="method_time" required="1" />
|
||||||
<field
|
<field
|
||||||
name="method_number"
|
name="method_number"
|
||||||
@ -142,11 +144,7 @@
|
|||||||
attrs="{'invisible': [('days_calc', '=', True)]}"
|
attrs="{'invisible': [('days_calc', '=', True)]}"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group string="Depreciation Method">
|
||||||
<separator
|
|
||||||
string="Depreciation Method"
|
|
||||||
colspan="2"
|
|
||||||
/>
|
|
||||||
<field name="method" required="1" />
|
<field name="method" required="1" />
|
||||||
<field
|
<field
|
||||||
name="method_progress_factor"
|
name="method_progress_factor"
|
||||||
@ -254,45 +252,21 @@
|
|||||||
<page string="History">
|
<page string="History">
|
||||||
<field name="account_move_line_ids" readonly="1">
|
<field name="account_move_line_ids" readonly="1">
|
||||||
<tree string="Journal Items">
|
<tree string="Journal Items">
|
||||||
|
<field name="date" />
|
||||||
<field name="move_id" />
|
<field name="move_id" />
|
||||||
<field name="journal_id" />
|
<field name="journal_id" optional="show" />
|
||||||
<field name="date" />
|
|
||||||
<field name="ref" />
|
|
||||||
<field name="partner_id" />
|
|
||||||
<field name="account_id" />
|
<field name="account_id" />
|
||||||
<field name="debit" sum="Total Debit" />
|
<field name="partner_id" optional="show" />
|
||||||
<field name="credit" sum="Total Credit" />
|
|
||||||
</tree>
|
|
||||||
<form string="Journal Item">
|
|
||||||
<field
|
|
||||||
name="journal_id"
|
|
||||||
options='{"no_open":True}'
|
|
||||||
/>
|
|
||||||
<field name="move_id" options='{"no_open":True}' />
|
|
||||||
<newline />
|
|
||||||
<field name="name" />
|
|
||||||
<field name="ref" />
|
|
||||||
<newline />
|
|
||||||
<field name="date" />
|
|
||||||
<newline />
|
|
||||||
<field
|
|
||||||
name="partner_id"
|
|
||||||
options='{"no_open":True}'
|
|
||||||
/>
|
|
||||||
<newline />
|
|
||||||
<field
|
|
||||||
name="account_id"
|
|
||||||
options='{"no_open":True}'
|
|
||||||
/>
|
|
||||||
<field
|
<field
|
||||||
name="analytic_account_id"
|
name="analytic_account_id"
|
||||||
groups="analytic.group_analytic_accounting"
|
groups="analytic.group_analytic_accounting"
|
||||||
options='{"no_open": True}'
|
optional="show"
|
||||||
/>
|
/>
|
||||||
<newline />
|
<field name="ref" />
|
||||||
<field name="debit" sum="Total Debit" />
|
<field name="name" optional="hide" />
|
||||||
<field name="credit" sum="Total Credit" />
|
<field name="debit" sum="1" />
|
||||||
</form>
|
<field name="credit" sum="1" />
|
||||||
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page string="Notes">
|
<page string="Notes">
|
||||||
@ -312,16 +286,30 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Assets">
|
<tree string="Assets">
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="code" />
|
<field name="code" optional="show" />
|
||||||
<field name="depreciation_base" />
|
<field name="depreciation_base" optional="show" />
|
||||||
<field name="value_depreciated" />
|
<field name="value_depreciated" optional="show" />
|
||||||
<field name="value_residual" />
|
<field name="value_residual" optional="show" />
|
||||||
<field name="date_start" />
|
<field name="date_start" optional="show" />
|
||||||
<field name="date_remove" />
|
<field name="date_remove" optional="show" />
|
||||||
<field name="profile_id" />
|
<field name="profile_id" optional="show" />
|
||||||
<field name="state" />
|
<field name="account_analytic_id" optional="hide" />
|
||||||
<field name="group_ids" widget="many2many_tags" />
|
<field name="method" optional="hide" />
|
||||||
<field name="company_id" groups="base.group_multi_company" />
|
<field name="prorata" optional="hide" />
|
||||||
|
<field name="group_ids" widget="many2many_tags" optional="hide" />
|
||||||
|
<field
|
||||||
|
name="company_id"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="state"
|
||||||
|
widget="badge"
|
||||||
|
decoration-success="state == 'open'"
|
||||||
|
decoration-warning="state == 'removed'"
|
||||||
|
decoration-info="state == 'draft'"
|
||||||
|
decoration-muted="state == 'close'"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@ -334,28 +322,30 @@
|
|||||||
string="Draft"
|
string="Draft"
|
||||||
name="draft"
|
name="draft"
|
||||||
domain="[('state', '=', 'draft')]"
|
domain="[('state', '=', 'draft')]"
|
||||||
help="Draft Assets"
|
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Running"
|
string="Running"
|
||||||
name="running"
|
name="running"
|
||||||
domain="[('state', '=', 'open')]"
|
domain="[('state', '=', 'open')]"
|
||||||
help="Assets in Running State"
|
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Close"
|
string="Close"
|
||||||
name="close"
|
name="close"
|
||||||
domain="[('state', '=', 'close')]"
|
domain="[('state', '=', 'close')]"
|
||||||
help="Assets in Close State"
|
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Removed"
|
string="Removed"
|
||||||
name="removed"
|
name="removed"
|
||||||
domain="[('state', '=', 'removed')]"
|
domain="[('state', '=', 'removed')]"
|
||||||
help="Assets which have been removed"
|
|
||||||
/>
|
/>
|
||||||
<separator orientation="vertical" />
|
<separator />
|
||||||
<field name="name" string="Asset" />
|
<filter
|
||||||
|
string="Archived"
|
||||||
|
name="inactive"
|
||||||
|
domain="[('active', '=', False)]"
|
||||||
|
/>
|
||||||
|
<separator />
|
||||||
|
<field name="name" />
|
||||||
<field name="code" />
|
<field name="code" />
|
||||||
<field name="date_start" />
|
<field name="date_start" />
|
||||||
<field name="profile_id" />
|
<field name="profile_id" />
|
||||||
@ -364,13 +354,31 @@
|
|||||||
name="partner_id"
|
name="partner_id"
|
||||||
filter_domain="[('partner_id', 'child_of', self)]"
|
filter_domain="[('partner_id', 'child_of', self)]"
|
||||||
/>
|
/>
|
||||||
<group expand="0" string="Group By...">
|
<group name="groupby">
|
||||||
<filter
|
<filter
|
||||||
string="Profile"
|
string="Profile"
|
||||||
name="profile"
|
name="profile"
|
||||||
domain=""
|
domain=""
|
||||||
context="{'group_by': 'profile_id'}"
|
context="{'group_by': 'profile_id'}"
|
||||||
/>
|
/>
|
||||||
|
<filter
|
||||||
|
string="Status"
|
||||||
|
name="state_groupby"
|
||||||
|
domain=""
|
||||||
|
context="{'group_by': 'state'}"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="Analytic account"
|
||||||
|
name="account_analytic_groupby"
|
||||||
|
domain=""
|
||||||
|
context="{'group_by': 'account_analytic_id'}"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="Computation Method"
|
||||||
|
name="method_groupby"
|
||||||
|
domain=""
|
||||||
|
context="{'group_by': 'method'}"
|
||||||
|
/>
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
@ -379,8 +387,6 @@
|
|||||||
<field name="name">Assets</field>
|
<field name="name">Assets</field>
|
||||||
<field name="res_model">account.asset</field>
|
<field name="res_model">account.asset</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="view_id" ref="account_asset_view_tree" />
|
|
||||||
<field name="search_view_id" ref="account_asset_view_search" />
|
|
||||||
</record>
|
</record>
|
||||||
<record id="act_entries_open" model="ir.actions.act_window">
|
<record id="act_entries_open" model="ir.actions.act_window">
|
||||||
<field name="name">Journal Items</field>
|
<field name="name">Journal Items</field>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Asset Group" editable="bottom">
|
<tree string="Asset Group" editable="bottom">
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="code" />
|
<field name="code" optional="show" />
|
||||||
<field name="parent_id" />
|
<field name="parent_id" />
|
||||||
<field name="company_id" groups="base.group_multi_company" />
|
<field name="company_id" groups="base.group_multi_company" />
|
||||||
</tree>
|
</tree>
|
||||||
|
@ -6,17 +6,29 @@
|
|||||||
<field name="model">account.asset.profile</field>
|
<field name="model">account.asset.profile</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Asset profile">
|
<form string="Asset profile">
|
||||||
|
<sheet>
|
||||||
|
<widget
|
||||||
|
name="web_ribbon"
|
||||||
|
title="Archived"
|
||||||
|
bg_color="bg-danger"
|
||||||
|
attrs="{'invisible': [('active', '=', True)]}"
|
||||||
|
/>
|
||||||
|
<div class="oe_title">
|
||||||
|
<label for="name" class="oe_edit_only" />
|
||||||
|
<h1>
|
||||||
|
<field name="name" />
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="name" />
|
|
||||||
<field name="group_ids" widget="many2many_tags" />
|
<field name="group_ids" widget="many2many_tags" />
|
||||||
<field name="asset_product_item" />
|
<field name="asset_product_item" />
|
||||||
<field name="active" />
|
<field name="active" invisible="1" />
|
||||||
<field
|
<field
|
||||||
name="company_id"
|
name="company_id"
|
||||||
widget="selection"
|
widget="selection"
|
||||||
groups="base.group_multi_company"
|
groups="base.group_multi_company"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="journal_id" />
|
<field name="journal_id" />
|
||||||
@ -30,38 +42,43 @@
|
|||||||
<group string="Depreciation Dates">
|
<group string="Depreciation Dates">
|
||||||
<field name="method_time" />
|
<field name="method_time" />
|
||||||
<field
|
<field
|
||||||
name="method_number"
|
name="method_number"
|
||||||
attrs="{'invisible': [('method_time', 'not in', ['number', 'year'])], 'required': [('method_time', 'in', ['number', 'year'])]}"
|
attrs="{'invisible': [('method_time', 'not in', ['number', 'year'])], 'required': [('method_time', 'in', ['number', 'year'])]}"
|
||||||
/>
|
/>
|
||||||
<field name="method_period" />
|
<field name="method_period" />
|
||||||
<field name="days_calc" />
|
<field name="days_calc" />
|
||||||
<field
|
<field
|
||||||
name="use_leap_years"
|
name="use_leap_years"
|
||||||
attrs="{'invisible': [('days_calc', '=', True)]}"
|
attrs="{'invisible': [('days_calc', '=', True)]}"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<group string="Depreciation Method">
|
<group string="Depreciation Method">
|
||||||
<field name="method" />
|
<field name="method" />
|
||||||
<field
|
<field
|
||||||
name="method_progress_factor"
|
name="method_progress_factor"
|
||||||
attrs="{'invisible': [('method', 'in', ['linear', 'linear-limit'])], 'required': [('method', 'in', ['degressive', 'degr-linear', 'degr-limit'])]}"
|
attrs="{'invisible': [('method', 'in', ['linear', 'linear-limit'])], 'required': [('method', 'in', ['degressive', 'degr-linear', 'degr-limit'])]}"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="prorata"
|
name="prorata"
|
||||||
attrs="{'readonly':[('method_time','!=','year')]}"
|
attrs="{'readonly':[('method_time','!=','year')]}"
|
||||||
/>
|
/>
|
||||||
<field name="open_asset" />
|
<field name="open_asset" />
|
||||||
</group>
|
</group>
|
||||||
<group
|
<group
|
||||||
groups="analytic.group_analytic_accounting"
|
groups="analytic.group_analytic_accounting"
|
||||||
string="Analytic Information"
|
string="Analytic Information"
|
||||||
>
|
>
|
||||||
<field name="account_analytic_id" />
|
<field name="account_analytic_id" />
|
||||||
<field name="analytic_tag_ids" widget="many2many_tags" />
|
<field
|
||||||
|
name="analytic_tag_ids"
|
||||||
|
widget="many2many_tags"
|
||||||
|
groups="analytic.group_analytic_tags"
|
||||||
|
/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<separator string="Notes" />
|
<separator string="Notes" />
|
||||||
<field name="note" />
|
<field name="note" />
|
||||||
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@ -71,9 +88,22 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Asset profile">
|
<tree string="Asset profile">
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="journal_id" />
|
<field name="method_number" optional="hide" />
|
||||||
<field name="method" />
|
<field name="method_period" optional="hide" />
|
||||||
<field name="company_id" groups="base.group_multi_company" />
|
<field name="journal_id" optional="show" />
|
||||||
|
<field name="account_asset_id" optional="hide" />
|
||||||
|
<field name="account_depreciation_id" optional="hide" />
|
||||||
|
<field name="account_expense_depreciation_id" optional="hide" />
|
||||||
|
<field name="account_plus_value_id" optional="hide" />
|
||||||
|
<field name="account_min_value_id" optional="hide" />
|
||||||
|
<field name="account_analytic_id" optional="hide" />
|
||||||
|
<field name="method" optional="show" />
|
||||||
|
<field name="prorata" optional="hide" />
|
||||||
|
<field
|
||||||
|
name="company_id"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@ -84,6 +114,24 @@
|
|||||||
<search string="Search Asset Profile">
|
<search string="Search Asset Profile">
|
||||||
<field name="name" string="Asset Profile" />
|
<field name="name" string="Asset Profile" />
|
||||||
<field name="journal_id" />
|
<field name="journal_id" />
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="Archived"
|
||||||
|
name="inactive"
|
||||||
|
domain="[('active', '=', False)]"
|
||||||
|
/>
|
||||||
|
<group name="groupby">
|
||||||
|
<filter
|
||||||
|
name="account_analytic_groupby"
|
||||||
|
string="account_analytic_id"
|
||||||
|
context="{'group_by': 'account_analytic_id'}"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
name="method_groupby"
|
||||||
|
string="Computation Method"
|
||||||
|
context="{'group_by': 'method'}"
|
||||||
|
/>
|
||||||
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
@ -45,8 +45,13 @@
|
|||||||
<field
|
<field
|
||||||
name="asset_profile_id"
|
name="asset_profile_id"
|
||||||
domain="[('company_id','=', parent.company_id)]"
|
domain="[('company_id','=', parent.company_id)]"
|
||||||
|
optional="hide"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="asset_id"
|
||||||
|
groups="account.group_account_manager"
|
||||||
|
optional="show"
|
||||||
/>
|
/>
|
||||||
<field name="asset_id" groups="account.group_account_manager" />
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
Loading…
Reference in New Issue
Block a user