[MERGE]:Merged from trunk

bzr revid: apa@tinyerp.com-20100916044137-j2qv61qncc52t305
This commit is contained in:
apa-tiny 2010-09-16 10:11:37 +05:30
commit e211e9416b
10 changed files with 37 additions and 33 deletions

View File

@ -132,7 +132,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
history = []
for i in range(5):
args_list = (tuple(self.ACCOUNT_TYPE), tuple(partner_ids) ,self.date_from,)
dates_query = '(COALESCE(date_maturity,date)'
dates_query = "(COALESCE(date_maturity,date)"
if form[str(i)]['start'] and form[str(i)]['stop']:
dates_query += ' BETWEEN %s AND %s)'
args_list += (form[str(i)]['start'], form[str(i)]['stop'])
@ -254,17 +254,30 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
for i in t:
future_past['No Partner Defined'] = i[0]
history = []
for i in range(5):
args_list = (tuple(self.ACCOUNT_TYPE), self.date_from)
dates_query = "(COALESCE(date_maturity,date)"
if form[str(i)]['start'] and form[str(i)]['stop']:
dates_query += ' BETWEEN %s AND %s)'
args_list += (form[str(i)]['start'], form[str(i)]['stop'])
elif form[str(i)]['start']:
dates_query += ' > %s)'
args_list += (form[str(i)]['start'],)
else:
dates_query += ' < %s)'
args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT SUM(debit-credit)\
FROM account_move_line AS l, account_account\
WHERE (l.account_id = account_account.id)\
AND (l.partner_id IS NULL)\
AND (account_account.type IN %s)\
AND (COALESCE(date_maturity,date) BETWEEN %s AND %s)\
AND ((reconcile_id IS NULL)\
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active ' , (tuple(self.ACCOUNT_TYPE), form[str(i)]['start'], form[str(i)]['stop'], self.date_from,))
AND '+ dates_query + '\
AND account_account.active ' , args_list)
t = self.cr.fetchall()
d = {}
for i in t:

View File

@ -77,7 +77,7 @@ class account_aged_trial_balance(osv.osv_memory):
res[str(i)] = {
'name': (i!=0 and (str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))),
'stop': start.strftime('%Y-%m-%d'),
'start': (i!=0 and stop.strftime('%Y-%m-%d') or None),
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
}
start = stop - RelativeDateTime(days=1)
else:
@ -86,7 +86,7 @@ class account_aged_trial_balance(osv.osv_memory):
res[str(5-(i+1))] = {
'name' : (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
'start': start.strftime('%Y-%m-%d'),
'stop': (i!=4 and stop.strftime('%Y-%m-%d') or None),
'stop': (i!=4 and stop.strftime('%Y-%m-%d') or False),
}
start = stop + RelativeDateTime(days=1)
data['form'].update(res)

View File

@ -47,10 +47,9 @@ class account_bs_report(osv.osv_memory):
mod_obj = self.pool.get('ir.model.data')
res = super(account_bs_report, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)
doc = etree.XML(res['arch'])
nodes = doc.xpath("//field[@name='journal_ids']")
nodes = doc.xpath("//page[@name='journal_ids']")
for node in nodes:
node.set('readonly', '1')
node.set('required', '0')
node.set('invisible', '1')
res['arch'] = etree.tostring(doc)
return res
@ -78,4 +77,4 @@ class account_bs_report(osv.osv_memory):
account_bs_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,35 +8,27 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Report Options">
<group colspan="4" expand="1">
<field name="chart_account_id" widget='selection'/>
<field name="fiscalyear_id"/>
<group colspan="2" name='Journals'>
<notebook tabpos="up">
<page string="Journals" >
<notebook tabpos="up" colspan="4">
<page string="Filters" name="filters">
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" colspan="4"/>
<separator string="Dates" colspan="4"/>
<field name="date_from" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
<field name="date_to" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
<separator string="Periods" colspan="4"/>
<field name="period_from" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
<field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
</page>
<page string="Journals" name="journal_ids">
<field name="journal_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
</group>
<group colspan="2" name='Filters'>
<notebook tabpos="up">
<page string="Filters">
<field name="filter" on_change="onchange_filter(filter, fiscalyear_id)" />
<separator string="Dates" colspan="4"/>
<field name="date_from" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
<field name="date_to" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
<separator string="Periods" colspan="4"/>
<field name="period_from" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
<field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
</page>
</notebook>
</group>
<separator colspan="4"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" special="cancel" string="Cancel" colspan="2"/>
<button icon="gtk-print" name="check_report" string="Print" type="object" colspan="2" default_focus="1" />
</group>
</group>
</form>
</field>
</record>

View File

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
# Copyright (C) 2010-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
# Copyright (C) 2010-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
# Copyright (C) 2010-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

2
addons/email_template/wizard/__init__.py Executable file → Normal file
View File

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
# Copyright (C) 2010-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File

@ -3,7 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>)
# Copyright (C) 2010-2010 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View File