From 6080fb6ad1f32adef02935dffd726fd62217ae57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 17 Mar 2010 17:58:32 +0100 Subject: [PATCH] Remove required attributes from view and instead use states for issue1449 --- move.py | 7 +++++-- move.xml | 4 ++-- period.py | 4 +++- period.xml | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/move.py b/move.py index 0b98e50909..23a3f6cd6a 100644 --- a/move.py +++ b/move.py @@ -454,8 +454,11 @@ class Line(ModelSQL, ModelView): select=1, on_change=['account', 'debit', 'credit', 'tax_lines', 'journal', 'move']) - move = fields.Many2One('account.move', 'Move', states=_LINE_STATES, - select=1, required=True) + move = fields.Many2One('account.move', 'Move', select=1, required=True, + states={ + 'required': False, + 'readonly': Equal(Eval('state'), 'valid'), + }) journal = fields.Function(fields.Many2One('account.journal', 'Journal'), 'get_move_field', setter='set_move_field', searcher='search_move_field') diff --git a/move.xml b/move.xml index 8e5a61e055..6ed7a68ea0 100644 --- a/move.xml +++ b/move.xml @@ -220,7 +220,7 @@ this repository contains the full copyright notices and license terms. -->