@@ -92,335 +91,93 @@
-
-
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
-
+ [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
+
+ | Date |
+ JNRL |
+ Partner |
+ Ref |
+ Mvt |
+ Entry Label |
+ Counterpart |
+ Debit |
+ Credit |
+ Balance |
+ Currency |
+
+ [[ repeatIn(objects, 'a') ]]
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
+
+
+
+
+ | [[ o.code ]] [[ o.name ]] |
+ |
+ [[ sum_debit_account(o, data['form']) or '0.0' ]] |
+ [[ sum_credit_account(o, data['form']) or '0.0' ]] |
+ [[ sum_solde_account(o, data['form']) or '0.0' ]] |
+ [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] |
+
+
+ |
+
+
+ [[ repeatIn(lines(o, data['form']), 'line') ]]
+ | [[ line['date'] ]] |
+ [[ line['code'] ]] |
+ [[ line['partner'] ]] |
+ [[ line['ref'] ]] |
+ [[ line['move'] ]] |
+ [[ line['name'] ]] |
+ [[ strip_name(line['line_corresp'],55) ]] |
+ [[ line['debit'] and line['debit'] or '0.0' ]] |
+ [[ line['credit'] and line['credit'] or '0.0' ]] |
+ [[ line['progress'] and line['progress'] or '0.0' ]] |
+ [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]] |
+
+
+
+ [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
+
+ | Date |
+ JNRL |
+ Partner |
+ Ref |
+ Mvt |
+ Entry Label |
+ Counterpart |
+ Debit |
+ Credit |
+ Balance |
+
+ [[ repeatIn(objects, 'a') ]]
+ [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
|
-
- Date
- |
-
-
- JNRL
- |
-
-
- Partner
- |
-
-
- Ref
- |
-
-
- Mvt
- |
-
-
- Entry Label
- |
-
-
- Counterpart
- |
-
-
- Debit
- |
-
-
- Credit
- |
-
-
- Balance
- |
-
-
- Currency
- |
+
+
+ | [[ o.code ]] [[ o.name ]] |
+ |
+ [[ sum_debit_account(o, data['form']) or '0.0']] |
+ [[sum_credit_account(o, data['form']) or '0.0']] |
+ [[sum_solde_account(o, data['form']) or '0.0' ]] |
+
+
+
-
- [[ repeatIn(objects, 'a') ]]
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
-
-
-
-
-
-
-
-
- | [[ o.code ]] [[ o.name ]] |
- |
-
- [[ sum_debit_account(o, data['form']) or '0.0' ]]
- |
-
- [[ sum_credit_account(o, data['form']) or '0.0' ]]
- |
-
- [[ sum_solde_account(o, data['form']) or '0.0' ]]
- |
-
-
- [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]
- |
-
-
- |
-
- [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
- |
- Balance Initial
- |
-
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
- [[ o.init_debit or '0.0' ]]
- |
-
- [[ o.init_credit or '0.0' ]]
- |
-
- [[ (o.init_debit - o.init_credit) or '0.0' ]]
- |
-
-
- |
-
+
+ [[ repeatIn(lines(o, data['form']), 'line') ]]
+ | [[ line['date'] ]] |
+ [[ line['code'] ]] |
+ [[ line['partner'] ]] |
+ [[ line['ref'] ]] |
+ [[ line['move'] ]] |
+ [[ line['name'] ]] |
+ [[ strip_name(line['line_corresp'],55) ]] |
+ [[ line['debit'] and line['debit'] or '0.0' ]] |
+ [[ line['credit'] and line['credit'] or '0.0' ]] |
+ [[ line['progress'] and line['progress'] or '0.0' ]] |
-
-
- [[ repeatIn(lines(o, data['form']), 'line') ]]
- |
-
- [[ line['date'] ]]
- |
-
- [[ line['code'] ]]
- |
-
- [[ line['partner'] ]]
- |
-
- [[ line['ref'] ]]
- |
-
- [[ line['move'] ]]
- |
-
- [[ line['name'] ]]
- |
-
- [[ strip_name(line['line_corresp'],55) ]]
- |
-
- [[ line['debit'] and line['debit'] or '0.0' ]]
- |
-
- [[ line['credit'] and line['credit'] or '0.0' ]]
- |
-
- [[ line['progress'] and line['progress'] or '0.0' ]]
- |
-
- [[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]
- |
-
-
-
- |
-
-
-
-
-
-
-
- [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
-
- |
-
-
-
- Date
- |
-
-
-
-
- JNRL
- |
-
-
-
-
- Partner
- |
-
-
-
-
- Ref
- |
-
-
-
-
- Mvt
- |
-
-
-
-
- Entry Label
- |
-
-
-
-
- Counterpart
- |
-
-
-
-
- Debit
- |
-
-
-
-
- Credit
- |
-
-
-
-
- Balance
- |
-
-
-
-
- [[ repeatIn(objects, 'a') ]]
- [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
- [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
-
-
-
-
- | [[ o.code ]] [[ o.name ]] |
- |
-
- [[ sum_debit_account(o, data['form']) or '0.0']]
- |
-
- [[sum_credit_account(o, data['form']) or '0.0']]
- |
-
- [[sum_solde_account(o, data['form']) or '0.0' ]]
- |
-
-
- |
-
- [[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
- |
-
- |
-
-
- Solde Initial
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- |
-
-
- [[ o.init_debit or '0.0' ]]
- |
-
- [[ o.init_credit or '0.0' ]]
- |
-
- [[ o.init_debit - o.init_credit or '0.0' ]]
- |
-
-
- [[ repeatIn(lines(o, data['form']), 'line') ]]
- |
- [[ line['date'] ]]
- |
-
- [[ line['code'] ]]
- |
-
- [[ line['partner'] ]]
- |
-
- [[ line['ref'] ]]
- |
-
- [[ line['move'] ]]
- |
-
- [[ line['name'] ]]
- |
-
- [[ strip_name(line['line_corresp'],55) ]]
- |
-
- [[ line['debit'] and line['debit'] or '0.0' ]]
- |
-
- [[ line['credit'] and line['credit'] or '0.0' ]]
- |
-
- [[ line['progress'] and line['progress'] or '0.0' ]]
- |
-
-
-
- |
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py
index 519456527c8..23d4e54fa55 100644
--- a/addons/account/report/partner_balance.py
+++ b/addons/account/report/partner_balance.py
@@ -73,7 +73,8 @@ class partner_balance(report_sxw.rml_parse):
## Get All Period Date
#
# If we have no period we will take all perdio in the FiscalYear.
- print"data['form']['periods'][0][2]",data['form']['periods'][0][2]
+
+
if not data['form']['periods'][0][2] :
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
else:
@@ -116,15 +117,14 @@ class partner_balance(report_sxw.rml_parse):
else :
stop_date = date_stop_date
- print"===start_date===",start_date
- print"===stop_date===",stop_date
+
final_date_array = []
final_date_array = final_date_array + self.date_range(start_date,stop_date)
self.date_lst = final_date_array
self.date_lst.sort()
def transform_none_into_date_array(self,data):
- print"======transform_none_into_date_array====="
+
sql = "SELECT min(date) as start_date from account_move_line"
self.cr.execute(sql)
start_date = self.cr.fetchone()[0]
@@ -132,7 +132,7 @@ class partner_balance(report_sxw.rml_parse):
sql = "SELECT max(date) as start_date from account_move_line"
self.cr.execute(sql)
stop_date = self.cr.fetchone()[0]
- print"stop_date",stop_date
+
array = []
array = array + self.date_range(start_date,stop_date)
@@ -159,16 +159,16 @@ class partner_balance(report_sxw.rml_parse):
#
#
if data['form']['state'] == 'none':
- print"========none=========="
+
self.transform_none_into_date_array(data)
elif data['form']['state'] == 'bydate':
- print"========bydate=========="
+
self.transform_date_into_date_array(data)
elif data['form']['state'] == 'byperiod':
- print"========byperiod=========="
+
self.transform_period_into_date_array(data)
elif data['form']['state'] == 'all':
- print"========both=========="
+
self.transform_both_into_date_array(data)
@@ -213,7 +213,7 @@ class partner_balance(report_sxw.rml_parse):
#
#
if data['form']['soldeinit'] :
- print"=====self.date_lst[0]=====",self.date_lst[0]
+
self.cr.execute(
"SELECT p.ref, p.name,l.account_id,ac.name as account_name,ac.code as code , sum(debit) as debit, sum(credit) as credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
@@ -525,7 +525,7 @@ class partner_balance(report_sxw.rml_parse):
'l.date IN (' + self.date_lst_string + ') ' \
'GROUP BY partner_id')
a = self.cr.fetchone()[0]
- print"====self.cr.fetchone()====",a
+
if self.cr.fetchone() != None:
result_tmp = result_tmp + (a or 0.0)
else:
@@ -555,7 +555,7 @@ class partner_balance(report_sxw.rml_parse):
'AND l.reconcile_id IS NULL ' \
'GROUP BY partner_id',
(self.date_lst[0],))
- print"self.cr.fetchone()[0]",self.cr.fetchone()
+
if self.cr.fetchone() != None:
result_tmp = float(self.cr.fetchone()[0]) or 0.0
else:
diff --git a/addons/account/report/third_party_ledger.rml b/addons/account/report/third_party_ledger.rml
index d19a3395544..ace35b27556 100755
--- a/addons/account/report/third_party_ledger.rml
+++ b/addons/account/report/third_party_ledger.rml
@@ -217,13 +217,13 @@
- [[ (line['debit']) or '' ]]
+ [[ (line['debit']) or '0.0' ]]
|
- [[ (line['credit']) or '' ]]
+ [[ (line['credit']) or '0.0' ]]
|
- [[ (line['progress']) or '' ]]
+ [[ (line['progress']) or '0.0' ]]
|
diff --git a/addons/account/report/wizard_central_journal.rml b/addons/account/report/wizard_central_journal.rml
new file mode 100644
index 00000000000..4c0b037971a
--- /dev/null
+++ b/addons/account/report/wizard_central_journal.rml
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+ [[ company.name ]]
+ Central Journal-[[ company.currency_id.name ]]
+
+
+
+
+
+ [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
+ Page
+
+
+
+
+ 1cm 27.7cm 20cm 27.7cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(objects, 'o') ]]
+ [[ repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]), 'line') ]]
+
+
+ |
+ Journal Code
+ |
+
+ Journal Name
+ |
+
+ Printing Date
+ |
+
+
+
+
+ |
+ [[ line[0]['journal'].code or '' ]]
+ |
+
+ [[ line[0]['journal'].name ]]
+ |
+
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+ Account Num.
+ |
+
+ Account Name
+ |
+
+ Debit
+ |
+
+ Credit
+ |
+
+
+
+
+
+
+ |
+ Total:
+ |
+
+
+
+
+ |
+
+ [[ '%.2f' % sum_debit(line[0]['period'].id, line[0]['journal'].id) ]]
+ |
+
+ [[ '%.2f' % sum_credit(line[0]['period'].id, line[0]['journal'].id) ]]
+ |
+
+
+ |
+
+
+
+
+
+ [[repeatIn(line,'l')]]
+
+ |
+ [[ l['code'] ]]
+ |
+
+ [[ l['name'] ]]
+ |
+
+ [[ formatLang(l['debit']) and '%.2f' % l['debit'] or '0.00' ]]
+ |
+
+ [[ formatLang(l['credit']) and '%.2f' % l['credit'] or '0.00' ]]
+ |
+
+
+ |
+
+
+
+
+
+
+
diff --git a/addons/account/report/wizard_general_journal.rml b/addons/account/report/wizard_general_journal.rml
new file mode 100644
index 00000000000..e61aa9b2267
--- /dev/null
+++ b/addons/account/report/wizard_general_journal.rml
@@ -0,0 +1,250 @@
+
+
+
+
+
+
+
+
+
+
+
+ [[ company.name ]]
+ General Journal - [[ company.currency_id.name ]]
+
+
+
+
+
+ [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]
+ Page
+
+
+
+
+ 1cm 27.7cm 20cm 27.7cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Printing Date :
+ |
+
+ [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ Jrl Code
+ |
+
+ Journal Name
+ |
+
+ Period
+ |
+
+ Debit Trans.
+ |
+
+ Credit Trans.
+ |
+
+
+
+
+
+ |
+ Total:
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+ [[ '%.2f' % sum_debit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]
+ |
+
+ [[ '%.2f' % sum_credit(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]) ]]
+ |
+
+
+ |
+
+
+
+
+
+ [[ repeatIn( lines( data['form']['period_id'][0][2], data['form']['journal_id'][0][2] ),'line')]]
+
+
+ |
+ [[ line[0]['period_name'] ]] :
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+ [[ '%.2f' % sum_debit_period( line[0]['pid'],data['form']['journal_id'][0][2]) ]]
+ |
+
+ [[ '%.2f' % sum_credit_period(line[0]['pid'],data['form']['journal_id'][0][2]) ]]
+ |
+
+
+
+
+
+ |
+ [[ repeatIn(line,'l') ]]
+ [[ l['code'] ]]
+ |
+
+ [[ l['name'] ]]
+ |
+
+ [[ line[0]['period_name'] ]]
+ |
+
+ [[ l['debit'] and ('%.2f' % l['debit']) or '' ]]
+ |
+
+ [[ l['credit'] and ('%.2f' % l['credit']) or '' ]]
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 9dbdcb18b55..d231315c175 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -13,6 +13,7 @@
"access_account_journal_period_manager","account.journal.period manager","model_account_journal_period","account.group_account_manager",1,1,1,1
"access_account_journal_period","account.journal.period","model_account_journal_period","account.group_account_user",1,1,1,1
"access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1
+"access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1
"access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1
"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0
"access_account_tax","account.tax","model_account_tax",,1,0,0,0
@@ -27,7 +28,6 @@
"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_wizard_multi_charts_accounts","wizard.multi.charts.accounts","model_wizard_multi_charts_accounts","account.group_account_manager",1,1,1,1
"access_account_bank_accounts_wizard","account.bank.accounts.wizard","model_account_bank_accounts_wizard","account.group_account_manager",1,1,1,1
-"access_account_move_line","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile","account.bank.statement.reconcile","model_account_bank_statement_reconcile","account.group_account_user",1,1,1,1
"access_account_bank_statement_reconcile_line","account.bank.statement.reconcile.line","model_account_bank_statement_reconcile_line","account.group_account_user",1,1,1,1
@@ -41,6 +41,7 @@
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1
"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,1,1,1
+"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
@@ -66,16 +67,14 @@
"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
"access_account_config_wizard_account_manager","account.config.wizard account manager","model_account_config_wizard","group_account_manager",1,1,1,1
"access_account_config_wizard_system_manager","account.config.wizard system manager","model_account_config_wizard","base.group_system",1,1,1,1
-"access_account_invoice_partner_manager","account.invoice partner manager","model_account_invoice","base.group_partner_manager",1,0,0,0
-"access_account_invoice_line_partner_manager","account.invoice.line partner manager","model_account_invoice_line","base.group_partner_manager",1,0,0,0
-"access_account_invoice_tax_partner_manager","account.invoice.tax partner manager","model_account_invoice_tax","base.group_partner_manager",1,0,0,0
+"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
+"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
+"access_account_invoice_user","account.invoice.tax user","model_account_invoice_tax","base.group_user",1,0,0,0
"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
-"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
-"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,1,1,1
-"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
+"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index 3cae8e78a95..aa26e3f8e9d 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -65,6 +65,8 @@ import wizard_state_open
import wizard_statement_from_invoice
import wizard_print_journal
+import wizard_central_journal
+import wizard_general_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py
index 3677f51f050..7ae386a10f5 100644
--- a/addons/account/wizard/wizard_account_balance_report.py
+++ b/addons/account/wizard/wizard_account_balance_report.py
@@ -30,37 +30,38 @@ import wizard
import pooler
import time
-report_type = '''
-'''
-
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'display_account':{'string':"Filter on Accounts",'type':'selection','selection':[('bal_mouvement','With Entries'),('bal_all','All Accounts'),('bal_solde','With Balance Different Than 0')]}
-}
-
-
period_form = '''
'''
-
-
period_fields = {
+ 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
+ 'state':{
+ 'string':"Date/Period Filter",
+ 'type':'selection',
+ 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
+ 'default': lambda *a:'bydate'
+ },
'fiscalyear': {
'string':'Fiscal year',
'type':'many2one',
@@ -68,7 +69,9 @@ period_fields = {
'help':'Keep empty for all open fiscal year'
},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]}
+ 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With Movements'),('bal_solde','With Balance != 0'),('bal_all','All')]},
+ 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+ 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
}
account_form = '''
@@ -80,9 +83,14 @@ account_fields = {
'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
-
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
+ if user.company_id:
+ company_id = user.company_id.id
+ else:
+ company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
+ data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
@@ -90,17 +98,20 @@ class wizard_report(wizard.interface):
data['form']['display_account']='bal_all'
return data['form']
- def _get_defaults_fordate(self, cr, uid, data, context):
- data['form']['display_account']='bal_all'
+ def _check_state(self, cr, uid, data, context):
+
+ if data['form']['state'] == 'bydate':
+ self._check_date(cr, uid, data, context)
+ data['form']['fiscalyear'] = 0
+ else :
+ data['form']['fiscalyear'] = 1
return data['form']
-
-
+
def _check_path(self, cr, uid, data, context):
if data['model'] == 'account.account':
- return 'checktype'
+ return 'checktype'
else:
- return 'account_selection'
-
+ return 'account_selection'
def _check_date(self, cr, uid, data, context):
sql = """
@@ -112,7 +123,6 @@ class wizard_report(wizard.interface):
raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop'])
else:
return 'report'
-
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
@@ -127,27 +137,12 @@ class wizard_report(wizard.interface):
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
},
'checktype': {
- 'actions': [],
- 'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
- },
- 'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('report','Print')]}
},
- 'with_date': {
- 'actions': [_get_defaults_fordate],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
- },
- 'checkdate': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_date}
- },
-
'report': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.account.balance', 'state':'end'}
}
}
wizard_report('account.account.balance.report')
-
-
diff --git a/addons/account/wizard/wizard_central_journal.py b/addons/account/wizard/wizard_central_journal.py
new file mode 100644
index 00000000000..db4002bc084
--- /dev/null
+++ b/addons/account/wizard/wizard_central_journal.py
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# 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 the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+
+form = '''
+'''
+
+fields = {
+ 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
+ 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
+}
+
+
+class wizard_print_journal(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
+ },
+ 'print': {
+ 'actions': [],
+ 'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
+ },
+ }
+wizard_print_journal('account.central.journal.report')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_general_journal.py b/addons/account/wizard/wizard_general_journal.py
new file mode 100644
index 00000000000..5b72a944ea1
--- /dev/null
+++ b/addons/account/wizard/wizard_general_journal.py
@@ -0,0 +1,60 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
+#
+# $Id$
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# 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 the Free Software Foundation; either version 2
+# 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+##############################################################################
+
+import wizard
+import pooler
+
+form = '''
+'''
+
+fields = {
+ 'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
+ 'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
+}
+
+
+class wizard_print_journal(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
+ },
+ 'print': {
+ 'actions': [],
+ 'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
+ },
+ }
+wizard_print_journal('account.general.journal.report')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py
index c4a2f2a7438..2ba3b2b0a1f 100644
--- a/addons/account/wizard/wizard_general_ledger_report.py
+++ b/addons/account/wizard/wizard_general_ledger_report.py
@@ -29,64 +29,94 @@ import pooler
import locale
import time
-report_type = '''
-'''
-
-dates_form = '''
-'''
-
-dates_fields = {
- 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
- 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
- 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
- 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
- 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
-
-}
+#report_type = '''
+#'''
+#
+#dates_form = '''
+#'''
+#
+#dates_fields = {
+# 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+# 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+# 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
+# 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
+# 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
+# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
+# 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
+#
+#}
account_form = '''
-'''
account_fields = {
- 'Account_list': {'string':'Account', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
+ 'Account_list': {'string':'Chart of Accounts', 'type':'many2one', 'relation':'account.account', 'required':True ,'domain':[('parent_id','=',False)]},
}
-
-
-
period_form = '''
-'''
period_fields = {
+ 'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
+ 'state':{
+ 'string':"Date/Period Filter",
+ 'type':'selection',
+ 'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
+ 'default': lambda *a:'bydate'
+ },
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
'help': 'Keep empty for all open fiscal year'},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
- 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
+ 'landscape':{'string':"Landscape Mode",'type':'boolean'},
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
- 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
+ 'amount_currency':{'string':"With Currency",'type':'boolean'},
+ 'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
+ 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
+
}
def _check_path(self, cr, uid, data, context):
if data['model'] == 'account.account':
@@ -101,6 +131,7 @@ def _check(self, cr, uid, data, context):
return 'report'
def _check_date(self, cr, uid, data, context):
+
sql = """
SELECT f.id, f.date_start, f.date_stop FROM account_fiscalyear f Where '%s' between f.date_start and f.date_stop """%(data['form']['date_from'])
cr.execute(sql)
@@ -113,24 +144,36 @@ def _check_date(self, cr, uid, data, context):
else:
raise wizard.except_wizard('UserError','Date not in a defined fiscal year')
+
+def _check_state(self, cr, uid, data, context):
+
+ if data['form']['state'] == 'bydate':
+ _check_date(self, cr, uid, data, context)
+ data['form']['fiscalyear'] = 0
+ else :
+
+ data['form']['fiscalyear'] = 1
+ return data['form']
class wizard_report(wizard.interface):
def _get_defaults(self, cr, uid, data, context):
+ user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
+ if user.company_id:
+ company_id = user.company_id.id
+ else:
+ company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
+ data['form']['company_id'] = company_id
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
+
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
+ periods_obj=pooler.get_pool(cr.dbname).get('account.period')
+ data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
data['form']['sortbydate'] = 'sort_date'
data['form']['display_account']='bal_all'
data['form']['landscape']=True
data['form']['amount_currency'] = True
return data['form']
- def _get_defaults_fordate(self, cr, uid, data, context):
- data['form']['sortbydate'] = 'sort_date'
- data['form']['display_account']='bal_all'
- data['form']['landscape']=True
- data['form']['amount_currency'] = True
- return data['form']
-
states = {
'init': {
@@ -142,31 +185,19 @@ class wizard_report(wizard.interface):
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
},
'checktype': {
- 'actions': [],
- 'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
- },
- 'with_period': {
'actions': [_get_defaults],
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('checkreport','Print')]}
},
- 'with_date': {
- 'actions': [_get_defaults_fordate],
- 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
- },
- 'checkdate': {
- 'actions': [],
- 'result': {'type':'choice','next_state':_check_date}
- },
'checkreport': {
'actions': [],
'result': {'type':'choice','next_state':_check}
},
'report_landscape': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.general.ledger_landscape', 'state':'end'}
},
'report': {
- 'actions': [],
+ 'actions': [_check_state],
'result': {'type':'print', 'report':'account.general.ledger', 'state':'end'}
}
}
diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py
index 5b28e10ceb9..470e3e23955 100644
--- a/addons/account/wizard/wizard_partner_balance_report.py
+++ b/addons/account/wizard/wizard_partner_balance_report.py
@@ -30,7 +30,7 @@ import wizard
import pooler
period_form = '''
-