[IMP] Docstring added

bzr revid: atp@tinyerp.co.in-20100226133427-x1ywimv1y0ugirmm
This commit is contained in:
atp (Open ERP)
2010-02-26 19:04:27 +05:30
parent 96d7b67313
commit bb217dcc35
15 changed files with 327 additions and 22 deletions
+2
View File
@@ -1008,6 +1008,7 @@
<menuitem action="action_move_line_search" id="menu_action_move_line_search" parent="account.next_id_29"/>
<menuitem id="menu_finance_charts" name="Charts" parent="account.menu_finance" sequence="4"/>
<wizard id="wizard_account_chart" menu="False" model="account.account" name="account.chart" string="Chart of Accounts"/>
<!-- <menuitem icon="STOCK_INDENT" action="wizard_account_chart" id="menu_action_account_tree2" parent="account.menu_finance_charts" />-->
@@ -1080,6 +1081,7 @@
groups="group_account_user"/>
<menuitem action="action_bank_statement_reconciliation_form" id="menu_action_account_bank_reconcile_tree" parent="next_id_30"/>
<wizard id="action_account_bank_reconcile_tree" menu="False" model="account.move.line" name="account.move.bank.reconcile" string="Bank reconciliation"/>
<!-- <menuitem action="action_account_bank_reconcile_tree" id="menu_action_account_bank_reconcile_check_tree" parent="account.next_id_30" />-->
+5 -4
View File
@@ -41,10 +41,11 @@ class account_chart(osv.osv_memory):
def _account_chart_open_window(self, cr, uid, ids, context):
"""
cr is the current row, from the database cursor,
uid is the current user’s ID for security checks,
ID is the account chart’s ID or list of IDs if we want more than one
This function Open account chart window on given fiscalyear and all Entries or posted entries
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id: the account chart’s ID or list of IDs if we want more than one
@return: dictionary of Open account chart window on given fiscalyear and all Entries or posted entries
"""
for form in self.read(cr, uid, ids):
mod_obj = self.pool.get('ir.model.data')
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_chart" model="ir.ui.view">
<field name="name">account.chart.form</field>
<field name="model">account.chart</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account charts">
<group colspan="4" >
<field name="fiscalyear"/>
<label align="0.7" colspan="6" string="(If you do not select Fiscal year it will take all open fiscal years)"/>
<field name="target_move"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel"/>
<button string="Open Charts" name="_account_chart_open_window" type="object"/>
</group>
</form>
</field>
</record>
<record id="wizard_account_chart" model="ir.actions.act_window">
<field name="name">Chart of Accounts</field>
<field name="res_model">account.chart</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_chart"/>
<field name="target">new</field>
</record>
</data>
</openerp>
@@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 wizard
import netsvc
import pooler
import time
from tools.translate import _
import tools
from osv import fields, osv
class account_fiscalyear_close_state(osv.osv_memory):
"""
close Account Fiscalyear
"""
_name = "account.fiscalyear.close.state"
_description = "Fiscalyear Close state"
_columns = {
'fy_id':fields.many2one('account.fiscalyear', 'Fiscal Year to close', required=True),
'sure':fields.boolean('Check this box', required=False)
}
def _data_save(self, cr, uid, ids, context):
"""
This function close account fiscalyear
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id: account fiscalyear close state’s ID or list of IDs if we want more than one
"""
for form in self.read(cr, uid, ids):
if not form['sure']:
raise osv.except_osv(_('UserError'), _('Closing of states cancelled, please check the box !'))
fy_id = form['fy_id']
cr.execute('UPDATE account_journal_period ' \
'SET state = %s ' \
'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
('done',fy_id))
cr.execute('UPDATE account_period SET state = %s ' \
'WHERE fiscalyear_id = %s', ('done',fy_id))
cr.execute('UPDATE account_fiscalyear ' \
'SET state = %s WHERE id = %s', ('done', fy_id))
return {}
account_fiscalyear_close_state()
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_fiscalyear_close_state" model="ir.ui.view">
<field name="name">account.fiscalyear.close.state.form</field>
<field name="model">account.fiscalyear.close.state</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Close states of Fiscal year and periods">
<group colspan="4" >
<field name="fy_id" domain = "[('state','=','draft')]"/>
<separator string="Are you sure you want to close the fiscal year ?" colspan="4"/>
<field name="sure"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel"/>
<button string="Close states" name="_data_save" type="object"/>
</group>
</form>
</field>
</record>
<record id="wizard_fiscalyear_close_state" model="ir.actions.act_window">
<field name="name">Close a Fiscal Year</field>
<field name="res_model">account.fiscalyear.close.state</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_fiscalyear_close_state"/>
<field name="target">new</field>
</record>
<menuitem action="wizard_fiscalyear_close_state" id="menu_wizard_fy_close_state" parent="menu_account_end_year_treatments" />
</data>
</openerp>
@@ -40,9 +40,9 @@ class account_invoice_refund(osv.osv_memory):
def _compute_refund(self, cr, uid, ids, mode, context):
"""
cr is the current row, from the database cursor,
uid is the current user’s ID for security checks,
ID is the account invoice refund’s ID or list of IDs if we want more than one
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id: the account invoice refund’s ID or list of IDs if we want more than one
"""
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_invoice_refund" model="ir.ui.view">
<field name="name">account.invoice.refund.form</field>
<field name="model">account.invoice.refund</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Credit Note">
<group colspan="4" >
<label string="Are you sure you want to refund this invoice ?" colspan="2"/>
<newline/>
<field name="date"/>
<field name="period"/>
<field name="description"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel"/>
<button string="Refund Invoice" name="_invoice_refund" type="object"/>
<button string="Cancel Invoice" name="_invoice_cancel" type="object"/>
<button string="Modify Invoice" name="_invoice_modify" type="object"/>
</group>
</form>
</field>
</record>
<record id="wizard_invoice_refund" model="ir.actions.act_window">
<field name="name">Credit Note</field>
<field name="res_model">account.invoice.refund</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_invoice_refund"/>
<field name="target">new</field>
</record>
</data>
</openerp>
@@ -37,10 +37,10 @@ class account_move_bank_reconcile(osv.osv_memory):
}
def _action_open_window(self, cr, uid, ids, context):
"""
cr is the current row, from the database cursor,
uid is the current user’s ID for security checks,
ID is the account move bank reconcile’s ID or list of IDs if we want more than one
This function Open account move line on given journal_id.
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id: account move bank reconcile’s ID or list of IDs if we want more than one
@return:dictionary of Open account move line on given journal_id.
"""
for form in self.read(cr, uid, ids):
cr.execute('select default_credit_account_id from account_journal where id=%s', (form['journal_id'],))
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_move_bank_reconcile" model="ir.ui.view">
<field name="name">account.move.bank.reconcile.form</field>
<field name="model">account.move.bank.reconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Bank reconciliation">
<group colspan="4" >
<field name="journal_id"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel"/>
<button string="Open for bank reconciliation" name="_action_open_window" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_account_bank_reconcile_tree" model="ir.actions.act_window">
<field name="name">Bank reconciliation</field>
<field name="res_model">account.move.bank.reconcile</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_move_bank_reconcile"/>
<field name="target">new</field>
</record>
</data>
</openerp>
@@ -41,10 +41,12 @@ class account_move_journal(osv.osv_memory):
def _action_open_window(self, cr, uid, ids, context={}):
"""
cr is the current row, from the database cursor,
uid is the current user’s ID for security checks,
ID is the account move journal’s ID or list of IDs if we want more than one
This function Open action move line window on given period and Journal/Payment Mode
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id: account move journal’s ID or list of IDs if we want more than one
@return:dictionary of Open action move line window on given period and Journal/Payment Mode
"""
for form in self.read(cr, uid, ids,['journal_id', 'period_id']):
cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form' ))
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_move_journal_form" model="ir.ui.view">
<field name="name">account.move.journal.form</field>
<field name="model">account.move.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Standard entries">
<group colspan="4" >
<field name="journal_id"/>
<newline/>
<field name="period_id" />
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button string="Open Journal" name="_action_open_window" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_move_journal_line_form" model="ir.actions.act_window">
<field name="name">Making Entries by Line</field>
<field name="res_model">account.move.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_move_journal_form"/>
<field name="target">new</field>
</record>
</data>
</openerp>
@@ -35,10 +35,12 @@ class account_move_line_reconcile_select(osv.osv_memory):
def _action_open_window(self, cr, uid, ids, context):
"""
cr is the current row, from the database cursor,
uid is the current user’s ID for security checks,
ID is the account move line reconcile select’s ID or list of IDs if we want more than one
This function Open account move line window for reconcile on given account id
This function Open account move line window for reconcile on given account id
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id: account move line reconcile select’s ID or list of IDs if we want more than one
@return:dictionary of Open account move line window for reconcile on given account id
"""
for data in self.read(cr, uid, ids):
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_move_line_reconcile_select" model="ir.ui.view">
<field name="name">account.move.line.reconcile.select.form</field>
<field name="model">account.move.line.reconcile.select</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reconciliation">
<group colspan="4" >
<field name="account_id"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel"/>
<button string="Open for reconciliation" name="_action_open_window" type="object"/>
</group>
</form>
</field>
</record>
<record id="wizard_reconcile_select" model="ir.actions.act_window">
<field name="name">Reconcile entries</field>
<field name="res_model">account.move.line.reconcile.select</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_move_line_reconcile_select"/>
<field name="target">new</field>
</record>
<menuitem id="next_id_20" name="Reconciliation" parent="menu_finance_periodical_processing"/><menuitem action="wizard_reconcile_select" id="menu_reconcile_select" parent="account.next_id_20" />
</data>
</openerp>
@@ -37,10 +37,12 @@ class account_period_close(osv.osv_memory):
def _data_save(self, cr, uid, ids, context):
"""
cr is the current row, from the database cursor,
uid is the current user’s ID for security checks,
ID is the account period close’s ID or list of IDs if we want more than one
This function close period
This function close period
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param id:account period close’s ID or list of IDs if we want more than one
"""
mode = 'done'
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_period_close" model="ir.ui.view">
<field name="name">account.period.close.form</field>
<field name="model">account.period.close</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Close Period">
<group colspan="4" >
<separator string="Are you sure ?" colspan="4"/>
<field name="sure"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button special="cancel" string="Cancel"/>
<button string="Close Period" name="_data_save" type="object"/>
</group>
</form>
</field>
</record>
<record id="wizard_period_close" model="ir.actions.act_window">
<field name="name">Close a Period</field>
<field name="res_model">account.period.close</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_period_close"/>
<field name="target">new</field>
</record>
</data>
</openerp>