Skip to content

Commit

Permalink
[MOV] account: reconciliation widget
Browse files Browse the repository at this point in the history
Task 2034073
The reconciliation widget is now entirely part of the enterprise version
as it is an advanced accounting feature

closes #38424

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
  • Loading branch information
william-andre committed Oct 18, 2019
1 parent 48e563f commit 9ba8734
Show file tree
Hide file tree
Showing 126 changed files with 4 additions and 58,838 deletions.
1 change: 0 additions & 1 deletion addons/account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
'demo/account_demo.xml',
],
'qweb': [
"static/src/xml/account_reconciliation.xml",
"static/src/xml/account_payment.xml",
"static/src/xml/account_report_backend.xml",
"static/src/xml/bills_tree_upload_views.xml",
Expand Down
1 change: 0 additions & 1 deletion addons/account/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from . import company
from . import res_config_settings
from . import account_cash_rounding
from . import reconciliation_widget
from . import account_incoterms
from . import digest
from . import res_users
Expand Down
10 changes: 0 additions & 10 deletions addons/account/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,16 +501,6 @@ def unlink(self):
raise UserError(_('You cannot remove/deactivate an account which is set on a customer or vendor.'))
return super(AccountAccount, self).unlink()

def action_open_reconcile(self):
self.ensure_one()
# Open reconciliation view for this account
action_context = {'show_mode_selector': False, 'mode': 'accounts', 'account_ids': [self.id,]}
return {
'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view',
'context': action_context,
}

def action_read_account(self):
self.ensure_one()
return {
Expand Down
9 changes: 0 additions & 9 deletions addons/account/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,6 @@ def button_open(self):
def button_reopen(self):
self.state = 'open'

def action_bank_reconcile_bank_statements(self):
self.ensure_one()
bank_stmt_lines = self.mapped('line_ids')
return {
'type': 'ir.actions.client',
'tag': 'bank_statement_reconciliation_view',
'context': {'statement_line_ids': bank_stmt_lines.ids, 'company_ids': self.mapped('company_id').ids},
}


class AccountBankStatementLine(models.Model):
_name = "account.bank.statement.line"
Expand Down
34 changes: 0 additions & 34 deletions addons/account/models/account_journal_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,40 +420,6 @@ def create_cash_statement(self):
})
return action

def action_open_reconcile(self):
if self.type in ['bank', 'cash']:
# Open reconciliation view for bank statements belonging to this journal
bank_stmt = self.env['account.bank.statement'].search([('journal_id', 'in', self.ids)]).mapped('line_ids')
return {
'type': 'ir.actions.client',
'tag': 'bank_statement_reconciliation_view',
'context': {'statement_line_ids': bank_stmt.ids, 'company_ids': self.mapped('company_id').ids},
}
else:
# Open reconciliation view for customers/suppliers
action_context = {'show_mode_selector': False, 'company_ids': self.mapped('company_id').ids}
if self.type == 'sale':
action_context.update({'mode': 'customers'})
elif self.type == 'purchase':
action_context.update({'mode': 'suppliers'})
return {
'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view',
'context': action_context,
}

def action_open_to_check(self):
self.ensure_one()
ids = self.to_check_ids().ids
action_context = {'show_mode_selector': False, 'company_ids': self.mapped('company_id').ids}
action_context.update({'suspense_moves_mode': True})
action_context.update({'statement_line_ids': ids})
return {
'type': 'ir.actions.client',
'tag': 'bank_statement_reconciliation_view',
'context': action_context,
}

def to_check_ids(self):
self.ensure_one()
domain = self.env['account.move.line']._get_suspense_moves_domain()
Expand Down
15 changes: 0 additions & 15 deletions addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -2236,21 +2236,6 @@ def action_invoice_paid(self):
''' Hook to be overrided called when the invoice moves to the paid state. '''
pass

def action_open_matching_suspense_moves(self):
self.ensure_one()
domain = self._get_domain_matching_suspense_moves()
ids = self.env['account.move.line'].search(domain).mapped('statement_line_id').ids
action_context = {'show_mode_selector': False, 'company_ids': self.mapped('company_id').ids}
action_context.update({'suspense_moves_mode': True})
action_context.update({'statement_line_ids': ids})
action_context.update({'partner_id': self.partner_id.id})
action_context.update({'partner_name': self.partner_id.name})
return {
'type': 'ir.actions.client',
'tag': 'bank_statement_reconciliation_view',
'context': action_context,
}

def action_invoice_register_payment(self):
return self.env['account.payment']\
.with_context(active_ids=self.ids, active_model='account.move', active_id=self.id)\
Expand Down
22 changes: 0 additions & 22 deletions addons/account/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,28 +340,6 @@ def _get_move_reconciled(self):
break
payment.move_reconciled = rec

def open_payment_matching_screen(self):
# Open reconciliation view for customers/suppliers
move_line_id = False
for move_line in self.move_line_ids:
if move_line.account_id.reconcile:
move_line_id = move_line.id
break
if not self.partner_id:
raise UserError(_("Payments without a customer can't be matched"))
action_context = {'company_ids': [self.company_id.id], 'partner_ids': [self.partner_id.commercial_partner_id.id]}
if self.partner_type == 'customer':
action_context.update({'mode': 'customers'})
elif self.partner_type == 'supplier':
action_context.update({'mode': 'suppliers'})
if move_line_id:
action_context.update({'move_line_id': move_line_id})
return {
'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view',
'context': action_context,
}

@api.depends('invoice_ids', 'payment_type', 'partner_type', 'partner_id')
def _compute_destination_account_id(self):
for payment in self:
Expand Down
Loading

0 comments on commit 9ba8734

Please sign in to comment.