Add support for multi-currency

Works with a single account journal
Usability and many other enhancements
This commit is contained in:
Alexis de Lattre
2014-10-08 13:47:28 +02:00
committed by ps-tubtim
parent 7820f8029d
commit 58291eac65
14 changed files with 517 additions and 662 deletions

View File

@@ -1,23 +1,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################### ###############################################################################
# # #
# account_check_deposit for OpenERP # # account_check_deposit for Odoo/OpenERP
# Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> # # Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
# # #
# This program is free software: you can redistribute it and/or modify # # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # # published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version. # # License, or (at your option) any later version.
# # #
# This program is distributed in the hope that it will be useful, # # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details. # # GNU Affero General Public License for more details.
# # #
# You should have received a copy of the GNU Affero General Public License # # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # # along with this program. If not, see <http://www.gnu.org/licenses/>.
# # #
############################################################################### ###############################################################################
import account_deposit from . import account_deposit

View File

@@ -1,35 +1,45 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################### ###############################################################################
# # #
# account_check_deposit for OpenERP # # account_check_deposit for Odoo/OpenERP
# Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> # # Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
# Copyright (C) 2013 Akretion Chafique DELLI <chafique.delli@akretion.com> # # @author: Benoît GUILLOT <benoit.guillot@akretion.com>
# # # @author: Chafique DELLI <chafique.delli@akretion.com>
# This program is free software: you can redistribute it and/or modify # # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# it under the terms of the GNU Affero General Public License as # #
# published by the Free Software Foundation, either version 3 of the # # This program is free software: you can redistribute it and/or modify
# License, or (at your option) any later version. # # it under the terms of the GNU Affero General Public License as
# # # published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful, # # License, or (at your option) any later version.
# but WITHOUT ANY WARRANTY; without even the implied warranty of # #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # This program is distributed in the hope that it will be useful,
# GNU Affero General Public License for more details. # # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# You should have received a copy of the GNU Affero General Public License # # GNU Affero General Public License for more details.
# along with this program. If not, see <http://www.gnu.org/licenses/>. # #
# # # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
############################################################################### ###############################################################################
{ {
'name': 'account_check_deposit', 'name': 'Account Check Deposit',
'version': '0.1', 'version': '0.1',
'category': 'Generic Modules/Others', 'category': 'Accounting & Finance',
'license': 'AGPL-3', 'license': 'AGPL-3',
'description': """This module allows you to use check deposits. 'summary': 'Manage deposit of checks to the bank',
With a new model : account_check_deposit you can select all 'description': """
the checks payments and create a global deposit for the selected checks. Account Check Deposit
You may have to create an account for "received checks" and a =====================
journal for payment by checks.""", This module allows you to easily manage check deposits : you can select all
the checks you received as payments and create a global deposit for the
selected checks.
A journal for received checks is automatically created.
You must configure on this journal the default debit account and the default
credit account. You must also configure on the company the account for
check deposits.
""",
'author': 'Akretion', 'author': 'Akretion',
'website': 'http://www.akretion.com/', 'website': 'http://www.akretion.com/',
'depends': [ 'depends': [
@@ -37,12 +47,13 @@
'report_webkit', 'report_webkit',
], ],
'data': [ 'data': [
'account_deposit_view.xml', 'account_deposit_view.xml',
'account_deposit_sequence.xml', 'account_deposit_sequence.xml',
'account_type_data.xml', 'company_view.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'security/check_deposit_security.xml',
'account_data.xml',
], ],
'installable': True, 'installable': True,
'application': True, 'application': True,
'active': False,
} }

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
account_check_deposit for Odoo/OpenERP
Copyright (C) 2014 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">
<record id="check_received_journal_seq" model="ir.sequence">
<field name="name">Journal Check Received</field>
<field name="prefix">CHK/</field>
<field name="padding">6</field>
<field name="company_id" ref="base.main_company"/>
</record>
<!-- 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="sequence_id" ref="check_received_journal_seq"/>
<field name="company_id" ref="base.main_company"/>
</record>
</data>
</openerp>

View File

