From 84d8181547f1899ffa546aa36f56bffa5dc8be76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Sep 2008 17:06:30 +0200 Subject: [PATCH] Set xalign to center for O2M and M2M --- tryton/gui/window/view_form/view/list_gtk/parser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tryton/gui/window/view_form/view/list_gtk/parser.py b/tryton/gui/window/view_form/view/list_gtk/parser.py index a5dd7184df..a0f34563c7 100644 --- a/tryton/gui/window/view_form/view/list_gtk/parser.py +++ b/tryton/gui/window/view_form/view/list_gtk/parser.py @@ -510,6 +510,10 @@ class UnsettableColumn(Exception): class O2M(Char): + def setter(self, column, cell, store, iter): + super(O2M, self).setter(column, cell, store, iter) + cell.set_property('xalign', 0.5) + def get_textual_value(self, model): return '( ' + str(len(model[self.field_name].\ get_client(model).models)) + ' )' @@ -533,6 +537,10 @@ class O2M(Char): class M2M(Char): + def setter(self, column, cell, store, iter): + super(M2M, self).setter(column, cell, store, iter) + cell.set_property('xalign', 0.5) + def get_textual_value(self, model): value = model[self.field_name].get_client(model) if value: