diff --git a/CHANGELOG b/CHANGELOG index 142895addb..db94a58be5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Remove ir.action.wizard_size * Rename expand and fill attributes into yexpand and yfill * Add xalign and yalign as field attributes * Drop support of Python 2.5 diff --git a/trytond/ir/action.py b/trytond/ir/action.py index cbd5cbd750..8be92988f6 100644 --- a/trytond/ir/action.py +++ b/trytond/ir/action.py @@ -663,89 +663,6 @@ class ActionWizard(ModelSQL, ModelView): ActionWizard() -class ActionWizardSize(ModelSQL, ModelView): - "Action Wizard Size" - _name = 'ir.action.wizard_size' - _description = __doc__ - wizard = fields.Char('Wizard', required=True, select=1) - model = fields.Char('Model', required=True, select=1) - user = fields.Many2One('res.user', 'User', required=True, - ondelete='CASCADE', select=1) - width = fields.Integer('Width') - height = fields.Integer('Height') - - def __init__(self): - super(ActionWizardSize, self).__init__() - self._rpc.update({ - 'set_size': True, - }) - - def create(self, vals): - res = super(ActionWizardSize, self).create(vals) - # Restart the cache for get_size - self.get_size.reset() - return res - - def write(self, ids, vals): - res = super(ActionWizardSize, self).write(ids, vals) - # Restart the cache for get_size - self.get_size.reset() - return res - - def delete(self, ids): - res = super(ActionWizardSize, self).delete(ids) - # Restart the cache for get_size - self.get_size.reset() - return res - - def set_size(self, wizard, model, width, height): - ''' - Set size for wizard dialog. - :param wizard: the wizard name - :param model: the model name - :param width: the width - :param height: the height - ''' - ids = self.search([ - ('user', '=', Transaction().user), - ('wizard', '=', wizard), - ('model', '=', model), - ]) - if ids: - self.write(ids, { - 'width': width, - 'height': height, - }) - else: - self.create({ - 'wizard': wizard, - 'model': model, - 'user': Transaction().user, - 'width': width, - 'height': height, - }) - - @Cache('ir.action.wizard_size.get_size') - def get_size(self, wizard, model): - ''' - Get size for wizard dialog. - :param wizard: the wizard name - :param model: the model name - :return: (width, height) - ''' - ids = self.search([ - ('user', '=', Transaction().user), - ('wizard', '=', wizard), - ('model', '=', model), - ], limit=1) - if ids: - wizard_size = self.browse(ids[0]) - return wizard_size.width, wizard_size.height - return (0, 0) - -ActionWizardSize() - - class ActionURL(ModelSQL, ModelView): "Action URL" _name = 'ir.action.url' diff --git a/trytond/ir/action.xml b/trytond/ir/action.xml index 0fd88dbc8c..08a28fbad6 100644 --- a/trytond/ir/action.xml +++ b/trytond/ir/action.xml @@ -331,63 +331,6 @@ this repository contains the full copyright notices and license terms. --> - - ir.action.wizard_size - form - - - - - - ir.action.wizard_size - tree - - - - - - - - - ]]> - - - - Wizard Sizes - ir.action.act_window - ir.action.wizard_size - - - - - - - - - - - - - ir.action.url form diff --git a/trytond/res/ir.xml b/trytond/res/ir.xml index c7e2d0c63e..5b61b063b9 100644 --- a/trytond/res/ir.xml +++ b/trytond/res/ir.xml @@ -486,10 +486,6 @@ this repository contains the full copyright notices and license terms. --> - - - - diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index 320571c638..9fbb1a8e40 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -103,7 +103,6 @@ class Wizard(WarningErrorMixin, URLMixin): def execute(self, wiz_id, data, state='init'): pool = Pool() translation_obj = pool.get('ir.translation') - wizard_size_obj = pool.get('ir.action.wizard_size') res = {} if self._datas.get(wiz_id, {}).get('user') != Transaction().user: @@ -159,8 +158,6 @@ class Wizard(WarningErrorMixin, URLMixin): res['fields'] = fields res['arch'] = arch res['state'] = button_list - res['size'] = wizard_size_obj.get_size(self._name, - result_def['object']) elif result_def['type'] == 'choice': next_state = getattr(self, result_def['next_state'])(data) if next_state == 'end':