[IMP] Clean and improvements on all reports & wizards
bzr revid: mra@mra-laptop-20100803042554-gctua4lghmfjk1f4
This commit is contained in:
parent
ee906a9560
commit
4017f5dc13
|
@ -27,14 +27,6 @@ from common_report_header import common_report_header
|
||||||
class account_balance(report_sxw.rml_parse, common_report_header):
|
class account_balance(report_sxw.rml_parse, common_report_header):
|
||||||
_name = 'report.account.account.balance'
|
_name = 'report.account.account.balance'
|
||||||
|
|
||||||
def set_context(self, objects, data, ids, report_type=None):
|
|
||||||
new_ids = ids
|
|
||||||
if (data['model'] == 'ir.ui.menu'):
|
|
||||||
new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
|
|
||||||
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
|
||||||
self.query_get_clause = data['form'].get('query_line', False) or ''
|
|
||||||
return super(account_balance, self).set_context(objects, data, new_ids, report_type=report_type)
|
|
||||||
|
|
||||||
def __init__(self, cr, uid, name, context=None):
|
def __init__(self, cr, uid, name, context=None):
|
||||||
super(account_balance, self).__init__(cr, uid, name, context=context)
|
super(account_balance, self).__init__(cr, uid, name, context=context)
|
||||||
self.sum_debit = 0.00
|
self.sum_debit = 0.00
|
||||||
|
@ -57,6 +49,14 @@ class account_balance(report_sxw.rml_parse, common_report_header):
|
||||||
})
|
})
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|
||||||
|
def set_context(self, objects, data, ids, report_type=None):
|
||||||
|
new_ids = ids
|
||||||
|
if (data['model'] == 'ir.ui.menu'):
|
||||||
|
new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
|
||||||
|
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
||||||
|
self.query_get_clause = data['form'].get('query_line', False) or ''
|
||||||
|
return super(account_balance, self).set_context(objects, data, new_ids, report_type=report_type)
|
||||||
|
|
||||||
def _add_header(self, node, header=1):
|
def _add_header(self, node, header=1):
|
||||||
if header == 0:
|
if header == 0:
|
||||||
self.rml_header = ""
|
self.rml_header = ""
|
||||||
|
|
|
@ -23,9 +23,7 @@ import time
|
||||||
|
|
||||||
from common_report_header import common_report_header
|
from common_report_header import common_report_header
|
||||||
from report import report_sxw
|
from report import report_sxw
|
||||||
#
|
|
||||||
# Use period and Journal for selection or resources
|
|
||||||
#
|
|
||||||
class journal_print(report_sxw.rml_parse, common_report_header):
|
class journal_print(report_sxw.rml_parse, common_report_header):
|
||||||
|
|
||||||
def __init__(self, cr, uid, name, context=None):
|
def __init__(self, cr, uid, name, context=None):
|
||||||
|
@ -88,16 +86,15 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
||||||
'FROM account_move_line l '
|
'FROM account_move_line l '
|
||||||
'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
|
'LEFT JOIN account_journal j ON (l.journal_id=j.id) '
|
||||||
'LEFT JOIN res_currency c on (l.currency_id=c.id)'
|
'LEFT JOIN res_currency c on (l.currency_id=c.id)'
|
||||||
'WHERE period_id=%s AND journal_id IN %s '+self.query_get_clause +''
|
'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause + ''
|
||||||
'GROUP BY j.id, j.code, j.name, l.amount_currency,c.code,l.currency_id ',
|
'GROUP BY j.id, j.code, j.name, l.amount_currency,c.code, l.currency_id ',
|
||||||
(period_id, tuple(self.journal_ids)))
|
(period_id, tuple(self.journal_ids)))
|
||||||
|
|
||||||
return self.cr.dictfetchall()
|
return self.cr.dictfetchall()
|
||||||
|
|
||||||
def _set_get_account_currency_code(self, account_id):
|
def _set_get_account_currency_code(self, account_id):
|
||||||
self.cr.execute("SELECT c.code AS code "\
|
self.cr.execute("SELECT c.code AS code "\
|
||||||
"FROM res_currency c, account_account AS ac "\
|
"FROM res_currency c, account_account AS ac "\
|
||||||
"WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id))
|
"WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id))
|
||||||
result = self.cr.fetchone()
|
result = self.cr.fetchone()
|
||||||
if result:
|
if result:
|
||||||
self.account_currency = result[0]
|
self.account_currency = result[0]
|
||||||
|
@ -105,20 +102,19 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
||||||
self.account_currency = False
|
self.account_currency = False
|
||||||
|
|
||||||
def _get_account(self, data):
|
def _get_account(self, data):
|
||||||
if data['model']=='account.journal.period':
|
if data['model'] == 'account.journal.period':
|
||||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
|
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
|
||||||
return super(journal_print ,self)._get_account(data)
|
return super(journal_print ,self)._get_account(data)
|
||||||
|
|
||||||
def _get_fiscalyear(self, data):
|
def _get_fiscalyear(self, data):
|
||||||
if data['model']=='account.journal.period':
|
if data['model'] == 'account.journal.period':
|
||||||
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
|
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
|
||||||
return super(journal_print ,self)._get_fiscalyear(data)
|
return super(journal_print, self)._get_fiscalyear(data)
|
||||||
|
|
||||||
def _display_currency(self, data):
|
def _display_currency(self, data):
|
||||||
if data['model'] == 'account.journal.period':
|
if data['model'] == 'account.journal.period':
|
||||||
return True
|
return True
|
||||||
return data['form']['amount_currency']
|
return data['form']['amount_currency']
|
||||||
return res
|
|
||||||
|
|
||||||
def _sum_debit_period(self, period_id, journal_id=None):
|
def _sum_debit_period(self, period_id, journal_id=None):
|
||||||
journals = journal_id or self.journal_ids
|
journals = journal_id or self.journal_ids
|
||||||
|
|
|
@ -75,7 +75,6 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
self.context = context
|
self.context = context
|
||||||
|
|
||||||
def _sum_currency_amount_account(self, account, form):
|
def _sum_currency_amount_account(self, account, form):
|
||||||
#FIXME: not working
|
|
||||||
self.cr.execute("SELECT sum(l.amount_currency) AS tot_currency "\
|
self.cr.execute("SELECT sum(l.amount_currency) AS tot_currency "\
|
||||||
"FROM account_move_line l "\
|
"FROM account_move_line l "\
|
||||||
"WHERE l.account_id = %s AND %s" %(account.id, self.query))
|
"WHERE l.account_id = %s AND %s" %(account.id, self.query))
|
||||||
|
@ -84,7 +83,6 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
self.cr.execute("SELECT sum(l.amount_currency) AS tot_currency "\
|
self.cr.execute("SELECT sum(l.amount_currency) AS tot_currency "\
|
||||||
"FROM account_move_line l "\
|
"FROM account_move_line l "\
|
||||||
"WHERE l.account_id = %s AND %s "%(account.id, form['initial_bal_query']))
|
"WHERE l.account_id = %s AND %s "%(account.id, form['initial_bal_query']))
|
||||||
# Add initial balance to the result
|
|
||||||
sum_currency += self.cr.fetchone()[0] or 0.0
|
sum_currency += self.cr.fetchone()[0] or 0.0
|
||||||
return str(sum_currency)
|
return str(sum_currency)
|
||||||
|
|
||||||
|
@ -94,7 +92,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc):
|
for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc):
|
||||||
sql = """
|
sql = """
|
||||||
SELECT count(id)
|
SELECT count(id)
|
||||||
FROM account_move_line l
|
FROM account_move_line AS l
|
||||||
WHERE %s AND l.account_id = %%s
|
WHERE %s AND l.account_id = %%s
|
||||||
""" % (self.query)
|
""" % (self.query)
|
||||||
self.cr.execute(sql, (child_account.id,))
|
self.cr.execute(sql, (child_account.id,))
|
||||||
|
|
|
@ -23,9 +23,7 @@ import time
|
||||||
|
|
||||||
from common_report_header import common_report_header
|
from common_report_header import common_report_header
|
||||||
from report import report_sxw
|
from report import report_sxw
|
||||||
#
|
|
||||||
# Use period and Journal for selection or resources
|
|
||||||
#
|
|
||||||
class journal_print(report_sxw.rml_parse, common_report_header):
|
class journal_print(report_sxw.rml_parse, common_report_header):
|
||||||
|
|
||||||
def __init__(self, cr, uid, name, context=None):
|
def __init__(self, cr, uid, name, context=None):
|
||||||
|
@ -77,9 +75,9 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
||||||
return obj_mline.browse(self.cr, self.uid, ids)
|
return obj_mline.browse(self.cr, self.uid, ids)
|
||||||
|
|
||||||
def _set_get_account_currency_code(self, account_id):
|
def _set_get_account_currency_code(self, account_id):
|
||||||
self.cr.execute("SELECT c.code as code "\
|
self.cr.execute("SELECT c.code AS code "\
|
||||||
"FROM res_currency c,account_account as ac "\
|
"FROM res_currency c,account_account AS ac "\
|
||||||
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
|
"WHERE ac.id = %s AND ac.currency_id = c.id" % (account_id))
|
||||||
result = self.cr.fetchone()
|
result = self.cr.fetchone()
|
||||||
if result:
|
if result:
|
||||||
self.account_currency = result[0]
|
self.account_currency = result[0]
|
||||||
|
|
|
@ -68,9 +68,9 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||||
per_ids = self.pool.get('account.period').browse(self.cr, self.uid, form['periods'])
|
per_ids = self.pool.get('account.period').browse(self.cr, self.uid, form['periods'])
|
||||||
for r in per_ids:
|
for r in per_ids:
|
||||||
if r == per_ids[len(per_ids)-1]:
|
if r == per_ids[len(per_ids)-1]:
|
||||||
result+=r.name+". "
|
result += r.name + ". "
|
||||||
else:
|
else:
|
||||||
result+=r.name+", "
|
result += r.name + ", "
|
||||||
else:
|
else:
|
||||||
fy_obj = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear'])
|
fy_obj = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear'])
|
||||||
res = fy_obj.period_ids
|
res = fy_obj.period_ids
|
||||||
|
@ -99,13 +99,18 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||||
def set_context(self, objects, data, ids, report_type=None):
|
def set_context(self, objects, data, ids, report_type=None):
|
||||||
## Compute Code
|
## Compute Code
|
||||||
#
|
#
|
||||||
if (data['form']['result_selection'] == 'customer' ):
|
self.initial_balance = data['form'].get('initial_balance', True)
|
||||||
|
self.query = data['form'].get('query_line', '')
|
||||||
|
self.init_query = data['form'].get('initial_bal_query', '')
|
||||||
|
self.result_selection = data['form'].get('result_selection')
|
||||||
|
|
||||||
|
if (self.result_selection == 'customer' ):
|
||||||
self.ACCOUNT_TYPE = ('receivable',)
|
self.ACCOUNT_TYPE = ('receivable',)
|
||||||
elif (data['form']['result_selection'] == 'supplier'):
|
elif (self.result_selection == 'supplier'):
|
||||||
self.ACCOUNT_TYPE = ('payable',)
|
self.ACCOUNT_TYPE = ('payable',)
|
||||||
else:
|
else:
|
||||||
self.ACCOUNT_TYPE = ('payable', 'receivable')
|
self.ACCOUNT_TYPE = ('payable', 'receivable')
|
||||||
#
|
|
||||||
self.cr.execute("SELECT a.id " \
|
self.cr.execute("SELECT a.id " \
|
||||||
"FROM account_account a " \
|
"FROM account_account a " \
|
||||||
"LEFT JOIN account_account_type t " \
|
"LEFT JOIN account_account_type t " \
|
||||||
|
@ -113,10 +118,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||||
"WHERE a.type IN %s " \
|
"WHERE a.type IN %s " \
|
||||||
"AND a.active", (self.ACCOUNT_TYPE,))
|
"AND a.active", (self.ACCOUNT_TYPE,))
|
||||||
self.account_ids = [a for (a,) in self.cr.fetchall()]
|
self.account_ids = [a for (a,) in self.cr.fetchall()]
|
||||||
self.initial_balance = data['form']['initial_balance'] # for include initial balance
|
return super(partner_balance, self).set_context(objects, data, ids, report_type=report_type)
|
||||||
self.query = data['form'].get('query_line', '')
|
|
||||||
self.init_query = data['form'].get('initial_bal_query', '')
|
|
||||||
return super(partner_balance, self).set_context(objects, data, ids, report_type)
|
|
||||||
|
|
||||||
def lines(self, data):
|
def lines(self, data):
|
||||||
full_account = []
|
full_account = []
|
||||||
|
@ -140,7 +142,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||||
"FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
|
"FROM account_move_line l LEFT JOIN res_partner p ON (l.partner_id=p.id) " \
|
||||||
"JOIN account_account ac ON (l.account_id = ac.id)" \
|
"JOIN account_account ac ON (l.account_id = ac.id)" \
|
||||||
"WHERE ac.type IN %s " \
|
"WHERE ac.type IN %s " \
|
||||||
" AND " + self.query + "" \
|
"AND " + self.query + "" \
|
||||||
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
|
"GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \
|
||||||
"ORDER BY l.account_id,p.name",
|
"ORDER BY l.account_id,p.name",
|
||||||
(self.ACCOUNT_TYPE,))
|
(self.ACCOUNT_TYPE,))
|
||||||
|
@ -456,11 +458,11 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||||
return credit > debit and credit - debit
|
return credit > debit and credit - debit
|
||||||
|
|
||||||
def _get_partners(self, data):
|
def _get_partners(self, data):
|
||||||
if data['form']['result_selection'] == 'customer':
|
if self.result_selection == 'customer':
|
||||||
return 'Receivable Accounts'
|
return 'Receivable Accounts'
|
||||||
elif data['form']['result_selection'] == 'supplier':
|
elif self.result_selection == 'supplier':
|
||||||
return 'Payable Accounts'
|
return 'Payable Accounts'
|
||||||
elif data['form']['result_selection'] == 'customer_supplier':
|
elif self.result_selection == 'customer_supplier':
|
||||||
return 'Receivable and Payable Accounts'
|
return 'Receivable and Payable Accounts'
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
import datetime
|
|
||||||
|
|
||||||
import rml_parse
|
import rml_parse
|
||||||
from report import report_sxw
|
from report import report_sxw
|
||||||
|
@ -30,8 +29,6 @@ from common_report_header import common_report_header
|
||||||
class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
|
|
||||||
def __init__(self, cr, uid, name, context=None):
|
def __init__(self, cr, uid, name, context=None):
|
||||||
self.date_lst = []
|
|
||||||
self.date_lst_string = ''
|
|
||||||
super(third_party_ledger, self).__init__(cr, uid, name, context=context)
|
super(third_party_ledger, self).__init__(cr, uid, name, context=context)
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
|
@ -58,27 +55,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
'display_currency':self._display_currency,
|
'display_currency':self._display_currency,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def comma_me(self, amount):
|
|
||||||
if type(amount) is float :
|
|
||||||
amount = str('%.2f'%amount)
|
|
||||||
else :
|
|
||||||
amount = str(amount)
|
|
||||||
if (amount == '0'):
|
|
||||||
return ' '
|
|
||||||
orig = amount
|
|
||||||
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
|
||||||
if orig == new:
|
|
||||||
return new
|
|
||||||
else:
|
|
||||||
return self.comma_me(new)
|
|
||||||
|
|
||||||
def special_map(self):
|
|
||||||
string_map = ''
|
|
||||||
for date_string in self.date_lst:
|
|
||||||
string_map = date_string + ','
|
|
||||||
return string_map
|
|
||||||
|
|
||||||
def set_context(self, objects, data, ids, report_type=None):
|
def set_context(self, objects, data, ids, report_type=None):
|
||||||
self.query = data['form'].get('query_line', '')
|
self.query = data['form'].get('query_line', '')
|
||||||
self.init_query = data['form'].get('initial_bal_query', '')
|
self.init_query = data['form'].get('initial_bal_query', '')
|
||||||
|
@ -91,7 +67,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
## Si on imprime depuis les partenaires
|
## Si on imprime depuis les partenaires
|
||||||
if ids:
|
if ids:
|
||||||
PARTNER_REQUEST = "AND line.partner_id IN %s",(tuple(ids),)
|
PARTNER_REQUEST = "AND line.partner_id IN %s",(tuple(ids),)
|
||||||
|
|
||||||
if self.result_selection == 'supplier':
|
if self.result_selection == 'supplier':
|
||||||
self.ACCOUNT_TYPE = ['payable']
|
self.ACCOUNT_TYPE = ['payable']
|
||||||
elif self.result_selection == 'customer':
|
elif self.result_selection == 'customer':
|
||||||
|
@ -108,7 +83,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
"AND a.active", (tuple(self.ACCOUNT_TYPE), ))
|
"AND a.active", (tuple(self.ACCOUNT_TYPE), ))
|
||||||
self.account_ids = [a for (a,) in self.cr.fetchall()]
|
self.account_ids = [a for (a,) in self.cr.fetchall()]
|
||||||
partner_to_use = []
|
partner_to_use = []
|
||||||
|
|
||||||
self.cr.execute(
|
self.cr.execute(
|
||||||
"SELECT DISTINCT l.partner_id " \
|
"SELECT DISTINCT l.partner_id " \
|
||||||
"FROM account_move_line AS l, account_account AS account " \
|
"FROM account_move_line AS l, account_account AS account " \
|
||||||
|
@ -122,11 +96,25 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
|
|
||||||
res = self.cr.dictfetchall()
|
res = self.cr.dictfetchall()
|
||||||
for res_line in res:
|
for res_line in res:
|
||||||
partner_to_use.append(res_line['partner_id'])
|
partner_to_use.append(res_line['partner_id'])
|
||||||
new_ids = partner_to_use
|
new_ids = partner_to_use
|
||||||
self.partner_ids = new_ids
|
self.partner_ids = new_ids
|
||||||
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
|
objects = self.pool.get('res.partner').browse(self.cr, self.uid, new_ids)
|
||||||
super(third_party_ledger, self).set_context(objects, data, new_ids, report_type)
|
return super(third_party_ledger, self).set_context(objects, data, new_ids, report_type)
|
||||||
|
|
||||||
|
def comma_me(self, amount):
|
||||||
|
if type(amount) is float :
|
||||||
|
amount = str('%.2f'%amount)
|
||||||
|
else :
|
||||||
|
amount = str(amount)
|
||||||
|
if (amount == '0'):
|
||||||
|
return ' '
|
||||||
|
orig = amount
|
||||||
|
new = re.sub("^(-?\d+)(\d{3})", "\g<1>'\g<2>", amount)
|
||||||
|
if orig == new:
|
||||||
|
return new
|
||||||
|
else:
|
||||||
|
return self.comma_me(new)
|
||||||
|
|
||||||
def lines(self, partner):
|
def lines(self, partner):
|
||||||
full_account = []
|
full_account = []
|
||||||
|
@ -162,8 +150,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||||
"AND reconcile_id IS NULL " \
|
"AND reconcile_id IS NULL " \
|
||||||
"AND " + self.init_query + " ",
|
"AND " + self.init_query + " ",
|
||||||
(partner.id, tuple(self.account_ids)))
|
(partner.id, tuple(self.account_ids)))
|
||||||
res = self.cr.fetchall()
|
return self.cr.fetchall()
|
||||||
return res
|
|
||||||
|
|
||||||
def _sum_debit_partner(self, partner):
|
def _sum_debit_partner(self, partner):
|
||||||
result_tmp = 0.0
|
result_tmp = 0.0
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
from mx.DateTime import *
|
from mx.DateTime import *
|
||||||
|
|
|
@ -63,13 +63,13 @@ class account_bs_report(osv.osv_memory):
|
||||||
'type': 'ir.actions.report.xml',
|
'type': 'ir.actions.report.xml',
|
||||||
'report_name': 'account.balancesheet.horizontal',
|
'report_name': 'account.balancesheet.horizontal',
|
||||||
'datas': data,
|
'datas': data,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
return {
|
return {
|
||||||
'type': 'ir.actions.report.xml',
|
'type': 'ir.actions.report.xml',
|
||||||
'report_name': 'account.balancesheet',
|
'report_name': 'account.balancesheet',
|
||||||
'datas': data,
|
'datas': data,
|
||||||
}
|
}
|
||||||
|
|
||||||
account_bs_report()
|
account_bs_report()
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ from lxml import etree
|
||||||
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
import tools
|
|
||||||
|
|
||||||
class account_common_report(osv.osv_memory):
|
class account_common_report(osv.osv_memory):
|
||||||
_name = "account.common.report"
|
_name = "account.common.report"
|
||||||
|
@ -82,7 +81,7 @@ class account_common_report(osv.osv_memory):
|
||||||
'journal_ids': _get_all_journal,
|
'journal_ids': _get_all_journal,
|
||||||
'filter': 'filter_no',
|
'filter': 'filter_no',
|
||||||
'chart_account_id': _get_account,
|
'chart_account_id': _get_account,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _build_periods(self, cr, uid, period_from, period_to):
|
def _build_periods(self, cr, uid, period_from, period_to):
|
||||||
period_obj = self.pool.get('account.period')
|
period_obj = self.pool.get('account.period')
|
||||||
|
|
|
@ -26,7 +26,7 @@ class account_common_journal_report(osv.osv_memory):
|
||||||
_description = 'Account Common Journal Report'
|
_description = 'Account Common Journal Report'
|
||||||
_inherit = "account.common.report"
|
_inherit = "account.common.report"
|
||||||
_columns = {
|
_columns = {
|
||||||
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
|
'amount_currency': fields.boolean("With Currency", help="Print Report with the currency column if the currency is different then the company currency"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _build_context(self, cr, uid, ids, data, context=None):
|
def _build_context(self, cr, uid, ids, data, context=None):
|
||||||
|
|
|
@ -9,31 +9,31 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Report Options">
|
<form string="Report Options">
|
||||||
<group height="500" width="800">
|
<group height="500" width="800">
|
||||||
<field name="chart_account_id" widget='selection'/>
|
<field name="chart_account_id" widget='selection'/>
|
||||||
<field name="fiscalyear_id"/>
|
<field name="fiscalyear_id"/>
|
||||||
<group colspan="2" name='Journals'>
|
<group colspan="2" name='Journals'>
|
||||||
<notebook tabpos="up">
|
<notebook tabpos="up">
|
||||||
<page string="Journals" >
|
<page string="Journals" >
|
||||||
<field name="journal_ids" colspan="4" nolabel="1"/>
|
<field name="journal_ids" colspan="4" nolabel="1"/>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</group>
|
</group>
|
||||||
<group colspan="2" name='Filters'>
|
<group colspan="2" name='Filters'>
|
||||||
<notebook tabpos="up">
|
<notebook tabpos="up">
|
||||||
<page string="Filters">
|
<page string="Filters">
|
||||||
<field name="filter" on_change="onchange_filter(filter)" />
|
<field name="filter" on_change="onchange_filter(filter)" />
|
||||||
<separator string="Dates" 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_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"/>
|
<field name="date_to" attrs="{'readonly':[('filter', '!=', 'filter_date')], 'required':[('filter', '=', 'filter_date')]}" colspan="4"/>
|
||||||
<separator string="Periods" 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_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"/>
|
<field name="period_to" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}" colspan="4"/>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</group>
|
</group>
|
||||||
<newline/>
|
<newline/>
|
||||||
<button icon="gtk-cancel" special="cancel" string="Cancel" colspan="2"/>
|
<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" />
|
<button icon="gtk-print" name="check_report" string="Print" type="object" colspan="2" default_focus="1" />
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|
Loading…
Reference in New Issue