mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[MIG] account_check_deposit: Migration to v10
* Add option to have the counter-part of the deposit move directly to the bank account Use account.config.settings page * Remove data that create a bank journal because it blocks the loading of the chart of accounts when the module is installed at the same time as the chart of account (via dependencies)
This commit is contained in:
committed by
ps-tubtim
parent
a108f884fb
commit
8dbff2d03e
@@ -16,32 +16,39 @@ one in EUR and one in USD).
|
||||
Configuration
|
||||
=============
|
||||
|
||||
A journal named *Check Received* is automatically created. It will be available as a payment method in Odoo. On this journal, you must configure the *Default Debit Account* and *Defaut Credit Account* ; this is the account via which the amounts of checks will transit between the reception of a check from a customer and the validation of the check deposit in Odoo.
|
||||
In the menu *Accounting > Configuration > Accounting > Journals*, create a new journal:
|
||||
|
||||
On the company form view, you should configure the *Account for Check Deposits* ; this is the account via which the amounts of checks will transit between the validation of the check deposit in Odoo and the credit on the bank account.
|
||||
* Name: Checks Received
|
||||
* Type: Bank
|
||||
* Short Code: CHK (or any code you want)
|
||||
* Default Debit Account: select an account for checks received
|
||||
* Default Credit Account: idem
|
||||
|
||||
This bank journal will be available as a payment method in Odoo. The account you configured as *Default Debit Account* and *Defaut Credit Account* is the account via which the amounts of checks will transit between the reception of a check from a customer and the validation of the check deposit in Odoo.
|
||||
|
||||
On the Settings page of the Accounting, you should configure the *Check Deposit Offsetting Account*:
|
||||
|
||||
* if you select *Bank Account*, the counter-part of the account move related to the check deposit will be the default debit account of the bank account selected on the check deposit.
|
||||
* if you select *Transfer Account*, you will have to select a specific account that will be used as transfer account for check deposits.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
When you receive a check that pays a customer invoice, you can go to that invoice and click on the button *Register Payment* and select the *Check Received* journal as *Payment Method*.
|
||||
|
||||
When you want to deposit checks to the bank, go to the menu *Accounting > Bank and Cash > Check Deposit*, create a new check deposit and set the journal *Checks Received* and select the bank account on which you want to credit the checks. Then click on *Add an item* to select the checks you want to deposit at the bank. Eventually, validate the deposit and print the report (you probably want to customize this report).
|
||||
When you want to deposit checks to the bank, go to the menu *Accounting > Adviser > Check Deposit*, create a new check deposit and set the journal *Checks Received* and select the bank account on which you want to credit the checks. Then click on *Add an item* to select the checks you want to deposit at the bank. Eventually, validate the deposit and print the report (you probably want to customize this report).
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/92/8.0
|
||||
|
||||
For further information, please visit:
|
||||
|
||||
* https://www.odoo.com/forum/help-1
|
||||
:target: https://runbot.odoo-community.org/runbot/92/10.0
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
|
||||
`here <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_check_deposit%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/OCA/account-financial-tools/issues>`_. In case of trouble, please
|
||||
check there if your issue has already been reported. If you spotted it first,
|
||||
help us smashing it by providing a detailed and welcomed feedback.
|
||||
|
||||
Credits
|
||||
=======
|
||||
@@ -57,9 +64,9 @@ Contributors
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
.. image:: http://odoo-community.org/logo.png
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: http://odoo-community.org
|
||||
:target: https://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
@@ -67,4 +74,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit http://odoo-community.org.
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo
|
||||
# Copyright (C) 2012-2015 Akretion (http://www.akretion.com/)
|
||||
# @author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
# @author: Chafique DELLI <chafique.delli@akretion.com>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# © 2012-2015 Akretion (http://www.akretion.com/)
|
||||
# @author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
# @author: Chafique DELLI <chafique.delli@akretion.com>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
{
|
||||
'name': 'Account Check Deposit',
|
||||
'version': '8.0.0.1.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Manage deposit of checks to the bank',
|
||||
@@ -23,13 +17,12 @@
|
||||
'account_accountant',
|
||||
],
|
||||
'data': [
|
||||
'data/sequence.xml',
|
||||
'views/account_deposit_view.xml',
|
||||
'views/account_move_line_view.xml',
|
||||
'data/account_deposit_sequence.xml',
|
||||
'views/company_view.xml',
|
||||
'views/account_config_settings.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/check_deposit_security.xml',
|
||||
'data/account_data.xml',
|
||||
'report/report.xml',
|
||||
'report/report_checkdeposit.xml',
|
||||
],
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014-2015 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- The user will have to configure manually the default_credit_account_id
|
||||
and default_debit_account_id, we can't do that for him -->
|
||||
<record id="check_received_journal" model="account.journal">
|
||||
<field name="name">Check Received</field>
|
||||
<field name="code">CHK</field>
|
||||
<field name="type">bank</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
account_check_deposit for Odoo
|
||||
Copyright (C) 2012-2015 Akretion (http://www.akretion.com/)
|
||||
@author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="seq_account_check_deposit" model="ir.sequence">
|
||||
<field name="name">Account Check Deposit</field>
|
||||
<field name="code">account.check.deposit</field>
|
||||
<field name="prefix">DEP</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
18
account_check_deposit/data/sequence.xml
Normal file
18
account_check_deposit/data/sequence.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2012-2016 Akretion (http://www.akretion.com/)
|
||||
@author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo noupdate="1">
|
||||
|
||||
<record id="seq_account_check_deposit" model="ir.sequence">
|
||||
<field name="name">Account Check Deposit</field>
|
||||
<field name="code">account.check.deposit</field>
|
||||
<field name="prefix">DEP</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,3 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import company
|
||||
from . import account_config_settings
|
||||
from . import account_deposit
|
||||
|
||||
14
account_check_deposit/models/account_config_settings.py
Normal file
14
account_check_deposit/models/account_config_settings.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountConfigSettings(models.TransientModel):
|
||||
_inherit = 'account.config.settings'
|
||||
|
||||
check_deposit_offsetting_account = fields.Selection(
|
||||
related='company_id.check_deposit_offsetting_account')
|
||||
check_deposit_transfer_account_id = fields.Many2one(
|
||||
related='company_id.check_deposit_transfer_account_id')
|
||||
@@ -1,21 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
###############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo
|
||||
# Copyright (C) 2012-2016 Akretion (http://www.akretion.com/)
|
||||
# @author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
# @author: Chafique DELLI <chafique.delli@akretion.com>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
#
|
||||
# © 2012-2016 Akretion (http://www.akretion.com/)
|
||||
# @author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
# @author: Chafique DELLI <chafique.delli@akretion.com>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
from openerp import models, fields, api, _
|
||||
import openerp.addons.decimal_precision as dp
|
||||
from openerp.exceptions import ValidationError
|
||||
from openerp.exceptions import Warning as UserError
|
||||
from odoo import models, fields, api, _
|
||||
import odoo.addons.decimal_precision as dp
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
|
||||
class AccountCheckDeposit(models.Model):
|
||||
@@ -61,7 +54,8 @@ class AccountCheckDeposit(models.Model):
|
||||
states={'done': [('readonly', '=', True)]},
|
||||
default=fields.Date.context_today)
|
||||
journal_id = fields.Many2one(
|
||||
'account.journal', string='Journal', domain=[('type', '=', 'bank')],
|
||||
'account.journal', string='Journal',
|
||||
domain=[('type', '=', 'bank'), ('bank_account_id', '=', False)],
|
||||
required=True, states={'done': [('readonly', '=', True)]})
|
||||
journal_default_account_id = fields.Many2one(
|
||||
'account.account', related='journal_id.default_debit_account_id',
|
||||
@@ -79,9 +73,10 @@ class AccountCheckDeposit(models.Model):
|
||||
], string='Status', default='draft', readonly=True)
|
||||
move_id = fields.Many2one(
|
||||
'account.move', string='Journal Entry', readonly=True)
|
||||
partner_bank_id = fields.Many2one(
|
||||
'res.partner.bank', string='Bank Account', required=True,
|
||||
domain="[('company_id', '=', company_id)]",
|
||||
bank_journal_id = fields.Many2one(
|
||||
'account.journal', string='Bank Account', required=True,
|
||||
domain="[('company_id', '=', company_id), ('type', '=', 'bank'), "
|
||||
"('bank_account_id', '!=', False)]",
|
||||
states={'done': [('readonly', '=', True)]})
|
||||
line_ids = fields.One2many(
|
||||
'account.move.line', related='move_id.line_ids',
|
||||
@@ -185,11 +180,28 @@ class AccountCheckDeposit(models.Model):
|
||||
@api.model
|
||||
def _prepare_counterpart_move_lines_vals(
|
||||
self, deposit, total_debit, total_amount_currency):
|
||||
company = deposit.company_id
|
||||
if not company.check_deposit_offsetting_account:
|
||||
raise UserError(_(
|
||||
"You must configure the 'Check Deposit Offsetting Account' "
|
||||
"on the Accounting Settings page"))
|
||||
if company.check_deposit_offsetting_account == 'bank_account':
|
||||
if not deposit.bank_journal_id.default_debit_account_id:
|
||||
raise UserError(_(
|
||||
"Missing 'Default Debit Account' on bank journal '%s'")
|
||||
% deposit.bank_journal_id.name)
|
||||
account_id = deposit.bank_journal_id.default_debit_account_id.id
|
||||
elif company.check_deposit_offsetting_account == 'transfer_account':
|
||||
if not company.check_deposit_transfer_account_id:
|
||||
raise UserError(_(
|
||||
"Missing 'Account for Check Deposits' on the "
|
||||
"company '%s'.") % company.name)
|
||||
account_id = company.check_deposit_transfer_account_id.id
|
||||
return {
|
||||
'name': _('Check Deposit %s') % deposit.name,
|
||||
'debit': total_debit,
|
||||
'credit': 0.0,
|
||||
'account_id': deposit.company_id.check_deposit_account_id.id,
|
||||
'account_id': account_id,
|
||||
'partner_id': False,
|
||||
'currency_id': deposit.currency_none_same_company_id.id or False,
|
||||
'amount_currency': total_amount_currency,
|
||||
@@ -215,11 +227,6 @@ class AccountCheckDeposit(models.Model):
|
||||
to_reconcile_lines.append(line + move_line)
|
||||
|
||||
# Create counter-part
|
||||
if not deposit.company_id.check_deposit_account_id:
|
||||
raise UserError(
|
||||
_("Missing Account for Check Deposits on the "
|
||||
"company '%s'.") % deposit.company_id.name)
|
||||
|
||||
counter_vals = self._prepare_counterpart_move_lines_vals(
|
||||
deposit, total_debit, total_amount_currency)
|
||||
counter_vals['move_id'] = move.id
|
||||
@@ -235,12 +242,14 @@ class AccountCheckDeposit(models.Model):
|
||||
@api.onchange('company_id')
|
||||
def onchange_company_id(self):
|
||||
if self.company_id:
|
||||
partner_banks = self.env['res.partner.bank'].search(
|
||||
[('company_id', '=', self.company_id.id)])
|
||||
if len(partner_banks) == 1:
|
||||
self.partner_bank_id = partner_banks[0]
|
||||
bank_journals = self.env['account.journal'].search([
|
||||
('company_id', '=', self.company_id.id),
|
||||
('type', '=', 'bank'),
|
||||
('bank_account_id', '!=', False)])
|
||||
if len(bank_journals) == 1:
|
||||
self.bank_journal_id = bank_journals[0]
|
||||
else:
|
||||
self.partner_bank_id = False
|
||||
self.bank_journal_id = False
|
||||
|
||||
@api.onchange('journal_id')
|
||||
def onchange_journal_id(self):
|
||||
@@ -256,11 +265,3 @@ class AccountMoveLine(models.Model):
|
||||
|
||||
check_deposit_id = fields.Many2one(
|
||||
'account.check.deposit', string='Check Deposit', copy=False)
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
check_deposit_account_id = fields.Many2one(
|
||||
'account.account', string='Account for Check Deposits', copy=False,
|
||||
domain=[('reconcile', '=', True)])
|
||||
|
||||
22
account_check_deposit/models/company.py
Normal file
22
account_check_deposit/models/company.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2012-2016 Akretion (http://www.akretion.com/)
|
||||
# @author: Benoît GUILLOT <benoit.guillot@akretion.com>
|
||||
# @author: Chafique DELLI <chafique.delli@akretion.com>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# @author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
check_deposit_offsetting_account = fields.Selection([
|
||||
('bank_account', 'Bank Account'),
|
||||
('transfer_account', 'Transfer Account'),
|
||||
], string='Check Deposit Offsetting Account', default='bank_account')
|
||||
check_deposit_transfer_account_id = fields.Many2one(
|
||||
'account.account', string='Transfer Account for Check Deposits',
|
||||
ondelete='restrict', copy=False,
|
||||
domain=[('reconcile', '=', True), ('deprecated', '=', False)])
|
||||
@@ -20,15 +20,15 @@
|
||||
<h1>Check Deposit n°<span t-field="o.name"/></h1>
|
||||
|
||||
<h3>Bank:</h3>
|
||||
<p><span t-field="o.partner_bank_id.bank.name"/><br/>
|
||||
<span t-field="o.partner_bank_id.bank.street"/><br/>
|
||||
<span t-field="o.partner_bank_id.bank.zip"/> <span t-field="o.partner_bank_id.bank.city"/></p>
|
||||
<p><span t-field="o.bank_journal_id.bank_account_id.bank_id.name"/><br/>
|
||||
<span t-field="o.bank_journal_id.bank_account_id.bank_id.street"/><br/>
|
||||
<span t-field="o.bank_journal_id.bank_account_id.bank_id.zip"/> <span t-field="o.bank_journal_id.bank_account_id.bank_id.city"/></p>
|
||||
|
||||
<h3>Beneficiary:</h3>
|
||||
<div t-field="o.company_id.partner_id"
|
||||
t-field-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": true}'/>
|
||||
|
||||
<p><b>Bank Account Number to Credit:</b> <span t-field="o.partner_bank_id.acc_number"/></p>
|
||||
<p><b>Bank Account Number to Credit:</b> <span t-field="o.bank_journal_id.bank_account_id.acc_number"/></p>
|
||||
|
||||
<p><b>Check Currency:</b> <span t-field="o.currency_id.name"/></p>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp.addons.account.tests.account_test_classes\
|
||||
from odoo.addons.account.tests.account_test_classes\
|
||||
import AccountingTestCase
|
||||
import time
|
||||
|
||||
@@ -55,12 +55,15 @@ class TestPayment(AccountingTestCase):
|
||||
self.ref('account.data_account_type_revenue')
|
||||
})
|
||||
|
||||
self.recived_check_account_id = self.account_account_model.search(
|
||||
self.received_check_account_id = self.account_account_model.search(
|
||||
[('code', '=', '511200')], limit=1)
|
||||
if not self.recived_check_account_id:
|
||||
self.recived_check_account_id = self.account_account_model.create(
|
||||
if self.received_check_account_id:
|
||||
if not self.received_check_account_id.reconcile:
|
||||
self.received_check_account_id.reconcile = True
|
||||
else:
|
||||
self.received_check_account_id = self.account_account_model.create(
|
||||
{"code": '511200',
|
||||
"name": "Recived check - (test)",
|
||||
"name": "Received check - (test)",
|
||||
"reconcile": True,
|
||||
"user_type_id":
|
||||
self.ref('account.data_account_type_liquidity')
|
||||
@@ -92,11 +95,11 @@ class TestPayment(AccountingTestCase):
|
||||
[('code', '=', 'CHK')], limit=1)
|
||||
if not self.check_journal:
|
||||
self.check_journal = self.journal_model.create(
|
||||
{'name': 'Recived check', 'type': 'bank', 'code': 'CHK'})
|
||||
{'name': 'received check', 'type': 'bank', 'code': 'CHK'})
|
||||
self.check_journal.default_debit_account_id = \
|
||||
self.recived_check_account_id
|
||||
self.received_check_account_id
|
||||
self.check_journal.default_credit_account_id = \
|
||||
self.recived_check_account_id
|
||||
self.received_check_account_id
|
||||
self.bank_journal = self.journal_model.search(
|
||||
[('code', '=', 'BNK1')], limit=1)
|
||||
if not self.bank_journal:
|
||||
@@ -111,6 +114,7 @@ class TestPayment(AccountingTestCase):
|
||||
{"acc_number": 'SI56 1910 0000 0123 438 584',
|
||||
"partner_id": self.main_company.partner_id.id,
|
||||
})
|
||||
self.bank_journal.bank_account_id = self.partner_bank_id.id
|
||||
|
||||
def create_invoice(self, amount=100, type='out_invoice', currency_id=None):
|
||||
""" Returns an open invoice """
|
||||
@@ -132,7 +136,7 @@ class TestPayment(AccountingTestCase):
|
||||
'name': 'something',
|
||||
'account_id': self.account_revenue.id,
|
||||
})
|
||||
invoice.signal_workflow('invoice_open')
|
||||
invoice.action_invoice_open()
|
||||
return invoice
|
||||
|
||||
def create_check_deposit(
|
||||
@@ -140,7 +144,7 @@ class TestPayment(AccountingTestCase):
|
||||
""" Returns an validated check deposit """
|
||||
check_deposit = self.check_deposit_model.create({
|
||||
'journal_id': self.bank_journal.id,
|
||||
'partner_bank_id': self.partner_bank_id.id,
|
||||
'bank_journal_id': self.bank_journal.id,
|
||||
'deposit_date': time.strftime('%Y-%m-%d'),
|
||||
'currency_id': self.currency_eur_id,
|
||||
})
|
||||
@@ -177,11 +181,11 @@ class TestPayment(AccountingTestCase):
|
||||
self.assertEqual(inv_2.state, 'paid')
|
||||
|
||||
check_aml = payment.move_line_ids.filtered(
|
||||
lambda r: r.account_id == self.recived_check_account_id)
|
||||
lambda r: r.account_id == self.received_check_account_id)
|
||||
|
||||
check_deposit = self.create_check_deposit([check_aml])
|
||||
liquidity_aml = check_deposit.move_id.line_ids.filtered(
|
||||
lambda r: r.account_id != self.recived_check_account_id)
|
||||
lambda r: r.account_id != self.received_check_account_id)
|
||||
|
||||
self.assertEqual(check_deposit.total_amount, 300)
|
||||
self.assertEqual(liquidity_aml.debit, 300)
|
||||
|
||||
28
account_check_deposit/views/account_config_settings.xml
Normal file
28
account_check_deposit/views/account_config_settings.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_config_settings" model="ir.ui.view">
|
||||
<field name="name">currency_rate_update.account_config_settings.form</field>
|
||||
<field name="model">account.config.settings</field>
|
||||
<field name="inherit_id" ref="account.view_account_config_settings"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="bank_options" position="inside">
|
||||
<div name="check_deposit_option">
|
||||
<label for="check_deposit_offsetting_account"/>
|
||||
<field name="check_deposit_offsetting_account" class="oe_inline"/>
|
||||
</div>
|
||||
<div name="check_deposit_transfer"
|
||||
attrs="{'invisible': ['|', ('has_chart_of_accounts', '=', False), ('check_deposit_offsetting_account', '!=', 'transfer_account')]}">
|
||||
<label for="check_deposit_transfer_account_id"/>
|
||||
<field name="check_deposit_transfer_account_id" class="oe_inline"
|
||||
context="{'default_reconcile': True}"/>
|
||||
</div>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -39,7 +39,7 @@
|
||||
invisible="1"/>
|
||||
<field name="currency_id"
|
||||
groups="base.group_multi_currency"/>
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="bank_journal_id" widget="selection"/>
|
||||
</group>
|
||||
<group name="right">
|
||||
<field name="company_id"
|
||||
@@ -92,7 +92,7 @@
|
||||
<field name="name"/>
|
||||
<field name="deposit_date"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="bank_journal_id"/>
|
||||
<field name="check_count"/>
|
||||
<field name="total_amount"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2014-2015 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_company_form" model="ir.ui.view">
|
||||
<field name="name">check.deposit.company.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="account_grp" position="inside">
|
||||
<field name="check_deposit_account_id" />
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user