mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[12.0][ADD] account_document_reversal
This commit is contained in:
committed by
Jordi Ballester Alomar
parent
3a53ba8f7d
commit
0e44a9de54
28
account_document_reversal/wizard/reverse_account_document.py
Normal file
28
account_document_reversal/wizard/reverse_account_document.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class ReverseAccountDocument(models.TransientModel):
|
||||
"""
|
||||
Document reversal wizard, it cancel by reverse document journal entries
|
||||
"""
|
||||
_name = 'reverse.account.document'
|
||||
_description = 'Account Document Reversal'
|
||||
|
||||
date = fields.Date(
|
||||
string='Reversal date',
|
||||
default=fields.Date.context_today,
|
||||
required=True)
|
||||
journal_id = fields.Many2one(
|
||||
'account.journal',
|
||||
string='Use Specific Journal',
|
||||
help='If empty, uses the journal of the journal entry to be reversed.')
|
||||
|
||||
@api.multi
|
||||
def action_cancel(self):
|
||||
model = self._context.get('active_model')
|
||||
active_ids = self._context.get('active_ids')
|
||||
documents = self.env[model].browse(active_ids)
|
||||
documents.action_document_reversal(self.date, self.journal_id)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
Reference in New Issue
Block a user