@@ -1,236 +1,321 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################### ###############################################################################
# # #
# account_check_deposit for OpenERP # # account_check_deposit for Odoo/OpenERP
# Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> # # Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
# Copyright (C) 2013 Akretion Chafique DELLI <chafique.delli@akretion.com> # # @author: Benoît GUILLOT <benoit.guillot@akretion.com>
# # # @author: Chafique DELLI <chafique.delli@akretion.com>
# This program is free software: you can redistribute it and/or modify # # @author: Alexis de Lattre <alexis.delattre@akretion.com>
# it under the terms of the GNU Affero General Public License as # #
# published by the Free Software Foundation, either version 3 of the # # This program is free software: you can redistribute it and/or modify
# License, or (at your option) any later version. # # it under the terms of the GNU Affero General Public License as
# # # published by the Free Software Foundation, either version 3 of the
# This program is distributed in the hope that it will be useful, # # License, or (at your option) any later version.
# but WITHOUT ANY WARRANTY; without even the implied warranty of # #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # This program is distributed in the hope that it will be useful,
# GNU Affero General Public License for more details. # # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# You should have received a copy of the GNU Affero General Public License # # GNU Affero General Public License for more details.
# along with this program. If not, see <http://www.gnu.org/licenses/>. # #
# # # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
############################################################################### ###############################################################################
from openerp.osv import fields, osv, orm from openerp.osv import fields, orm
from openerp.tools.translate import _ from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp
class account_check_deposit(orm.Model): class account_check_deposit(orm.Model):
_name = "account.check.deposit" _name = "account.check.deposit"
_description = "Account Check Deposit" _description = "Account Check Deposit"
_order = 'deposit_date desc'
def sum_amount(self, cr, uid, ids, name, args, context=None): def _compute_check_deposit(self, cr, uid, ids, name, args, context=None):
res = {} res = {}
for deposit in self.browse(cr, uid, ids, context=context): for deposit in self.browse(cr, uid, ids, context=context):
total = 0 total = 0.0
count = 0
reconcile = False
currency_none_same_company_id = False
if deposit.company_id.currency_id != deposit.currency_id:
currency_none_same_company_id = deposit.currency_id.id
for line in deposit.check_payment_ids: for line in deposit.check_payment_ids:
total += line.debit count += 1
res[deposit.id] = total if currency_none_same_company_id:
return res total += line.amount_currency
else:
def _is_reconcile(self, cr, uid, ids, name, args, context=None): total += line.debit
res = {}
for deposit in self.browse(cr, uid, ids, context=context):
res[deposit.id] = False
if deposit.move_id: if deposit.move_id:
for line in deposit.move_id.line_id: for line in deposit.move_id.line_id:
if line.debit > 0 and line.reconcile_id: if line.debit > 0 and line.reconcile_id:
res[deposit.id] = True reconcile = True
res[deposit.id] = {
'total_amount': total,
'is_reconcile': reconcile,
'currency_none_same_company_id': currency_none_same_company_id,
'check_count': count,
}
return res return res
_columns = { _columns = {
'name': fields.char( 'name': fields.char(
'Name', 'Name', size=64, readonly=True),
size=64,
required=True,
readonly=True,
states={'draft': [('readonly', '=', False)]}),
'check_payment_ids': fields.one2many( 'check_payment_ids': fields.one2many(
'account.move.line', 'account.move.line', 'check_deposit_id', 'Check Payments',
'check_deposit_id', states={'done': [('readonly', '=', True)]}),
'Check Payments',
readonly=True,
states={'draft': [('readonly', '=', False)]}),
'deposit_date': fields.date( 'deposit_date': fields.date(
'Deposit Date', 'Deposit Date', required=True,
readonly=True, states={'done': [('readonly', '=', True)]}),
states={'draft': [('readonly', '=', False)]}),
'journal_id': fields.many2one( 'journal_id': fields.many2one(
'account.journal', 'account.journal', 'Journal', domain=[('type', '=', 'bank')],
'Journal', required=True, states={'done': [('readonly', '=', True)]}),
required=True, 'journal_default_account_id': fields.related(
readonly=True, 'journal_id', 'default_debit_account_id', type='many2one',
states={'draft': [('readonly', '=', False)]}), relation='account.account',
string='Default Debit Account of the Journal'),
'currency_id': fields.many2one(
'res.currency', 'Currency', required=True,
states={'done': [('readonly', '=', True)]}),
'currency_none_same_company_id': fields.function(
_compute_check_deposit, type='many2one',
relation='res.currency', multi='deposit',
string='Currency (False if same as company)'),
'state': fields.selection([ 'state': fields.selection([
('draft', 'Draft'), ('draft', 'Draft'),
('done', 'Done'), ('done', 'Done'),
], 'Status', ], 'Status', readonly=True),
readonly=True),
'move_id': fields.many2one( 'move_id': fields.many2one(
'account.move', 'account.move', 'Journal Entry', readonly=True),
'Journal Entry', 'partner_bank_id': fields.many2one(
readonly=True, 'res.partner.bank', 'Bank Account', required=True,
states={'draft': [('readonly', '=', False)]}), domain="[('company_id', '=', company_id)]",
'bank_id': fields.many2one( states={'done': [('readonly', '=', True)]}),
'res.partner.bank',
'Bank',
required=True,
readonly=True,
domain="[('partner_id', '=', partner_id)]",
states={'draft': [('readonly', '=', False)]}),
'line_ids': fields.related( 'line_ids': fields.related(
'move_id', 'move_id', 'line_id', relation='account.move.line',
'line_id', type='one2many', string='Lines', readonly=True),
relation='account.move.line',
type='one2many',
string='Lines',
readonly=True),
'partner_id': fields.related(
'company_id',
'partner_id',
type="many2one",
relation="res.partner",
string="Partner",
readonly=True),
'company_id': fields.many2one( 'company_id': fields.many2one(
'res.company', 'res.company', 'Company', required=True,
'Company',
required=True,
change_default=True, change_default=True,
readonly=True, states={'done': [('readonly', '=', True)]}),
states={'draft': [('readonly', '=', False)]}),
'total_amount': fields.function( 'total_amount': fields.function(
sum_amount, _compute_check_deposit, multi='deposit',
string="total amount", string="Total Amount", readonly=True,
type="float"), type="float", digits_compute=dp.get_precision('Account')),
'check_count': fields.function(
_compute_check_deposit, multi='deposit', readonly=True,
string="Number of Checks", type="integer"),
'is_reconcile': fields.function( 'is_reconcile': fields.function(
_is_reconcile, _compute_check_deposit, multi='deposit', readonly=True,
string="Reconcile", string="Reconcile", type="boolean"),
type="boolean"),
} }
_defaults = { _defaults = {
'name': lambda self, cr, uid, context: '/', 'name': '/',
'deposit_date': fields.date.context_today, 'deposit_date': fields.date.context_today,
'state': 'draft', 'state': 'draft',
'company_id': lambda self, cr, uid, c: self.pool.get('res.company').\ 'company_id': lambda self, cr, uid, c: self.pool['res.company'].
_company_default_get(cr, uid, 'account.check.deposit', context=c), _company_default_get(cr, uid, 'account.check.deposit', context=c),
} }
def _check_deposit(self, cr, uid, ids):
for deposit in self.browse(cr, uid, ids):
deposit_currency = deposit.currency_id
if deposit_currency == deposit.company_id.currency_id:
for line in deposit.check_payment_ids:
if line.currency_id:
raise orm.except_orm(
_('Error:'),
_("The check with amount %s and reference '%s' "
"is in currency %s but the deposit is in "
"currency %s.") % (
line.debit, line.ref or '',
line.currency_id.name,
deposit_currency.name))
else:
for line in deposit.check_payment_ids:
if line.currency_id != deposit_currency:
raise orm.except_orm(
_('Error:'),
_("The check with amount %s and reference '%s' "
"is in currency %s but the deposit is in "
"currency %s.") % (
line.debit, line.ref or '',
line.currency_id.name,
deposit_currency.name))
return True
_constraints = [(
_check_deposit,
"All the checks of the deposit must be in the currency of the deposit",
['currency_id', 'check_payment_ids', 'company_id']
)]
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
for deposit in self.browse(cr, uid, ids, context=context): for deposit in self.browse(cr, uid, ids, context=context):
if deposit.state == 'done': if deposit.state == 'done':
raise osv.except_osv(_('User Error!'), raise orm.except_orm(
_('You cannot delete a validad deposit, cancel it before'))
return super(account_check_deposit, self).unlink(cr, uid, ids, context=context)
def cancel(self, cr, uid, ids, context=None):
for deposit in self.browse(cr, uid, ids, context=context):
if not deposit.journal_id.update_posted:
raise osv.except_osv(
_('Error!'), _('Error!'),
_('You cannot modify a posted entry of this journal.\n' _("The deposit '%s' is in valid state, so you must "
'First you should set the journal to allow cancelling ' "cancel it before deleting it.")
'entries.')) % deposit.name)
for line in deposit.check_payment_ids: return super(account_check_deposit, self).unlink(
if line.reconcile_id: cr, uid, ids, context=context)
line.reconcile_id.unlink()
def backtodraft(self, cr, uid, ids, context=None):
for deposit in self.browse(cr, uid, ids, context=context):
if deposit.move_id: if deposit.move_id:
# It will raise here if journal_id.update_posted = False
deposit.move_id.button_cancel() deposit.move_id.button_cancel()
for line in deposit.check_payment_ids:
if line.reconcile_id:
line.reconcile_id.unlink()
deposit.move_id.unlink() deposit.move_id.unlink()
deposit.write({'state': 'draft'}) deposit.write({'state': 'draft'})
return True return True
def create(self, cr, uid, vals, context=None): def create(self, cr, uid, vals, context=None):
if vals.get('name', '/') == '/': if vals.get('name', '/') == '/':
vals['name'] = self.pool.get('ir.sequence').\ vals['name'] = self.pool['ir.sequence'].\
get(cr, uid, 'account.check.deposit') next_by_code(cr, uid, 'account.check.deposit')
return super(account_check_deposit, self).\ return super(account_check_deposit, self).\
create(cr, uid, vals, context=context) create(cr, uid, vals, context=context)
def _prepare_account_move_vals(self, cr, uid, deposit, context=None): def _prepare_account_move_vals(self, cr, uid, deposit, context=None):
date = deposit.deposit_date date = deposit.deposit_date
period_obj = self.pool['account.period']
period_ids = period_obj.find(cr, uid, dt=date, context=context)
# period_ids will always have a value, cf the code of find()
move_vals = { move_vals = {
'journal_id': deposit.journal_id.id, 'journal_id': deposit.journal_id.id,
'date': date, 'date': date,
'period_id': period_ids[0],
'name': _('Check Deposit %s') % deposit.name,
'ref': deposit.name,
} }
period_obj = self.pool['account.period']
period_ids = period_obj.find(cr, uid, dt=date, context=context)
if period_ids:
move_vals['period_id'] = period_ids[0]
sum_move_line = self._prepare_sum_move_line_vals(
cr, uid, deposit, move_vals, context=context)
move_lines = [[0, 0, sum_move_line]]
for line in deposit.check_payment_ids:
move_line = self._prepare_move_line_vals(
cr, uid, line, move_vals, context=context)
move_lines.append([0, 0, move_line])
move_vals.update({'line_id': move_lines})
return move_vals return move_vals
def _prepare_move_line_vals(self, cr, uid, line, move_vals, context=None): def _prepare_move_line_vals(
self, cr, uid, line, context=None):
assert (line.debit > 0), 'Debit must have a value'
return { return {
'name': line.ref, 'name': _('Check Deposit - Ref. Check %s') % line.ref,
'credit': line.debit, 'credit': line.debit,
'debit': 0.0,
'account_id': line.account_id.id, 'account_id': line.account_id.id,
'partner_id': line.partner_id.id, 'partner_id': line.partner_id.id,
'check_line_id': line.id, 'currency_id': line.currency_id.id or False,
} 'amount_currency': line.amount_currency * -1,
}
def _prepare_sum_move_line_vals(self, cr, uid, deposit, move_vals, context=None): def _prepare_counterpart_move_lines_vals(
debit = 0.0 self, cr, uid, deposit, total_debit, total_amount_currency,
for line in deposit.check_payment_ids: context=None):
debit += line.debit
return { return {
'name': deposit.name, 'name': _('Check Deposit %s') % deposit.name,
'debit': debit, 'debit': total_debit,
'ref': deposit.name, 'credit': 0.0,
} 'account_id': deposit.company_id.check_deposit_account_id.id,
'partner_id': False,
def _reconcile_checks(self, cr, uid, move_id, context=None): 'currency_id': deposit.currency_none_same_company_id.id or False,
move_line_obj = self.pool['account.move.line'] 'amount_currency': total_amount_currency,
move_obj = self.pool['account.move'] }
move = move_obj.browse(cr, uid, move_id, context=context)
for line in move.line_id:
if line.check_line_id:
move_line_obj.reconcile(cr, uid, [
line.id,
line.check_line_id.id,
], context=context)
return True
def onchange_company_id(self, cr, uid, ids, company_id, context=None):
vals = {}
if company_id:
company = self.pool.get('res.company').\
browse(cr, uid, company_id, context=context)
vals['partner_id'] = company.partner_id.id
return {'value': vals}
def validate_deposit(self, cr, uid, ids, context=None): def validate_deposit(self, cr, uid, ids, context=None):
move_obj = self.pool.get('account.move') am_obj = self.pool['account.move']
aml_obj = self.pool['account.move.line']
if context is None: if context is None:
context = {} context = {}
for deposit in self.browse(cr, uid, ids, context=context): for deposit in self.browse(cr, uid, ids, context=context):
context['journal_id'] = deposit.journal_id.id move_vals = self._prepare_account_move_vals(
move_vals = self._prepare_account_move_vals(cr, uid, deposit, context=context) cr, uid, deposit, context=context)
move_id = move_obj.create(cr, uid, move_vals, context=context) context['journal_id'] = move_vals['journal_id']
move_obj.post(cr, uid, [move_id], context=context) context['period_id'] = move_vals['period_id']
self._reconcile_checks(cr, uid, move_id, context=context) move_id = am_obj.create(cr, uid, move_vals, context=context)
total_debit = 0.0
total_amount_currency = 0.0
to_reconcile_line_ids = []
for line in deposit.check_payment_ids:
total_debit += line.debit
total_amount_currency += line.amount_currency
line_vals = self._prepare_move_line_vals(
cr, uid, line, context=context)
line_vals['move_id'] = move_id
move_line_id = aml_obj.create(
cr, uid, line_vals, context=context)
to_reconcile_line_ids.append([line.id, move_line_id])
# Create counter-part
if not deposit.company_id.check_deposit_account_id:
raise orm.except_orm(
_('Configuration Error:'),
_("Missing Account for Check Deposits on the "
"company '%s'.") % deposit.company_id.name)
counter_vals = self._prepare_counterpart_move_lines_vals(
cr, uid, deposit, total_debit, total_amount_currency,
context=context)
counter_vals['move_id'] = move_id
aml_obj.create(cr, uid, counter_vals, context=context)
am_obj.post(cr, uid, [move_id], context=context)
deposit.write({'state': 'done', 'move_id': move_id}) deposit.write({'state': 'done', 'move_id': move_id})
# We have to reconcile after post()
for reconcile_line_ids in to_reconcile_line_ids:
aml_obj.reconcile(
cr, uid, reconcile_line_ids, context=context)
return True return True
def onchange_company_id(
self, cr, uid, ids, company_id, currency_id, context=None):
vals = {}
if company_id:
company = self.pool['res.company'].browse(
cr, uid, company_id, context=context)
if currency_id:
if company.currency_id.id == currency_id:
vals['currency_none_same_company_id'] = False
else:
vals['currency_none_same_company_id'] = currency_id
partner_bank_ids = self.pool['res.partner.bank'].search(
cr, uid, [('company_id', '=', company_id)], context=context)
if len(partner_bank_ids) == 1:
vals['partner_bank_id'] = partner_bank_ids[0]
else:
vals['currency_none_same_company_id'] = False
vals['partner_bank_id'] = False
return {'value': vals}
def onchange_journal_id(self, cr, uid, ids, journal_id, context=None):
vals = {}
if journal_id:
journal = self.pool['account.journal'].browse(
cr, uid, journal_id, context=context)
vals['journal_default_account_id'] = \
journal.default_debit_account_id.id
if journal.currency:
vals['currency_id'] = journal.currency.id
else:
vals['currency_id'] = journal.company_id.currency_id.id
else:
vals['journal_default_account_id'] = False
return {'value': vals}
def onchange_currency_id(
self, cr, uid, ids, currency_id, company_id, context=None):
vals = {}
if currency_id and company_id:
company = self.pool['res.company'].browse(
cr, uid, company_id, context=context)
if company.currency_id.id == currency_id:
vals['currency_none_same_company_id'] = False
else:
vals['currency_none_same_company_id'] = currency_id
else:
vals['currency_none_same_company_id'] = False
return {'value': vals}
class account_move_line(orm.Model): class account_move_line(orm.Model):
_inherit = "account.move.line" _inherit = "account.move.line"
@@ -239,7 +324,17 @@ class account_move_line(orm.Model):
'check_deposit_id': fields.many2one( 'check_deposit_id': fields.many2one(
'account.check.deposit', 'account.check.deposit',
'Check Deposit'), 'Check Deposit'),
'check_line_id': fields.many2one(
'account.move.line',
'Check Receive Move line'),
} }
class res_company(orm.Model):
_inherit = 'res.company'
_columns = {
'check_deposit_account_id': fields.many2one(
'account.account', 'Account for Check Deposits',
domain=[
('type', '<>', 'view'),
('type', '<>', 'closed'),
('reconcile', '=', True)]),
}

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
account_check_deposit for OpenERP account_check_deposit for Odoo/OpenERP
Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
@author: Benoît GUILLOT <benoit.guillot@akretion.com>
The licence is in the file __openerp__.py The licence is in the file __openerp__.py
--> -->

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
account_check_deposit for OpenERP account_check_deposit for Odoo/OpenERP
Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com> Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
Copyright (C) 2013 Akretion Chafique DELLI <chafique.delli@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>
The licence is in the file __openerp__.py The licence is in the file __openerp__.py
--> -->
@@ -15,82 +17,81 @@
model="account.check.deposit" model="account.check.deposit"
name="check.deposit.webkit" name="check.deposit.webkit"
report_type="webkit" report_type="webkit"
string="Print Checks Deposit"/> string="Checks Deposit"/>
<!-- INHERITED VIEW FOR THE OBJECT : account_check_deposit -->
<record id="account_check_deposit_view_form" model="ir.ui.view"> <record id="account_check_deposit_view_form" model="ir.ui.view">
<field name="name">account_check_deposit.account_check_deposit.view_form</field> <field name="name">account.check.deposit.form</field>
<field name="model">account.check.deposit</field> <field name="model">account.check.deposit</field>
<field name="type">form</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Checks Deposit" version="7.0"> <form string="Checks Deposit" version="7.0">
<header> <header>
<button name="validate_deposit" states="draft" <button name="validate_deposit" states="draft"
string="Validate Deposit" string="Validate"
type="object" class="oe_highlight"/> type="object" class="oe_highlight"/>
<button name="cancel" states="done" <button name="backtodraft" states="done"
string="Cancel" type="object" /> string="Back to Draft" type="object" />
<field name="state" widget="statusbar" <field name="state" widget="statusbar"
statusbar_visible="draft,done" statusbar_visible="draft,done" />
statusbar_colors='{"draft":"blue"}'/>
</header> </header>
<sheet> <sheet>
<h1> <h1>
<label string="Deposit" /> <label string="Check Deposit" />
<field name="name" class="oe_inline" /> <field name="name" class="oe_inline" />
</h1> </h1>
<group name="deposit_fields"> <group name="main">
<field name="deposit_date" /> <group name="left">
<field name="journal_id" /> <field name="deposit_date" />
<field name="move_id" /> <field name="journal_id"
<field name="company_id" widget="selection"
on_change="onchange_company_id(company_id, context)"/> on_change="onchange_journal_id(journal_id, context)"/>
<field name="partner_id" invisible="1"/> <field name="journal_default_account_id"
<field name="bank_id"/> invisible="1"/>
<field name="currency_id"
groups="base.group_multi_currency"
on_change="onchange_currency_id(currency_id, company_id, context)"/>
<field name="partner_bank_id"/>
</group>
<group name="right">
<field name="company_id"
on_change="onchange_company_id(company_id, currency_id, context)"
groups="base.group_multi_company"/>
<field name="currency_none_same_company_id"
invisible="1"/>
<field name="check_count"/>
<field name="total_amount" widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="move_id"/>
</group>
</group>
<group string="Check Payments" name="check_payments">
<field name="check_payment_ids" nolabel="1"
widget="many2many"
domain="[('reconcile_id', '=', False),
('debit', '>', 0),
('journal_id', '=', journal_id),
('currency_id', '=', currency_none_same_company_id),
('account_id', '=', journal_default_account_id)]"
context="{'currency': currency_id,
'journal_id': journal_id}" />
</group> </group>
<notebook colspan="4">
<page string="Check Payments">
<field name="check_payment_ids" nolabel="1"
colspan="4" widget="many2many"
domain="[('reconcile_id','=',False),
('account_id.user_type.code','=','received_check')]">
<tree string="Check Payment">
<field name="journal_id" />
<field name="period_id" />
<field name="date"/>
<field name="name"/>
<field name="ref"/>
<field name="partner_id" />
<field name="account_id" />
<field name="move_id" />
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
<field name="reconcile"/>
</tree>
</field>
</page>
<page string="Move Line">
<field name="line_ids" nolabel="1"/>
</page>
</notebook>
</sheet> </sheet>
</form> </form>
</field> </field>
</record> </record>
<record id="account_check_deposit_view_tree" model="ir.ui.view"> <record id="account_check_deposit_view_tree" model="ir.ui.view">
<field name="name">account_check_deposit.account_check_deposit.view_tree</field> <field name="name">account.check.deposit.tree</field>
<field name="model">account.check.deposit</field> <field name="model">account.check.deposit</field>
<field name="type">tree</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Checks Deposit"> <tree string="Checks Deposits" colors="blue:state=='draft';">
<field name="name"/> <field name="name"/>
<field name="deposit_date"/> <field name="deposit_date"/>
<field name="state"/> <field name="check_count"/>
<field name="move_id"/>
<field name="total_amount"/> <field name="total_amount"/>
<field name="currency_id" groups="base.group_multi_currency"/>
<field name="is_reconcile"/> <field name="is_reconcile"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="state"/>
</tree> </tree>
</field> </field>
</record> </record>
@@ -101,28 +102,31 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Checks Deposit Search"> <search string="Checks Deposit Search">
<field name="name" string="Checks Deposit"/> <field name="name" string="Checks Deposit"/>
<field name="deposit_date" string="Date"/> <filter name="draft" string="Draft"
<field name="state"/> domain="[('state', '=', 'draft')]" />
<field name="move_id"/> <filter name="done" string="Done"
<group expand="0" string="Group By..."> domain="[('state', '=', 'done')]" />
<group string="Group By" name="groupby">
<filter name="date_groupby" string="Deposit Date"
context="{'group_by': 'deposit_date'}"/>
<filter name="journal_groupby" string="Journal"
context="{'group_by': 'journal_id'}" />
<filter name="currency_groupby" string="Currency"
context="{'group_by': 'currency_id'}" />
<filter name="partner_bank_groupby" string="Bank Account"
context="{'group_by': 'partner_bank_id'}" />
</group> </group>
</search> </search>
</field> </field>
</record> </record>
<record id="action_check_deposit_tree" model="ir.actions.act_window"> <record id="action_check_deposit_tree" model="ir.actions.act_window">
<field name="name">Checks Deposit</field> <field name="name">Checks Deposits</field>
<field name="res_model">account.check.deposit</field> <field name="res_model">account.check.deposit</field>
<field name="view_type">form</field> <field name="view_mode">tree,form</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="search_view_id" ref="view_check_deposit_search"/>
<field name="help" type="html"></field>
</record> </record>
<menuitem string="Checks Deposit" <menuitem action="action_check_deposit_tree"
action="action_check_deposit_tree"
id="menu_check_deposit_tree" id="menu_check_deposit_tree"
parent="account.menu_finance_bank_and_cash" parent="account.menu_finance_bank_and_cash"
sequence="20"/> sequence="20"/>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
account_check_deposit for OpenERP
Copyright (C) 2012 Akretion Benoît GUILLOT <benoit.guillot@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data noupdate="1">
<!-- New account.account.type -->
<record model="account.account.type" id="data_account_type_received_check">
<field name="name">Received Checks</field>
<field name="code">received_check</field>
<field name="close_method">none</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 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>

