[ADD]: adding changes from account_voucher_payment module to account_voucher module

bzr revid: mga@tinyerp.com-20100820190502-s8kc60flvr8on6ar
This commit is contained in:
Mantavya Gajjar 2010-08-21 00:35:02 +05:30
parent 02ebd11c1f
commit c254fd3cfc
5 changed files with 107 additions and 1 deletions

View File

@ -42,10 +42,11 @@
"voucher_workflow.xml",
"voucher_report.xml",
"wizard/account_voucher_open_view.xml",
"wizard/account_voucher_unreconcile_view.xml",
"voucher_view.xml",
"voucher_sales_purchase_view.xml",
"voucher_payment_receipt_view.xml",
"voucher_wizard.xml"
"voucher_wizard.xml",
],
"test" : [
# "test/account_voucher.yml",

View File

@ -53,6 +53,7 @@
<button name="recheck_voucher" string="Approve" states="recheck" icon="terp-check"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck" icon="gtk-cancel"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Unreconcile" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>
@ -134,6 +135,7 @@
<button name="recheck_voucher" string="Approve" states="recheck" icon="terp-check"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck" icon="gtk-cancel"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
<button name="%(action_view_account_voucher_unreconcile)d" string="Unreconcile" type="action" states="posted" icon="terp-stock_effects-object-colorize"/>
</group>
</form>
</field>

View File

@ -20,3 +20,4 @@
##############################################################################
import account_voucher_open
import account_voucher_unreconcile

View File

@ -0,0 +1,63 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# 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 netsvc
from osv import osv
from osv import fields
class account_voucher_unreconcile(osv.osv_memory):
_name = "account.voucher.unreconcile"
_description = "Account voucher unreconcile"
_columns = {
'remove':fields.boolean('Want to remove accounting entries too ?', required=False),
}
_defaults = {
'remove': lambda *a: True,
}
def trans_unrec(self, cr, uid, ids, context=None):
res = self.browse(cr, uid, ids[0])
if context is None:
context = {}
voucher_pool = self.pool.get('account.voucher')
reconcile_pool = self.pool.get('account.move.reconcile')
if context.get('active_id'):
voucher = voucher_pool.browse(cr, uid, context.get('active_id'), context)
recs = []
for line in voucher.move_ids:
if line.reconcile_id:
recs = [line.reconcile_id.id]
for rec in recs:
reconcile_pool.unlink(cr, uid, rec)
if res.remove:
voucher_pool.cancel_voucher(cr, uid, [context.get('active_id')], context)
# wf_service = netsvc.LocalService("workflow")
# wf_service.trg_validate(uid, 'account.voucher', context.get('active_id'), 'cancel_voucher', cr)
return {}
account_voucher_unreconcile()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_voucher_unreconcile" model="ir.ui.view">
<field name="name">Account voucher unreconcile</field>
<field name="model">account.voucher.unreconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Unreconciliation">
<separator colspan="4" string="Unreconciliation transactions" />
<label string="If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" colspan="2"/>
<separator colspan="4"/>
<field name="remove"/>
<separator colspan="4"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="trans_unrec" default_focus="1" string="Unreconcile" type="object" icon="gtk-ok"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_account_voucher_unreconcile">
<field name="name">Unreconcile entries</field>
<field name="res_model">account.voucher.unreconcile</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_voucher_unreconcile"/>
<field name="target">new</field>
</record>
<!-- <act_window name="Unreconcile entries" -->
<!-- res_model="account.voucher.unreconcile"-->
<!-- src_model="account.voucher"-->
<!-- view_mode="form"-->
<!-- target="new" -->
<!-- key2="client_action_multi" -->
<!-- id="action_view_account_voucher_unreconcile"/>-->
</data>
</openerp>