[FIX] various: use existing state values for state-based conditions in views

Various attributes use state field to control display of nodes: like the
'states' (visibility), statusbar_visible (available status in status bar).
In this commit we fix various incorrect state values as those are either
typos, either references to dead or removed status.

An heuristic to detect invalid state for conditions will land soon in master.
As this commit targets a stable version only view fixes are provided.

Task ID-2329114
PR odoo/odoo#56946

X-original-commit: b4e1e9f3ae86e6b5e7015c0241791f733ee942f4
This commit is contained in:
Victor Feyens
2020-09-03 08:45:22 +00:00
committed by Thibault Delavallée
parent 40fb37b943
commit bcedc9f5eb
5 changed files with 5 additions and 5 deletions
@@ -8,7 +8,7 @@
<header>
<button name="contract_open" states="futur" type="object" string="Start Contract" class="oe_highlight" groups="fleet.fleet_group_manager"/>
<button name="contract_close" states="futur" type="object" string="Cancel" groups="fleet.fleet_group_manager"/>
<button name="contract_close" states="open,expired,future" type="object" class="oe_highlight" string="Close Contract" groups="fleet.fleet_group_manager"/>
<button name="contract_close" states="open,expired,futur" type="object" class="oe_highlight" string="Close Contract" groups="fleet.fleet_group_manager"/>
<button name="contract_draft" states="closed" type="object" string="Reset To Draft" groups="fleet.fleet_group_manager"/>
<field name="state" widget="statusbar" />
</header>
+1 -1
View File
@@ -82,7 +82,7 @@
<button name="button_unplan" type="object" string="Unplan" attrs="{'invisible': ['|', '|', ('is_planned', '!=', 'True'), ('date_planned_start', '=', False), ('date_planned_finished', '=', False)]}"/>
<button name="button_unreserve" type="object" string="Unreserve" attrs="{'invisible': [('unreserve_visible', '=', False)]}"/>
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,progress,done"/>
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}" string="Unlock" groups="mrp.group_mrp_manager" type="object" help="Unlock the manufacturing order to adjust what has been consumed or produced."/>
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}" string="Lock" groups="mrp.group_mrp_manager" type="object" help="Lock the manufacturing order to prevent changes to what has been consumed or produced."/>/>
<button name="action_cancel" type="object" string="Cancel"
+1 -1
View File
@@ -23,7 +23,7 @@
<header>
<button name="snailmail_print" string="Send Now" type="object" states="pending,error" class="oe_highlight"/>
<button name="cancel" string="Cancel" type="object" states="pending,error"/>
<field name="state" widget="statusbar" statusbar_visible="pending,sent,cancel"/>
<field name="state" widget="statusbar" statusbar_visible="pending,sent,canceled"/>
</header>
<sheet>
<div class="oe_title">
+1 -1
View File
@@ -253,7 +253,7 @@
<button name="button_scrap" type="object" string="Scrap" attrs="{'invisible': ['|', '&amp;', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&amp;', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}"/>
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('state', 'in', ('draft','cancel')), ('is_locked', '=', False)]}" string="Unlock" groups="stock.group_stock_manager" type="object" help="If the picking is unlocked you can edit initial demand (for a draft picking) or done quantities (for a done picking)."/>
<button name="action_toggle_is_locked" attrs="{'invisible': [('is_locked', '=', True)]}" string="Lock" groups="stock.group_stock_manager" type="object"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done" />
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done" />
<button name="action_cancel" attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'partially_available', 'draft', 'waiting'))]}" string="Cancel" groups="base.group_user" type="object"/>
</header>
<sheet>
@@ -9,7 +9,7 @@
<field name="arch" type="xml">
<xpath expr="//header" position="replace">
<header>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,assigned,done"/>
</header>
</xpath>
</field>