mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Port to v8
Convert webkit report to qweb
This commit is contained in:
committed by
Pedro M. Baeza
parent
76dd1034ee
commit
1cbff812e1
@@ -2,7 +2,7 @@
|
||||
###############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo/OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
|
||||
# Copyright (C) 2012-2015 Akretion (http://www.akretion.com/)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
###############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo/OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
|
||||
# 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>
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
{
|
||||
'name': 'Account Check Deposit',
|
||||
'version': '0.1',
|
||||
'version': '8.0.0.1.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Manage deposit of checks to the bank',
|
||||
@@ -40,7 +40,7 @@ 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,Odoo Community Association (OCA)",
|
||||
'website': 'http://www.akretion.com/',
|
||||
'depends': [
|
||||
'account_accountant',
|
||||
@@ -48,11 +48,14 @@ check deposits.
|
||||
],
|
||||
'data': [
|
||||
'account_deposit_view.xml',
|
||||
'account_move_line_view.xml',
|
||||
'account_deposit_sequence.xml',
|
||||
'company_view.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/check_deposit_security.xml',
|
||||
'account_data.xml',
|
||||
'report.xml',
|
||||
'report/report_checkdeposit.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
account_check_deposit for Odoo/OpenERP
|
||||
Copyright (C) 2014 Akretion (http://www.akretion.com/)
|
||||
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
|
||||
-->
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
###############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo/OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
|
||||
# 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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
account_check_deposit for Odoo/OpenERP
|
||||
Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
|
||||
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
|
||||
-->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
account_check_deposit for Odoo/OpenERP
|
||||
Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
|
||||
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>
|
||||
@@ -10,20 +10,12 @@
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
<report
|
||||
auto="False"
|
||||
file="account_check_deposit/report/check_deposit.mako"
|
||||
id="check_deposit_webkit"
|
||||
model="account.check.deposit"
|
||||
name="check.deposit.webkit"
|
||||
report_type="webkit"
|
||||
string="Checks Deposit"/>
|
||||
|
||||
<record id="account_check_deposit_view_form" model="ir.ui.view">
|
||||
<field name="name">account.check.deposit.form</field>
|
||||
<field name="model">account.check.deposit</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Checks Deposit" version="7.0">
|
||||
<form string="Checks Deposit">
|
||||
<header>
|
||||
<button name="validate_deposit" states="draft"
|
||||
string="Validate"
|
||||
@@ -86,6 +78,8 @@
|
||||
<tree string="Checks Deposits" colors="blue:state=='draft';">
|
||||
<field name="name"/>
|
||||
<field name="deposit_date"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="check_count"/>
|
||||
<field name="total_amount"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
|
||||
37
account_check_deposit/account_move_line_view.xml
Normal file
37
account_check_deposit/account_move_line_view.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 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_move_line_form" model="ir.ui.view">
|
||||
<field name="name">account_check_deposit.view_move_line_form</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="statement_id" position="after">
|
||||
<field name="check_deposit_id" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_form2" model="ir.ui.view">
|
||||
<field name="name">account_check_deposit.view_move_line_form2</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form2" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="blocked" position="after">
|
||||
<field name="check_deposit_id" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2014 Akretion (http://www.akretion.com/)
|
||||
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
|
||||
-->
|
||||
|
||||
21
account_check_deposit/report.xml
Normal file
21
account_check_deposit/report.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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>
|
||||
|
||||
<report id="report_account_check_deposit"
|
||||
model="account.check.deposit"
|
||||
string="Check Deposit"
|
||||
report_type="qweb-pdf"
|
||||
name="account_check_deposit.report_checkdeposit"
|
||||
file="account_check_deposit.report_checkdeposit"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo/OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion (http://www.akretion.com/)
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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 Affero General Public License for more details.
|
||||
#
|
||||
# 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 . import report_webkit_html
|
||||
@@ -1,90 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
page-break-after:auto;
|
||||
border-collapse: collapse;
|
||||
cellspacing="0";
|
||||
font-size:14px;
|
||||
}
|
||||
td { margin: 0px; padding: 3px; border: 1px solid lightgrey; vertical-align: top; }
|
||||
.valign_up1, .valign_up2, .halign, .vtrait1, .vtrait2{
|
||||
position:absolute;
|
||||
}
|
||||
.valign_up1 { left:200px; font-weight: lighter; color:MediumSlateBlue ;
|
||||
}
|
||||
.valign_up2 { left:650px; font-weight: lighter; color:MediumSlateBlue ;
|
||||
}
|
||||
.halign { left:500px}
|
||||
.vtrait1 { left:185px; font-weight: lighter; color:MediumSlateBlue ; }
|
||||
.vtrait2 { left:630px; font-weight: lighter; color:MediumSlateBlue ; }
|
||||
.entete_tab {text-align:center; white-space:nowrap; border-bottom:1px solid;}
|
||||
.cellule_tab {white-space:nowrap; text-align:center;}
|
||||
.amount {white-space:nowrap; text-align:right;}
|
||||
.total {border-top:2px solid;}
|
||||
.titre {text-align:center; font-family:helvetica; font-size:35px; background:lightgrey}
|
||||
|
||||
pre {font-family:helvetica; font-size:12px;}
|
||||
h1 {font-family:helvetica; font-size:18px;}
|
||||
h2 {font-family:helvetica; font-size:25px; border-bottom:1px solid}
|
||||
h3 {font-family:helvetica; font-size:22px; color: MediumSlateBlue ; margin-bottom: auto;}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
%for deposit in objects :
|
||||
<% setLang(deposit.company_id.partner_id.lang) %>
|
||||
<b><span class="titre">${_("Deposit Slip of Checks in ")} ${deposit.currency_id.name}</span></b>
|
||||
|
||||
<table class="basic_table" width="100%">
|
||||
<tr>
|
||||
<th class="date">${_("Deposit Date")}</th>
|
||||
<th class="text-align:center;">${_("Deposit Ref")}</th>
|
||||
<th class="text-align:center;">${_("Beneficiary")}</th>
|
||||
<th class="text-align:center;">${_("Bank Account Number")}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="date">${formatLang(deposit.deposit_date, date=True)}</td>
|
||||
<td class="text-align:center;">${deposit.name}</td>
|
||||
<td class="text-align:center;">${deposit.company_id.partner_id.name}</td>
|
||||
<td class="text-align:center;">${deposit.partner_bank_id.acc_number}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>${_("Check Payments")}</h3>
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="entete_tab">${_("Payment Date")}</th>
|
||||
<th class="entete_tab">${_("Reference")}</th>
|
||||
<th class="entete_tab">${_("Debtor")}</th>
|
||||
<th class="entete_tab">${_("Amount")}</th>
|
||||
</thead>
|
||||
</tr>
|
||||
|
||||
%for move_line in deposit.check_payment_ids :
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="cellule_tab">${move_line.date or ''}</td>
|
||||
<td class="cellule_tab">${move_line.ref or ''}</td>
|
||||
<td class="cellule_tab">${move_line.partner_id.name or ''}</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>
|
||||
</tbody>
|
||||
%endfor
|
||||
%endfor
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="3" class="amount total"><b>${_("Total:")}</b></td>
|
||||
<td class="amount total"><b>${deposit.total_amount or '0'} ${deposit.currency_id.name}</b></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
91
account_check_deposit/report/report_checkdeposit.xml
Normal file
91
account_check_deposit/report/report_checkdeposit.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2014-2015 Akretion (www.akretion.com)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="report_checkdeposit">
|
||||
|
||||
<t t-call="report.html_container">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<t t-call="report.internal_layout">
|
||||
|
||||
<div class="page">
|
||||
|
||||
<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>
|
||||
|
||||
<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>Check Currency:</b> <span t-field="o.currency_id.name"/></p>
|
||||
|
||||
<p><b>Transfer Date:</b> <span t-field="o.deposit_date"/></p>
|
||||
|
||||
<p><b>Number of checks:</b> <span t-field="o.check_count"/></p>
|
||||
|
||||
<h3>List of checks:</h3>
|
||||
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Reference</th>
|
||||
<th>Debtor</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<t t-foreach="o.check_payment_ids" t-as="move_line">
|
||||
|
||||
<tr>
|
||||
<td><span t-field="move_line.date"/></td>
|
||||
<td><span t-field="move_line.ref"/></td>
|
||||
<td><span t-field="move_line.partner_id.name"/></td>
|
||||
<td>
|
||||
<t t-if="o.currency_id == o.company_id.currency_id">
|
||||
<span t-field="move_line.debit"
|
||||
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
|
||||
</t>
|
||||
<t t-if="o.currency_id != o.company_id.currency_id">
|
||||
<span t-field="move_line.amount_currency"
|
||||
t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</t>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b>Total:</b></td>
|
||||
<td><b><span t-field="o.total_amount" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/></b></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,42 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# account_check_deposit for Odoo/OpenERP
|
||||
# Copyright (C) 2012-2014 Akretion (http://www.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
|
||||
# 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.
|
||||
#
|
||||
# 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 Affero General Public License for more details.
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
|
||||
|
||||
class report_webkit_html(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(report_webkit_html, self).__init__(
|
||||
cr, uid, name, context=context)
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'cr': cr,
|
||||
'uid': uid,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.account.check.deposit',
|
||||
'account.check.deposit',
|
||||
'addons/account_check_deposit/report/check_deposit.mako',
|
||||
parser=report_webkit_html)
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2014 Akretion (http://www.akretion.com/)
|
||||
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
|
||||
-->
|
||||
|
||||
BIN
account_check_deposit/static/description/icon.png
Normal file
BIN
account_check_deposit/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
Reference in New Issue
Block a user