[ADD] structure for the reconciliation history

This commit is contained in:
Guewen Baconnier @ Camptocamp
2012-12-19 11:55:57 +01:00
parent e8081cd977
commit f66bd8c459
4 changed files with 119 additions and 1 deletions

View File

@@ -22,3 +22,4 @@
import easy_reconcile import easy_reconcile
import base_reconciliation import base_reconciliation
import simple_reconciliation import simple_reconciliation
import easy_reconcile_history

View File

@@ -48,7 +48,10 @@ This latter add more complex reconciliations, allows multiple lines and partial.
"category" : "Finance", "category" : "Finance",
"init_xml" : [], "init_xml" : [],
"demo_xml" : [], "demo_xml" : [],
"update_xml" : ["easy_reconcile.xml"], "update_xml" : [
"easy_reconcile.xml",
"easy_reconcile_history_view.xml",
],
'license': 'AGPL-3', 'license': 'AGPL-3',
"auto_install": False, "auto_install": False,
"installable": True, "installable": True,

View File

@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# 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 openerp.osv import orm, fields
class easy_reconcile_history(orm.Model):
""" Store an history of the runs per profile
Each history stores the list of reconciliations done"""
_name = 'easy.reconcile.history'
_columns = {
'easy_reconcile_id': fields.many2one(
'account.easy.reconcile', 'Reconcile Profile', readonly=True),
'date': fields.datetime('Run date', readonly=True),
'reconcile_ids': fields.many2many(
'account.move.reconcile', string='Reconciliations', readonly=True),
'reconcile_partial_ids': fields.many2many(
'account.move.reconcile', string='Partial Reconciliations', readonly=True),
}

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="view_easy_reconcile_history_search" model="ir.ui.view">
<field name="name">easy.reconcile.history.search</field>
<field name="model">easy.reconcile.history</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Automatic Easy Reconcile History">
<filter icon="terp-go-today" string="Today"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')), ('date','&gt;=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
help="Todays' Reconcilations" />
<filter icon="terp-go-week" string="7 Days"
help="Reconciliations of last 7 days"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d 00:00:00'))]"
/>
<separator orientation="vertical"/>
<field name="easy_reconcile_id"/>
<field name="date"/>
<group expand="0" string="Group By...">
<filter string="Reconciliation Profile"
icon="terp-stock_effects-object-colorize"
domain="[]" context="{'group_by': 'easy_reconcile_id'}"/>
<filter string="Date" icon="terp-go-month" domain="[]"
context="{'group_by': 'date'}"/>
</group>
</search>
</field>
</record>
<record id="easy_easy_reconcile_history_form" model="ir.ui.view">
<field name="name">easy.reconcile.history.form</field>
<field name="priority">16</field>
<field name="model">easy.reconcile.history</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Automatic Easy Reconcile History">
<field name="easy_reconcile_id"/>
<field name="date"/>
<field name="reconcile_ids"/>
<field name="reconcile_partial_ids"/>
</form>
</field>
</record>
<record id="easy_easy_reconcile_history_tree" model="ir.ui.view">
<field name="name">easy.reconcile.history.tree</field>
<field name="priority">16</field>
<field name="model">easy.reconcile.history</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Automatic Easy Reconcile History">
<field name="easy_reconcile_id"/>
<field name="date"/>
</tree>
</field>
</record>
<record id="action_easy_reconcile_history" model="ir.actions.act_window">
<field name="name">Easy Automatic Reconcile History</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">easy.reconcile.history</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_easy_reconcile_history"
id="menu_easy_reconcile_history"
parent="account.periodical_processing_reconciliation"/>
</data>
</openerp>