diff options
Diffstat (limited to 'fixco_custom/models/account_move.py')
| -rw-r--r-- | fixco_custom/models/account_move.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index 3f298d2..aa6d474 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -149,8 +149,9 @@ class AccountMove(models.Model): ]) def button_draft(self): - if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]: - raise UserError("Hanya Finance yang bisa ubah Draft") + if not self.env.context.get('active_model') == 'stock.picking': + if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]: + raise UserError("Hanya Finance yang bisa ubah Draft") res = super(AccountMove, self).button_draft() return res @@ -309,8 +310,10 @@ class AccountMove(models.Model): } def action_post(self): - if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 22, 11]: - raise UserError('Hanya Accounting yang bisa Post') + _logger.warning("CTX: %s", self.env.context) + if not self.env.context.get('active_model') == 'stock.picking': + if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 22, 11]: + raise UserError('Hanya Accounting yang bisa Post') for entry in self: |
