From 65b68b7d65e93acd86312154ac56e034332ace61 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 18 Mar 2018 22:17:49 +0100 Subject: [PATCH] Continue to improve usability of account_lock_date_update and account_permanent_lock_move_update --- .../wizards/account_update_lock_date.py | 2 -- .../wizards/account_update_lock_date.xml | 2 +- .../wizard/permanent_lock_date_wizard.py | 5 ++- .../wizard/permanent_lock_date_wizard.xml | 3 +- .../wizards/account_update_lock_date.py | 36 +++++++++---------- .../wizards/account_update_lock_date.xml | 16 ++------- 6 files changed, 27 insertions(+), 37 deletions(-) diff --git a/account_lock_date_update/wizards/account_update_lock_date.py b/account_lock_date_update/wizards/account_update_lock_date.py index 6f5aa9901..f033bce64 100644 --- a/account_lock_date_update/wizards/account_update_lock_date.py +++ b/account_lock_date_update/wizards/account_update_lock_date.py @@ -35,7 +35,6 @@ class AccountUpdateLockDate(models.TransientModel): }) return res - @api.multi def _check_execute_allowed(self): self.ensure_one() has_adviser_group = self.env.user.has_group( @@ -43,7 +42,6 @@ class AccountUpdateLockDate(models.TransientModel): if not (has_adviser_group or self.env.uid == SUPERUSER_ID): raise UserError(_("You are not allowed to execute this action.")) - @api.multi def execute(self): self.ensure_one() self._check_execute_allowed() diff --git a/account_lock_date_update/wizards/account_update_lock_date.xml b/account_lock_date_update/wizards/account_update_lock_date.xml index d434baf6d..0816faece 100644 --- a/account_lock_date_update/wizards/account_update_lock_date.xml +++ b/account_lock_date_update/wizards/account_update_lock_date.xml @@ -9,7 +9,7 @@ account.update.lock_date
- + diff --git a/account_permanent_lock_move/wizard/permanent_lock_date_wizard.py b/account_permanent_lock_move/wizard/permanent_lock_date_wizard.py index 5502a5a7e..cc2ac62ae 100644 --- a/account_permanent_lock_move/wizard/permanent_lock_date_wizard.py +++ b/account_permanent_lock_move/wizard/permanent_lock_date_wizard.py @@ -8,9 +8,12 @@ from odoo.exceptions import UserError class PermanentLockDateWizard(models.TransientModel): _name = 'permanent.lock.date.wizard' - lock_date = fields.Date(string="Lock Date") + lock_date = fields.Date(string="New Lock Date") company_id = fields.Many2one(comodel_name='res.company', string='Company') + current_lock_date = fields.Date( + related='company_id.permanent_lock_date', readonly=True, + string='Current Lock Date') @api.multi def confirm_date(self): diff --git a/account_permanent_lock_move/wizard/permanent_lock_date_wizard.xml b/account_permanent_lock_move/wizard/permanent_lock_date_wizard.xml index 0ffbe0046..b03402569 100644 --- a/account_permanent_lock_move/wizard/permanent_lock_date_wizard.xml +++ b/account_permanent_lock_move/wizard/permanent_lock_date_wizard.xml @@ -5,8 +5,9 @@ form -