View File

@@ -1,6 +0,0 @@
[Dolphin]
AdditionalInfoV2=Details_Size,Details_Date,CustomizedDetails
Sorting=2
Timestamp=2012,3,5,14,27,49
Version=2
ViewMode=1

View File

@@ -1,275 +0,0 @@
<html>
<head>
<style type="text/css">
${css}
pre {font-family:helvetica; font-size:12;}
</style>
</head>
<body>
<style type="text/css">
table {
width: 100%;
page-break-after:auto;
border-collapse: collapse;
cellspacing="0";
font-size:10px;
}
td { margin: 0px; padding: 3px; border: 1px solid lightgrey; vertical-align: top; }
pre {font-family:helvetica; font-size:12;}
</style>
<%
def carriage_returns(text):
return text.replace('\n', '<br />')
%>
%for order in objects :
<br>
<% setLang(order.partner_id.lang) %>
<table >
%if order.company_id.address_label_position == 'left':
<tr>
<td style="width:50%">
${_("Shipping Address")}
<hr>
<pre>
${order.partner_shipping_id.address_label}
<pre>
</td>
<td style="width:50%">
%if order.partner_id.address_label != order.partner_shipping_id.address_label:
<b>${_("Ordering Contact")}</b><br>
${order.partner_id.address_label|carriage_returns}
%endif
%if order.partner_id.phone :
${_("Phone")}: ${order.partner_id.phone|entity} <br>
%endif
%if order.partner_id.fax :
${_("Fax")}: ${order.partner_id.fax|entity} <br>
%endif
%if order.partner_id.email :
${_("Mail")}: ${order.partner_id.email|entity} <br>
%endif
%if order.partner_invoice_id.address_label != order.partner_shipping_id.address_label:
<br>
<b>${_("Invoice Address")}</b><br>
${order.partner_invoice_id.address_label|carriage_returns}
%endif
%if order.partner_invoice_id.partner_id.vat :
${_("VAT")}: ${order.partner_invoice_id.partner_id.vat|entity} <br>
%endif
</td>
</tr>
%endif
%if order.company_id.address_label_position == 'right' or not order.company_id.address_label_position:
<tr>
<td style="width:50%">
%if order.partner_id.address_label != order.partner_shipping_id.address_label:
<b>${_("Ordering Contact")}</b><br>
<hr>
${order.partner_id.address_label|carriage_returns}
%endif
%if order.partner_id.phone :
${_("Tel")}: ${order.partner_id.phone|entity} <br>
%endif
%if order.partner_id.fax :
${_("Fax")}: ${order.partner_id.fax|entity} <br>
%endif
%if order.partner_id.email :
${_("E-mail")}: ${order.partner_id.email|entity} <br>
%endif
%if order.partner_invoice_id.address_label != order.partner_shipping_id.address_label:
<br>
<hr>
<b>${_("Invoice Address")}</b><br>
<hr>
${order.partner_invoice_id.address_label|carriage_returns}
%endif
%if order.partner_invoice_id.vat :
${_("VAT")}: ${order.partner_invoice_id.vat|entity} <br>
%endif
</td>
<td style="width:50%">
<b>${_("Shipping Address")}</b><br>
<hr>
<pre>
${order.partner_shipping_id.address_label}
<pre>
</td>
</tr>
%endif
</table>
<br />
<br />
%if order.state == 'draft' :
<span class="title">${_("Quotation N°")} ${order.name or ''|entity}</span>
%elif order.state == 'cancel' :
<span class="title">${_("Sale Order Canceled")} ${order.name or ''|entity}</span>
%else :
<span class="title">${_("Order N°")} ${order.name or ''|entity}</span>
%endif
<br/>
<table style="width:100%">
<tr>
%if order.client_order_ref:
<td>${_("Reference")}</td>
%endif
%if order.project_id:
<td>${_("Projekt")}</td>
%endif
<td style="text-align:center;white-space:nowrap"><b>${_("Order Date")}</b></td>
%if order.carrier_id:
<td style="text-align:center;white-space:nowrap"><b>${_("Carrier")}</b></td>
%endif
%if order.user_id:
<td style="text-align:center;white-space:nowrap"><b>${_("Salesman")}</b></td>
%endif
%if order.payment_term :
<td style="text-align:center;white-space:nowrap"><b>${_("Payment Term")}</b></td>
%endif
%if order.incoterm:
<td style="text-align:center;white-space:nowrap"><b>${_("Incoterm")}</b></td>
%endif
<td style="text-align:center;white-space:nowrap"><b>${_("Curr")}</b></td>
</tr>
<tr>
%if order.client_order_ref:
<td>
${order.client_order_ref}
</td>
%endif
%if order.project_id:
<td>${order.project_id.name}</td>
%endif
%if order.date_order:
<td>
${order.date_order or ''}</td>
%endif
%if order.carrier_id:
<td>
${order.carrier_id.name }
</td>
%endif
%if order.user_id :
<td>${order.user_id.name or ''}</td>
%endif
%if order.payment_term :
<td>${order.payment_term.name}</td>
%endif
%if order.incoterm:
<td>${order.incoterm.name}</td>
%endif
<td style="white-space:nowrap">${order.pricelist_id.currency_id.name} </td>
</table>
<h1><br /></h1>
<table style="width:100%">
<thead>
<tr>
%if order.print_code:
<td style="text-align:center;white-space:nowrap"><b>${_("Code")}</b></td>
<td style="text-align:center;white-space:nowrap"><b>${_("Description")}</b></td>
%else:
<td style="text-align:center;white-space:nowrap"><b>${_("Description")}</b></td>
%endif
<td style="text-align:center;white-space:nowrap"><b>${_("Tax")}</b></td>
%if order.print_uom:
<td style="text-align:center;white-space:nowrap"><b>${_("Quantity")}</b></td><td style="text-align:center;white-space:nowrap"><b>${_("UoM")}</b></td>
%endif
%if order.print_uos:
<th style="text-align:center;white-space:nowrap">${_("UoS Qty")}</th><th style="text-align:center;white-space:nowrap;">${_("UoS")}</th>
%endif
%if order.print_ean:
<td style="text-align:center;white-space:nowrap"><b>${_("EAN")}</b></td>
%endif
%if order.print_packing:
<td style="text-align:center;white-space:nowrap"><b>${_("Pack")}</b></td>
<td style="text-align:center;white-space:nowrap"><b>${_("Packaging")}</b></td>
%endif
<td style="text-align:center;white-space:nowrap"><b>${_("Price Unit")}</b></td>
%if order.print_discount:
<td style="text-align:center;white-space:nowrap"><b>${_("Discount")}</b></td>
%endif
<td style="text-align:center;white-space:nowrap"><b>${_("Sub Total")}</b></td>
</tr>
</thead>
%for line in order.order_line_sorted :
<tbody>
<tr>
%if order.print_code:
<td>${line.product_id.default_code or ''|entity}</td>
<td>
${line.product_id.name or line.name|entity}
</td>
%else:
<td>${line.name|entity}
</td
%endif
<td>${ ', '.join([tax.name or '' for tax in line.tax_id]) }</td>
%if order.print_uom:
<td style="white-space:nowrap;text-align:right;">${str(line.product_uom_qty).replace(',000','') or '0'}</td>
<td style="white-space:nowrap;text-align:left;">${line.product_uom.name or ''}</td>
%endif
%if order.print_uos:
<td style="white-space:nowrap;text-align:right;">${str(line.product_uos_qty).replace(',000','') or '0'}</td>
<td style="white-space:nowrap;text-align:left;">${line.product_uos.name or ''}</td>
%endif
%if order.print_ean:
<td style="white-space:nowrap;text-align:left;">${line.product_packaging.ean or line.product_id.ean13 or ''}</td>
%endif
%if order.print_packing:
<td style="white-space:normal;text-align:left;">${line.product_packaging.qty and line.product_uom_qty/line.product_packaging.qty or ''}</td>
<td style="white-space:normal;text-align:left;">${line.product_packaging and line.product_packaging.ul.name or ''} ${line.product_packaging and _(" / " or '')} ${line.product_packaging and line.product_packaging.qty or ''} ${line.product_packaging and line.product_id.uom_id.name or ''}</td>
%endif
<td style="white-space:nowrap;text-align:right;">${line.price_unit or ''}</td>
%if order.print_discount:
<td style="text-align:right;">${line.discount}</th>
%endif
<td style="white-space:nowrap;text-align:right;">${line.price_subtotal or ''}</td>
</tr>
%endfor
</tbody>
<tfoot>
<tr>
<td colspan="${order.cols}" style="border-style:none"/>
<td style="border-top: 2px solid"><b>${_("Net Total:")}</b></td>
<td class="amount" style="border-top:2px solid;text-align:right;">${formatLang(order.amount_untaxed, get_digits(dp='Sale Price'))} </td>
</tr>
<tr>
<td colspan="${order.cols}" style="border-style:none"/>
<td style="border-style:none"><b>${_("Taxes:")}</b></td>
<td class="amount" style="text-align:right;">${formatLang(order.amount_tax, get_digits(dp='Sale Price'))} </td>
</tr>
<tr>
<td colspan="${order.cols}" style="border-style:none"/>
<td style="border-top:2px solid"><b>${_("Total:")}</b></td>
<td class="amount" style="border-top:2px solid;text-align:right;">${formatLang(order.amount_total, get_digits(dp='Sale Price'))} </td>
</tr>
</tfoot>
</table>
%if order.note and 'note_print' not in order._columns:
<br>
<pre>${order.note}</pre>
%endif:
%if 'note_print' in order._columns and order.note_print:
<br>
<pre>${order.note_print}</pre>
%endif:
<p style="page-break-after:always"></p>
%endfor
</body>
</html>

