summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorptr-odoo <ptr-odoo@users.noreply.github.com>2017-08-29 16:08:10 +0530
committerLaurent Smet <las@openerp.com>2017-08-29 12:38:10 +0200
commit276f0806381d4e03903521cfa2e4e2ca00c688a6 (patch)
tree260cc501656affac7adade185e51dde3098df066 /addons
parent3267e765209ee7a19b327620622fa1b5126eed00 (diff)
[IMP] account: allow to archive journal, account.tag and analytic.tag
Currently there is no option to Archive / Unarchive Journal + Accounting Tag + Analytic Account Tag task: https://www.odoo.com/web#id=27447&view_type=form&model=project.task&menu_id=4720 PR: #12864
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account.py2
-rw-r--r--addons/account/views/account_view.xml19
-rw-r--r--addons/analytic/models/analytic_account.py1
-rw-r--r--addons/analytic/views/analytic_account_views.xml13
4 files changed, 29 insertions, 6 deletions
diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index b9d5b680820..02188a2ba71 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -35,6 +35,7 @@ class AccountAccountTag(models.Model):
name = fields.Char(required=True)
applicability = fields.Selection([('accounts', 'Accounts'), ('taxes', 'Taxes')], required=True, default='accounts')
color = fields.Integer('Color Index', default=10)
+ active = fields.Boolean(default=True, help="Set active to false to hide the Account Tag without removing it.")
#----------------------------------------------------------
# Accounts
@@ -236,6 +237,7 @@ class AccountJournal(models.Model):
name = fields.Char(string='Journal Name', required=True)
code = fields.Char(string='Short Code', size=5, required=True, help="The journal entries of this journal will be named using this prefix.")
+ active = fields.Boolean(default=True, help="Set active to false to hide the Journal without removing it.")
type = fields.Selection([
('sale', 'Sale'),
('purchase', 'Purchase'),
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml
index 1f78b86b9bd..0d1ee78eb16 100644
--- a/addons/account/views/account_view.xml
+++ b/addons/account/views/account_view.xml
@@ -230,6 +230,7 @@
<field name="arch" type="xml">
<search string="Search Account Journal">
<field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Journal"/>
+ <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<filter domain="[('type', '=', 'sale')]" string="Sales"/>
<filter domain="[('type', '=', 'purchase')]" string="Purchases"/>
<filter domain="['|', ('type', '=', 'cash'), ('type', '=', 'bank')]" string="Liquidity"/>
@@ -245,6 +246,11 @@
<field name="arch" type="xml">
<form string="Account Journal">
<sheet>
+ <div class="oe_button_box" name="button_box">
+ <button class="oe_stat_button" type="object" name="toggle_active" icon="fa-archive">
+ <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
+ </button>
+ </div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" class="oe_inline"/></h1>
@@ -431,9 +437,16 @@
<field name="model">account.account.tag</field>
<field name="arch" type="xml">
<form string="Tags">
- <group>
- <field name="name"/>
- </group>
+ <sheet>
+ <div class="oe_button_box" name="button_box">
+ <button class="oe_stat_button" type="object" name="toggle_active" icon="fa-archive">
+ <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
+ </button>
+ </div>
+ <group>
+ <field name="name"/>
+ </group>
+ </sheet>
</form>
</field>
</record>
diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py
index 916d4878144..a87a948e1fa 100644
--- a/addons/analytic/models/analytic_account.py
+++ b/addons/analytic/models/analytic_account.py
@@ -9,6 +9,7 @@ class AccountAnalyticTag(models.Model):
_description = 'Analytic Tags'
name = fields.Char(string='Analytic Tag', index=True, required=True)
color = fields.Integer('Color Index', default=10)
+ active = fields.Boolean(default=True, help="Set active to false to hide the Analytic Tag without removing it.")
class AccountAnalyticAccount(models.Model):
diff --git a/addons/analytic/views/analytic_account_views.xml b/addons/analytic/views/analytic_account_views.xml
index 566aafbb3af..a0eff16fbfa 100644
--- a/addons/analytic/views/analytic_account_views.xml
+++ b/addons/analytic/views/analytic_account_views.xml
@@ -15,9 +15,16 @@
<field name="model">account.analytic.tag</field>
<field name="arch" type="xml">
<form string="Analytic Accounts Tags">
- <group>
- <field name="name"/>
- </group>
+ <sheet>
+ <div class="oe_button_box" name="button_box">
+ <button class="oe_stat_button" type="object" name="toggle_active" icon="fa-archive">
+ <field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
+ </button>
+ </div>
+ <group>
+ <field name="name"/>
+ </group>
+ </sheet>
</form>
</field>
</record>