View File

@@ -1,32 +1,22 @@
#-*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # account_check_deposit for Odoo/OpenERP
# All Right Reserved # Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
# #
# Author : Ferdinand Gassauer (Camptocamp Austria) # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# #
# WARNING: This program as such is intended to be used by professional # This program is distributed in the hope that it will be useful,
# programmers who take the whole responsability of assessing all potential # but WITHOUT ANY WARRANTY; without even the implied warranty of
# consequences resulting from its eventual inadequacies and bugs # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# End users who are looking for a ready-to-use solution with commercial # GNU Affero General Public License for more details.
# garantees and support are strongly adviced to contract a Free Software
# Service Company
# #
# This program is Free Software; you can redistribute it and/or # You should have received a copy of the GNU Affero General Public License
# modify it under the terms of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>.
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, ###############################################################################
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import report_webkit_html from . import report_webkit_html

View File

@@ -37,76 +37,54 @@
</head> </head>
<body> <body>
%for deposit in objects : %for deposit in objects :
<% setLang(deposit.partner_id.lang) %> <% setLang(deposit.company_id.partner_id.lang) %>
<b><span class="titre">${_("Deposit Slip of Checks(Euros)")}</span></b> <b><span class="titre">${_("Deposit Slip of Checks in ")} ${deposit.currency_id.name}</span></b>
<br>
<br>
<br>
<br>
<br>
<br>
<h2>
<b>${_("Deposit N°")} ${deposit.name}</b>
</h2>
<h1> <table class="basic_table" width="100%">
<b>${_("Deposit Date")}</b><span class="vtrait1">${_("|")}</span> <tr>
<span class="valign_up1"> ${deposit.deposit_date}</span> <th class="date">${_("Deposit Date")}</th>
<b><span class="halign">${_("Bank Code")}</span></b> <th class="text-align:center;">${_("Deposit Ref")}</th>
<span class="vtrait2">${_("|")}</span><span class="valign_up2"> ${deposit.bank_id.bank_code}</span> <th class="text-align:center;">${_("Beneficiary")}</th>
<br> <th class="text-align:center;">${_("Bank Account Number")}</th>
<b>${_("Beneficiary")}</b><span class="vtrait1">${_("|")}</span> </tr>
<span class="valign_up1"> ${company.partner_id.name}</span> <tr>
<b><span class="halign">${_("Office Code")}</span></b> <td class="date">${formatLang(deposit.deposit_date, date=True)}</td>
<span class="vtrait2">${_("|")}</span><span class="valign_up2"> ${deposit.bank_id.office}</span> <td class="text-align:center;">${deposit.name}</td>
<br> <td class="text-align:center;">${deposit.company_id.partner_id.name}</td>
<b>${_("Account to crediting")}</b><span class="vtrait1">${_("|")}</span> <td class="text-align:center;">${deposit.partner_bank_id.acc_number}</td>
<span class="valign_up1"> ${deposit.bank_id.rib_acc_number}</span> </tr>
<b><span class="halign">${_("BIS Key")}</span></b><span class="vtrait2">${_("|")}</span> </table>
<span class="valign_up2"> ${deposit.bank_id.key}</span>
</h1> <h3>${_("Check Payments")}</h3>
<br>
<h3>
<b>${_("Check Payments")}</b>
</h3>
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th class="entete_tab">${_("Payment Date")}</th> <th class="entete_tab">${_("Payment Date")}</th>
<th class="entete_tab">${_("Reference")}</th> <th class="entete_tab">${_("Reference")}</th>
<th class="entete_tab">${_("Description")}</th> <th class="entete_tab">${_("Debtor")}</th>
<th class="entete_tab">${_("Designation")}</th>
<th class="entete_tab">${_("Amount")}</th> <th class="entete_tab">${_("Amount")}</th>
</thead> </thead>
</tr> </tr>
<br>
%for move_line in deposit.check_payment_ids : %for move_line in deposit.check_payment_ids :
<tbody> <tbody>
<tr> <tr>
<td class="cellule_tab">${move_line.date or ''}</td> <td class="cellule_tab">${move_line.date or ''}</td>
<td class="cellule_tab">${move_line.ref or ''}</td> <td class="cellule_tab">${move_line.ref or ''}</td>
<td class="cellule_tab">${move_line.name or ''}</td>
<td class="cellule_tab">${move_line.partner_id.name or ''}</td> <td class="cellule_tab">${move_line.partner_id.name or ''}</td>
<td class="amount">${move_line.debit or '0'}</td> <td class="amount">${deposit.currency_id == deposit.company_id.currency_id and move_line.debit or move_line.amount_currency} ${deposit.currency_id.name}</td>
</tr> </tr>
</tbody> </tbody>
%endfor %endfor
%endfor %endfor
<tfoot> <tfoot>
<tr> <tr>
<td colspan=4 class="amount total"><b>${_("Total:")}</b></td> <td colspan="3" class="amount total"><b>${_("Total:")}</b></td>
<td colspan=5 class="amount total"><b>${deposit.total_amount or '0'}</b></td> <td class="amount total"><b>${deposit.total_amount or '0'} ${deposit.currency_id.name}</b></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
</body> </body>
</html> </html>

View File

@@ -1,25 +1,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # account_check_deposit for Odoo/OpenERP
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
# Copyright (C) 2010-2012 Camptocamp Austria (<http://www.camptocamp.at>) # @author: Benoît GUILLOT <benoit.guillot@akretion.com>
# Copyright (C) 2013 AKRETION (<http://www.akretion.com>) # @author: Chafique DELLI <chafique.delli@akretion.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the # published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version. # License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details. # GNU Affero General Public License for more details.
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ###############################################################################
import time import time
from report import report_sxw from report import report_sxw
@@ -28,7 +28,8 @@ from report import report_sxw
class report_webkit_html(report_sxw.rml_parse): class report_webkit_html(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context): def __init__(self, cr, uid, name, context):
super(report_webkit_html, self).__init__(cr, uid, name, context=context) super(report_webkit_html, self).__init__(
cr, uid, name, context=context)
self.localcontext.update({ self.localcontext.update({
'time': time, 'time': time,
'cr': cr, 'cr': cr,

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 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">
<record id="check_deposit_rule" model="ir.rule">
<field name="name">Check Deposit multi-company</field>
<field name="model_id" ref="model_account_check_deposit"/>
<field name="global" eval="True"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
</data>
</openerp>