@@ -496,19 +496,19 @@
[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
|
- [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]]
+ [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]]
|
- [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]
+ [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]
|
- [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]
+ [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]
|
- [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
|
- [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]
+ [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]
|
@@ -526,7 +526,7 @@
[[ line['lcode'] ]]
|
- [[ strip_name(line['partner_name'],21) ]]
+ [[ strip_name(line['partner_name'],20) ]]
|
[[ strip_name(line['lref'],17) ]]
@@ -535,7 +535,7 @@
[[ line['move'] ]]
|
- [[ strip_name(line['lname'],26) ]]
+ [[ strip_name(line['lname'],22) ]]
|
[[ strip_name(line['line_corresp'],18) ]]
@@ -598,16 +598,16 @@
[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
- [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]]
+ [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]]
|
- [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]
+ [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]
|
- [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]
+ [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]
|
- [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
|
@@ -625,7 +625,7 @@
[[ line['lcode'] ]]
|
- [[ strip_name(line['partner_name'],25) ]]
+ [[ strip_name(line['partner_name'],24) ]]
|
[[ strip_name(line['lref'],21) ]]
@@ -634,7 +634,7 @@
[[ line['move'] ]]
|
- [[ strip_name(line['lname'],35) ]]
+ [[ strip_name(line['lname'],28) ]]
|
[[ strip_name(line['line_corresp'],23) ]]
diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml
index a81c634ddc8..9b0ac55bb56 100644
--- a/addons/account/report/account_journal.rml
+++ b/addons/account/report/account_journal.rml
@@ -229,7 +229,7 @@
- [[ display_currency(data) == False or removeParentNode('blockTable') ]]
+ [[ display_currency(data) == False or removeParentNode('blockTable') ]]
| Date |
Ref |
@@ -256,14 +256,14 @@
[[ strip_name(line.ref,20) ]] |
[[ line.move_id.name <> '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]] |
[[ line.account_id.code ]] |
- [[ line.partner_id and strip_name(line.partner_id.name,16) ]] |
- [[ strip_name(line.name,35) ]] |
+ [[ line.partner_id and strip_name(line.partner_id.name,17) ]] |
+ [[ strip_name(line.name,27) ]] |
[[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]] |
[[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]] |
- [[ display_currency(data) or removeParentNode('blockTable') ]]
+ [[ display_currency(data) or removeParentNode('blockTable') ]]
| Date |
Ref |
@@ -293,7 +293,7 @@
[[ strip_name(line.ref,20) ]] |
[[ line.move_id.name <> '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]] |
[[ line.account_id.code ]] |
- [[ line.partner_id and strip_name(line.partner_id.name,16) ]] |
+ [[ line.partner_id and strip_name(line.partner_id.name,15) ]] |
[[ strip_name(line.name,17) ]] |
[[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]] |
[[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]] |
diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml
index 1a32bc13bde..69faa977da1 100644
--- a/addons/account/report/account_partner_ledger.rml
+++ b/addons/account/report/account_partner_ledger.rml
@@ -262,11 +262,11 @@
-
+
-
+
@@ -274,67 +274,65 @@
-
- [[ display_currency(data) == False or removeParentNode('blockTable') ]]
-
- |
- Date
- |
-
- JNRL
- |
-
- Ref
- |
-
- Account
- |
-
- Entry Label
- |
-
- Debit
- |
-
- Credit
- |
-
- Balance
- |
-
-
-
- [[ display_currency(data) == True or removeParentNode('blockTable') ]]
-
- |
- Date
- |
-
- JNRL
- |
-
- Ref
- |
-
- Account
- |
-
- Entry Label
- |
-
- Debit
- |
-
- Credit
- |
-
- Balance
- |
-
- Currency
- |
-
-
+
+
+ |
+ Date
+ |
+
+ JNRL
+ |
+
+ Ref
+ |
+
+ Account
+ |
+
+ Entry Label
+ |
+
+ Debit
+ |
+
+ Credit
+ |
+
+ Balance
+ |
+
+
+
+
+ |
+ Date
+ |
+
+ JNRL
+ |
+
+ Ref
+ |
+
+ Account
+ |
+
+ Entry Label
+ |
+
+ Debit
+ |
+
+ Credit
+ |
+
+ Balance
+ |
+
+ Currency
+ |
+
+
[[ repeatIn(objects, 'p') ]]
[[ setLang(p.lang) ]]
@@ -439,7 +437,7 @@
[[ display_currency(data) == False or removeParentNode('section') ]]
-
+
Date
@@ -490,47 +488,47 @@
|
- Initial Balance
+ Initial Balance
|
- [[ formatLang(get_intial_balance(p)[0][0])]]
+ [[ formatLang(get_intial_balance(p)[0][0])]]
|
- [[ formatLang(get_intial_balance(p)[0][1]) ]]
+ [[ formatLang(get_intial_balance(p)[0][1]) ]]
|
- [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]
|
[[ repeatIn(lines(p), 'line') ]]
-
+
|
- [[ formatLang(line['date'],date=True) ]]
+ [[ formatLang(line['date'],date=True) ]]
|
- [[ line['code'] ]]
+ [[ line['code'] ]]
|
- [[ line['move_name'] ]]
+ [[ line['move_name'] ]]
|
- [[ line['a_code'] ]]
+ [[ line['a_code'] ]]
|
- [[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]
+ [[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]
|
- [[ formatLang((line['debit'])) ]]
+ [[ formatLang((line['debit'])) ]]
|
- [[ formatLang((line['credit'])) ]]
+ [[ formatLang((line['credit'])) ]]
|
- [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
|
@@ -540,7 +538,7 @@
[[ display_currency(data) == True or removeParentNode('section') ]]
-
+
|
Date
@@ -571,7 +569,7 @@
|
-
+
[[ p.ref ]] - [[ p.name ]]
@@ -594,7 +592,7 @@
[[ data['form']['initial_balance']==True or removeParentNode('section') ]]
-
+
Initial Balance
@@ -618,35 +616,35 @@
[[ repeatIn(lines(p), 'line') ]]
-
+
|
- [[ formatLang(line['date'],date=True) ]]
+ [[ formatLang(line['date'],date=True) ]]
|
- [[ line['code'] ]]
+ [[ line['code'] ]]
|
- [[ line['move_name'] ]]
+ [[ line['move_name'] ]]
|
- [[ line['a_code'] ]]
+ [[ line['a_code'] ]]
|
- [[ strip_name(line['ref'],5) ]] - [[ strip_name(line['name'],5) ]]
+ [[ strip_name(line['ref'],8) ]] - [[ strip_name(line['name'],7) ]]
|
- [[ formatLang((line['debit'])) ]]
+ [[ formatLang((line['debit'])) ]]
|
- [[ formatLang((line['credit'])) ]]
+ [[ formatLang((line['credit'])) ]]
|
- [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
|
- [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
+ [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
|
@@ -655,4 +653,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account/report/account_partner_ledger_other.rml b/addons/account/report/account_partner_ledger_other.rml
index b3dec993cdb..22942e15c78 100644
--- a/addons/account/report/account_partner_ledger_other.rml
+++ b/addons/account/report/account_partner_ledger_other.rml
@@ -262,11 +262,11 @@
-
+
-
+
@@ -274,67 +274,67 @@
-
- [[ display_currency(data) == False or removeParentNode('blockTable') ]]
-
- |
- Date
- |
-
- JNRL
- |
-
- Ref
- |
-
- Account
- |
-
- Entry Label
- |
-
- Debit
- |
-
- Credit
- |
-
- Balance
- |
-
-
-
- [[ display_currency(data) == True or removeParentNode('blockTable') ]]
-
- |
- Date
- |
-
- JNRL
- |
-
- Ref
- |
-
- Account
- |
-
- Entry Label
- |
-
- Debit
- |
-
- Credit
- |
-
- Balance
- |
-
- Currency
- |
-
-
+
+ [[ display_currency(data) == False or removeParentNode('blockTable') ]]
+
+ |
+ Date
+ |
+
+ JNRL
+ |
+
+ Ref
+ |
+
+ Account
+ |
+
+ Entry Label
+ |
+
+ Debit
+ |
+
+ Credit
+ |
+
+ Balance
+ |
+
+
+
+ [[ display_currency(data) == True or removeParentNode('blockTable') ]]
+
+ |
+ Date
+ |
+
+ JNRL
+ |
+
+ Ref
+ |
+
+ Account
+ |
+
+ Entry Label
+ |
+
+ Debit
+ |
+
+ Credit
+ |
+
+ Balance
+ |
+
+ Currency
+ |
+
+
@@ -434,7 +434,7 @@
-
+
[[ display_currency(data) == False or removeParentNode('blockTable') ]]
@@ -493,53 +493,53 @@
|
- Initial Balance
+ Initial Balance
|
- [[ formatLang(get_intial_balance(p)[0][0])]]
+ [[ formatLang(get_intial_balance(p)[0][0])]]
|
- [[ formatLang(get_intial_balance(p)[0][1]) ]]
+ [[ formatLang(get_intial_balance(p)[0][1]) ]]
|
- [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]
|
[[ repeatIn(lines(p), 'line') ]]
-
+
|
- [[ formatLang(line['date'],date=True) ]]
+ [[ formatLang(line['date'],date=True) ]]
|
- [[ line['code'] ]]
+ [[ line['code'] ]]
|
- [[ line['move_name'] ]]
+ [[ line['move_name'] ]]
|
- [[ line['a_code'] ]]
+ [[ line['a_code'] ]]
|
- [[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]
+ [[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]
|
- [[ formatLang((line['debit'])) ]]
+ [[ formatLang((line['debit'])) ]]
|
- [[ formatLang((line['credit'])) ]]
+ [[ formatLang((line['credit'])) ]]
|
- [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
|
-
+
[[ display_currency(data) == True or removeParentNode('blockTable') ]]
@@ -578,7 +578,7 @@
[[ display_currency(data) == True or removeParentNode('section') ]]
-
+
[[ p.ref ]] - [[ p.name ]]
@@ -601,22 +601,22 @@
[[ data['form']['initial_balance']==True or removeParentNode('section') ]]
-
+
|
- Initial Balance
+ Initial Balance
|
- [[ formatLang(get_intial_balance(p)[0][0])]]
+ [[ formatLang(get_intial_balance(p)[0][0])]]
|
- [[ formatLang(get_intial_balance(p)[0][1]) ]]
+ [[ formatLang(get_intial_balance(p)[0][1]) ]]
|
- [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]
|
-
+
|
@@ -625,35 +625,35 @@
[[ repeatIn(lines(p), 'line') ]]
-
+
|
- [[ formatLang(line['date'],date=True) ]]
+ [[ formatLang(line['date'],date=True) ]]
|
- [[ line['code'] ]]
+ [[ line['code'] ]]
|
- [[ line['move_name'] ]]
+ [[ line['move_name'] ]]
|
- [[ line['a_code'] ]]
+ [[ line['a_code'] ]]
|
- [[ strip_name(line['ref'],5) ]] - [[ strip_name(line['name'],5) ]]
+ [[ strip_name(line['ref'],8) ]] - [[ strip_name(line['name'],7) ]]
|
- [[ formatLang((line['debit'])) ]]
+ [[ formatLang((line['debit'])) ]]
|
- [[ formatLang((line['credit'])) ]]
+ [[ formatLang((line['credit'])) ]]
|
- [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]
|
- [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
+ [[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
|
@@ -662,4 +662,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account/report/account_print_invoice.rml b/addons/account/report/account_print_invoice.rml
index 80ccd2aabae..b4492e05b0d 100644
--- a/addons/account/report/account_print_invoice.rml
+++ b/addons/account/report/account_print_invoice.rml
@@ -27,6 +27,10 @@
+
+
+
+
@@ -41,6 +45,10 @@
+
+
+
+
@@ -178,20 +186,23 @@
-
+
|
- Document
+ Description
|
Invoice Date
|
+
+ Origin
+ |
- Partner Ref.
+ Your Reference
|
-
+
|
[[ o.name or ' ' ]]
@@ -199,6 +210,9 @@
|
[[ formatLang(o.date_invoice,date=True) ]]
|
+
+ [[ o.origin or '' ]]
+ |
[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]
|
@@ -207,31 +221,31 @@
-
+
|
- Description
+ Description
|
- Taxes
+ Taxes
|
- Quantity
+ Quantity
|
- Unit Price
+ Unit Price
|
- Disc.(%)
+ Disc.(%)
|
- Price
+ Price
|
[[ repeatIn(o.invoice_line,'l') ]]
-
+
|
[[ l.name ]]
@@ -246,7 +260,7 @@
[[ formatLang(l.price_unit) ]]
|
- [[ formatLang(l.discount, digits=get_digits(dp='Account')) ]]
+ [[ formatLang(l.discount, digits=get_digits(dp='Account')) ]]
|
[[ formatLang(l.price_subtotal, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]
@@ -284,7 +298,7 @@
|
-
+
|
@@ -393,4 +407,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml
index 33e69d02e96..582885d89dc 100644
--- a/addons/account/report/account_profit_loss.rml
+++ b/addons/account/report/account_profit_loss.rml
@@ -231,7 +231,7 @@
[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or removeParentNode('blockTable') ]]
|
- [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]
+ [[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and company.currency_id.symbol ]]
|
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index aaf45de3212..312db44cd0c 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -28,7 +28,6 @@
(data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
-
-
In order to test the PDF reports defined on Account Move, we will print the Voucher Report
-
@@ -37,311 +36,183 @@
(data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data)
-
-
Print the Aged Partner Balance Report
-
- !python {model: res.partner}: |
- import time
- from datetime import datetime
- from dateutil.relativedelta import relativedelta
- start = datetime.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
- start = datetime(int(start.year), int(start.month), int(start.day))
- res = {}
- for i in range(5)[::-1]:
- stop = start - relativedelta(days=30)
- res[str(i)] = {
- 'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))),
- 'stop': start.strftime('%Y-%m-%d'),
- 'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
- }
- start = stop - relativedelta(days=1)
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
-
- data_dict = {'model': 'ir.ui.menu', 'form': \
- {'chart_account_id':ref('account.chart0'),
- 'initial_balance': 1, 'periods': period_list,
- 'journal_ids':journal_ids, 'page_split': 0,
- 'date_from': time.strftime('%Y-%m-%d'),
- 'period_length': 30, 'amount_currency': 0,
- 'query_line' : query_line, 'result_selection':
- 'customer','direction_selection':
- 'past','fiscalyear_id':fy_id } }
- data_dict['form'].update(res)
- from tools.test_reports import try_report
- try_report(cr, uid, 'report.account.aged_trial_balance', [], data_dict, context={})
+ !python {model: account.account}: |
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
+ data_dict = {'chart_account_id':ref('account.chart0')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Account Balance Sheet in Horizontal mode
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 1,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}}
- (data, format) = netsvc.LocalService('report.account.balancesheet.horizontal').create(cr, uid, [], data_dict, {'periods': []})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet_horizontal.'+format), 'wb+').write(data)
-
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Account Balance Sheet in Normal mode
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}}
- (data, format) = netsvc.LocalService('report.account.balancesheet').create(cr, uid, [], data_dict, {'periods': []})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet.'+format), 'wb+').write(data)
-
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
-
- Print the Account Balance Report in Normal mode - From Account Chart
+ Print the Account Balance Report in Normal mode through the wizard - From Account Chart
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'account.account', 'form': {'chart_account_id':ref('account.chart0'),'select_account': False,'display_account':'bal_all','format_perc':0,'filter': 'filter_no','show_columns' :0, 'account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': ref('account.data_fiscalyear') ,'target_move': 'all','periods': [],'id':ref('account.bal'),'context':{'state':'all'}}}
- (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal.'+format), 'wb+').write(data)
-
- data_dict.update({'model': 'ir.ui.menu'})
- data_dict['form'].update({'active_ids':[ref('account.bal'),ref('account.gpf')]})
-
- (data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [], data_dict, {'periods': []})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal-menu.'+format), 'wb+').write(data)
-
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Central Journal Report - From Account
-
!python {model: account.journal.period}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
- data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
- (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, journal_period_ids, data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-central_journal.'+format), 'wb+').write(data)
-
- data_dict.update({'model': 'ir.ui.menu'})
- data_dict['form'].update({'active_ids':journal_period_ids})
-
- (data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-central_journal-menu.'+format), 'wb+').write(data)
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
+ ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ ctx={}
+ ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
+ data_dict = {'chart_account_id':ref('account.chart0')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the General Journal Report - From Journal
-
!python {model: account.journal.period}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
- data_dict = {'model': 'ir.ui.menu','id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids, 'active_ids':journal_period_ids}}
- (data, format) = netsvc.LocalService('report.account.general.journal').create(cr, uid, journal_period_ids, data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-general_journal.'+format), 'wb+').write(data)
-
+ journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
+ ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
+ ctx={}
+ ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
+ data_dict = {'chart_account_id':ref('account.chart0')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the General Ledger Report in Normal Mode
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- acc_ids = [ref('account.bal'),ref('account.gpf')]
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
-
- data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query': query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
- (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, acc_ids, data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger.'+format), 'wb+').write(data)
-
- data_dict.update({'model': 'ir.ui.menu'})
- data_dict['form'].update({'active_ids': acc_ids})
- (data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-menu.'+format), 'wb+').write(data)
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the General Ledger Report in Landscape Mode
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- acc_ids = [ref('account.bal'),ref('account.gpf')]
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
-
- data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query':query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':1,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
- (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, acc_ids, data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape.'+format), 'wb+').write(data)
-
- data_dict.update({'model': 'ir.ui.menu'})
- data_dict['form'].update({'active_ids': acc_ids})
- (data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape-menu.'+format), 'wb+').write(data)
-
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
-
Print Journal Report - From Model
-
!python {model: account.journal.period}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
-
- data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'sort_selection': 'date','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
- (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, journal_period_ids, data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-print_journal.'+format), 'wb+').write(data)
-
- data_dict.update({'model': 'ir.ui.menu'})
- data_dict['form'].update({'active_ids':journal_period_ids})
-
- (data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-print_journal-menu.'+format), 'wb+').write(data)
-
+ ctx={}
+ ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
+ data_dict = {'chart_account_id':ref('account.chart0')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Partner Balance Report
-
- !python {model: res.partner}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
- journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
-
- data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'active_ids':journal_period_ids,'display_partner': 'all','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
- (data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, journal_period_ids, data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-partner_balance.'+format), 'wb+').write(data)
-
+ !python {model: account.account}: |
+ ctx={}
+ data_dict = {'chart_account_id':ref('account.chart0')}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Partner Ledger Report
-
- !python {model: res.partner}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
-
- data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': True,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
- (data, format) = netsvc.LocalService('report.account.third_party_ledger').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger.'+format), 'wb+').write(data)
-
+ !python {model: account.account}: |
+ ctx={}
+ data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Partner Ledger-Other Report
-
!python {model: res.partner}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
-
- obj_move = self.pool.get('account.move.line')
- ctx = {}
- ctx['fiscalyear'] = fy_id
- ctx['journal_ids'] = journal_ids
- ctx['chart_account_id'] = ref('account.chart0')
-
- query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
- data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': False,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
- (data, format) = netsvc.LocalService('report.account.third_party_ledger_other').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger-other.'+format), 'wb+').write(data)
-
+ ctx={}
+ data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Profit-Loss Report in Normal Mode
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = []
- acc_ids = [ref('account.bal'),ref('account.gpf')]
- data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': False,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }}
- (data, format) = netsvc.LocalService('report.pl.account').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss.'+format), 'wb+').write(data)
-
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
-
Print the Profit-Loss Report in Horizontal Mode
-
!python {model: account.account}: |
- import netsvc, tools, os, time
- fy_id = ref('account.data_fiscalyear')
- period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
- journal_ids = []
- acc_ids = [ref('account.bal'),ref('account.gpf')]
- data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': True,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }}
- (data, format) = netsvc.LocalService('report.pl.account.horizontal').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss-horizontal.'+format), 'wb+').write(data)
+ ctx={}
+ ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
+ data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
+-
+ Print the Analytic Balance Report through the wizard
+-
+ !python {model: account.analytic.account}: |
+ ctx={}
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
+
+-
+ Print the Cost Ledger Report through the wizard
+-
+ !python {model: account.analytic.account}: |
+ ctx={}
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
+
+-
+ Print the Cost Ledger(Only Quantities) Report through the wizard
+-
+ !python {model: account.analytic.account}: |
+ ctx={}
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
+
+-
+ Print the Analytic Journal Report through the wizard
+-
+ !python {model: account.analytic.journal}: |
+ ctx={}
+ ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
+
+-
+ Print the Inverted Analytic Balance Report through the wizard
+-
+ !python {model: account.analytic.account}: |
+ ctx={}
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py
index 40d798a9964..59784e6e15d 100644
--- a/addons/account/wizard/account_report_aged_partner_balance.py
+++ b/addons/account/wizard/account_report_aged_partner_balance.py
@@ -77,7 +77,8 @@ class account_aged_trial_balance(osv.osv_memory):
}
start = stop + relativedelta(days=1)
data['form'].update(res)
-
+ if data.get('form',False):
+ data['ids']=[data['form'].get('chart_account_id',False)]
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.aged_trial_balance',
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.rml b/addons/account_analytic_plans/report/crossovered_analytic.rml
index 0292522206d..6e331ed1b83 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.rml
+++ b/addons/account_analytic_plans/report/crossovered_analytic.rml
@@ -150,7 +150,7 @@
Amount
- Percentage
+ Perc(%)
|
@@ -222,7 +222,7 @@
Amount
- Percentage
+ Perc(%)
|
@@ -301,4 +301,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account_anglo_saxon/i18n/fr_BE.po b/addons/account_anglo_saxon/i18n/fr_BE.po
deleted file mode 100644
index 54f33713af6..00000000000
--- a/addons/account_anglo_saxon/i18n/fr_BE.po
+++ /dev/null
@@ -1,54 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * account_anglo_saxon
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.0dev\n"
-"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2009-11-24 12:50:50+0000\n"
-"PO-Revision-Date: 2009-11-24 12:50:50+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: account_anglo_saxon
-#: view:product.category:0
-msgid " Accounting Property"
-msgstr ""
-
-#. module: account_anglo_saxon
-#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
-msgid "This module will support the Anglo-Saxons accounting methodology by \n"
-" changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries \n"
-" and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales. \n"
-" Anglo-Saxons accounting does take the cost when sales invoice is created, Continental accounting will take the cost at he moment the goods are shipped.\n"
-" This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account \n"
-" when the invoice is created to transfer this amount to the debtor or creditor account."
-msgstr ""
-
-#. module: account_anglo_saxon
-#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
-msgid "Stock Account"
-msgstr ""
-
-#. module: account_anglo_saxon
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
-msgstr ""
-
-#. module: account_anglo_saxon
-#: field:product.category,property_account_creditor_price_difference_categ:0
-#: field:product.template,property_account_creditor_price_difference:0
-msgid "Price Difference Account"
-msgstr ""
-
-#. module: account_anglo_saxon
-#: help:product.category,property_account_creditor_price_difference_categ:0
-#: help:product.template,property_account_creditor_price_difference:0
-msgid "This account will be used to value price difference between purchase price and cost price."
-msgstr ""
-
diff --git a/addons/account_budget/test/account_budget_report.yml b/addons/account_budget/test/account_budget_report.yml
index d0766e31196..40b0175f045 100644
--- a/addons/account_budget/test/account_budget_report.yml
+++ b/addons/account_budget/test/account_budget_report.yml
@@ -1,27 +1,33 @@
-
- Print the Analytic Budget Report in Normal mode
+ Print the Analytic Budget Report through wizard
-
!python {model: account.analytic.account}: |
import netsvc, tools, os, time
- data_dict = {'model': 'account.analytic.account', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'id':ref('account.analytic_root'),'context':{}}}
- (data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account.analytic_root')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account_budget-analytic_budget_report.'+format), 'wb+').write(data)
+ ctx={}
+ ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget')
+
-
- Print the Budget Report in Normal mode
+ Print the Budget Report through wizard
-
!python {model: account.budget.post}: |
import netsvc, tools, os, time
- data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'id':ref('account_budget.account_budget_post_sales0'),'context':{}}}
- (data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account_budget.account_budget_post_sales0')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account_budget-budget_report.'+format), 'wb+').write(data)
+ ctx={}
+ ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.account_budget_post_sales0')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_budget_report',wiz_data=data_dict, context=ctx, our_module='account_budget')
+
-
- Print the CrossOvered Budget Report in Normal mode
+ Print the CrossOvered Budget Report mode through wizard
-
!python {model: crossovered.budget}: |
import netsvc, tools, os, time
- data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'report':'analytic-full','id':ref('account_budget.crossovered_budget_budgetoptimistic0'),'context':{}}}
- (data, format) = netsvc.LocalService('report.crossovered.budget.report').create(cr, uid, [ref('account_budget.crossovered_budget_budgetoptimistic0')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account_budget-crossovered_budget_report.'+format), 'wb+').write(data)
+ ctx={}
+ ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data=data_dict, context=ctx, our_module='account_budget')
+
diff --git a/addons/account_coda/i18n/fr_BE.po b/addons/account_coda/i18n/fr_BE.po
deleted file mode 100644
index f9055a016bd..00000000000
--- a/addons/account_coda/i18n/fr_BE.po
+++ /dev/null
@@ -1,163 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * account_coda
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.0dev\n"
-"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2009-11-24 13:11:29+0000\n"
-"PO-Revision-Date: 2009-11-24 13:11:29+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: account_coda
-#: field:account.coda,journal_id:0
-#: wizard_field:account.coda_import,init,journal_id:0
-msgid "Bank Journal"
-msgstr ""
-
-#. module: account_coda
-#: constraint:ir.model:0
-msgid "The Object name must start with x_ and not contain any special character !"
-msgstr ""
-
-#. module: account_coda
-#: wizard_field:account.coda_import,extraction,note:0
-msgid "Log"
-msgstr ""
-
-#. module: account_coda
-#: wizard_button:account.coda_import,extraction,open:0
-msgid "_Open Statement"
-msgstr ""
-
-#. module: account_coda
-#: model:ir.module.module,shortdesc:account_coda.module_meta_information
-msgid "Account CODA"
-msgstr ""
-
-#. module: account_coda
-#: field:account.coda,name:0
-msgid "Coda file"
-msgstr ""
-
-#. module: account_coda
-#: wizard_view:account.coda_import,init:0
-msgid "Clic on 'New' to select your file :"
-msgstr ""
-
-#. module: account_coda
-#: model:ir.actions.wizard,name:account_coda.wizard_account_coda_import
-msgid "Import Coda File"
-msgstr ""
-
-#. module: account_coda
-#: constraint:ir.actions.act_window:0
-msgid "Invalid model name in the action definition."
-msgstr ""
-
-#. module: account_coda
-#: field:account.coda,note:0
-msgid "Import log"
-msgstr ""
-
-#. module: account_coda
-#: wizard_field:account.coda_import,init,def_receivable:0
-msgid "Default receivable Account"
-msgstr ""
-
-#. module: account_coda
-#: model:ir.module.module,description:account_coda.module_meta_information
-msgid "Module provides functionality to import\n"
-" bank statements from .csv file.\n"
-" Import coda file wizard is used to import bank statements."
-msgstr ""
-
-#. module: account_coda
-#: wizard_button:account.coda_import,extraction,end:0
-msgid "_Close"
-msgstr ""
-
-#. module: account_coda
-#: field:account.coda,statement_id:0
-msgid "Generated Bank Statement"
-msgstr ""
-
-#. module: account_coda
-#: view:account.coda:0
-#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement
-#: model:ir.actions.act_window,name:account_coda.action_account_coda
-msgid "Coda import"
-msgstr ""
-
-#. module: account_coda
-#: field:account.coda,user_id:0
-msgid "User"
-msgstr ""
-
-#. module: account_coda
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
-msgstr ""
-
-#. module: account_coda
-#: model:ir.model,name:account_coda.model_account_coda
-msgid "coda for an Account"
-msgstr ""
-
-#. module: account_coda
-#: wizard_field:account.coda_import,init,def_payable:0
-msgid "Default Payable Account"
-msgstr ""
-
-#. module: account_coda
-#: model:ir.ui.menu,name:account_coda.menu_account_coda
-msgid "Coda Statements"
-msgstr ""
-
-#. module: account_coda
-#: model:ir.ui.menu,name:account_coda.menu_account_coda_wizard
-msgid "Import Coda Statements"
-msgstr ""
-
-#. module: account_coda
-#: wizard_button:account.coda_import,init,extraction:0
-msgid "_Ok"
-msgstr ""
-
-#. module: account_coda
-#: wizard_view:account.coda_import,extraction:0
-#: wizard_view:account.coda_import,init:0
-msgid "Import Coda Statement"
-msgstr ""
-
-#. module: account_coda
-#: field:account.bank.statement,coda_id:0
-msgid "Coda"
-msgstr ""
-
-#. module: account_coda
-#: wizard_view:account.coda_import,extraction:0
-msgid "Results :"
-msgstr ""
-
-#. module: account_coda
-#: wizard_field:account.coda_import,init,coda:0
-msgid "Coda File"
-msgstr ""
-
-#. module: account_coda
-#: field:account.coda,date:0
-msgid "Import Date"
-msgstr ""
-
-#. module: account_coda
-#: wizard_view:account.coda_import,init:0
-msgid "Select your bank journal :"
-msgstr ""
-
diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml
index 7841a3a0d47..dd802503430 100644
--- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml
+++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml
@@ -27,6 +27,10 @@
+
+
+
+
@@ -41,6 +45,10 @@
+
+
+
+
@@ -237,20 +245,23 @@
-
+
|
- Document
+ Description
|
Invoice Date
|
+
+ Origin
+ |
- Partner Ref.
+ Your Reference
|
-
+
|
[[ o.name ]]
@@ -258,6 +269,9 @@
|
[[ formatLang(o.date_invoice,date=True) ]]
|
+
+ [[ o.name or '' ]]
+ |
[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]
|
@@ -493,4 +507,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml
index ab7f02f0b6d..b9cdafee0bf 100644
--- a/addons/account_invoice_layout/report/special_message_invoice.rml
+++ b/addons/account_invoice_layout/report/special_message_invoice.rml
@@ -27,6 +27,10 @@
+
+
+
+
@@ -41,6 +45,10 @@
+
+
+
+
@@ -241,20 +249,23 @@
-
+
|
- Document
+ Description
|
Invoice Date
|
+
+ Origin
+ |
- Partner Ref.
+ Your Reference
|
-
+
|
[[ o.name ]]
@@ -262,6 +273,9 @@
|
[[ formatLang(o.date_invoice,date=True) ]]
|
+
+ [[ o.name or '' ]]
+ |
[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]
|
@@ -382,7 +396,7 @@
-
+
|
@@ -390,14 +404,14 @@
|
- Net Total:
+ Net Total :
|
[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]
|
-
+
|
@@ -405,14 +419,14 @@
|
- Taxes:
+ Taxes :
|
[[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]
|
-
+
|
@@ -420,7 +434,7 @@
|
- Total:
+ Total :
|
[[ formatLang(o.amount_total, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]
@@ -511,4 +525,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account_invoice_layout/test/account_invoice_layout_report.yml b/addons/account_invoice_layout/test/account_invoice_layout_report.yml
index cdaccf0630c..91967358a3d 100644
--- a/addons/account_invoice_layout/test/account_invoice_layout_report.yml
+++ b/addons/account_invoice_layout/test/account_invoice_layout_report.yml
@@ -19,12 +19,14 @@
(data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('test_invoice_1')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data)
+
-
- Print the Invoice Layout Report with Message in Normal mode
+ Print the Invoice Layout Report with Message through wizard
-
!python {model: account.invoice}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'account.invoice', 'form': {'message':ref('account_invoice_layout.demo_message1'),'id':ref('test_invoice_1'),'context':{}}}
- (data, format) = netsvc.LocalService('report.notify_account.invoice').create(cr, uid, [ref('test_invoice_1')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data)
\ No newline at end of file
+ ctx={}
+ ctx.update({'model': 'account.invoice','active_ids': [ref('test_invoice_1')]})
+ data_dict = {'message':ref('account_invoice_layout.demo_message1')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_account_invoice_special_msg',wiz_data=data_dict, context=ctx, our_module='account_invoice_layout')
+
diff --git a/addons/account_payment/report/order.rml b/addons/account_payment/report/order.rml
index e47691f54d7..9198b12db25 100644
--- a/addons/account_payment/report/order.rml
+++ b/addons/account_payment/report/order.rml
@@ -210,7 +210,7 @@
[[ o.date_prefered == 'fixed' and 'Fixed date' or removeParentNode('para') ]]
|
- [[ get_company_currency() ]]
+ [[ o.user_id and o.user_id.company_id and o.user_id.company_id.currency_id and o.user_id.company_id.currency_id.name or '' ]]
|
@@ -287,4 +287,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index 4e08ad9112b..481fef477e1 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -49,8 +49,9 @@ account_move_line()
class account_voucher(osv.osv):
- def _get_type(self, cr, uid, ids, context=None):
- if context is None: context = {}
+ def _get_type(self, cr, uid, context=None):
+ if context is None:
+ context = {}
return context.get('type', False)
def _get_period(self, cr, uid, context=None):
diff --git a/addons/hr_holidays/migrations/1.5/post-00-change-requests-signs.py b/addons/base_crypt/__init__.py
old mode 100644
new mode 100755
similarity index 74%
rename from addons/hr_holidays/migrations/1.5/post-00-change-requests-signs.py
rename to addons/base_crypt/__init__.py
index 9e4a5a45cb1..a8b9a6b0740
--- a/addons/hr_holidays/migrations/1.5/post-00-change-requests-signs.py
+++ b/addons/base_crypt/__init__.py
@@ -1,8 +1,7 @@
-# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-2009 Tiny SPRL ().
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -18,8 +17,7 @@
# along with this program. If not, see .
#
##############################################################################
-__name__ = "Change signs of old holiday requests"
-def migrate(cr, version):
- cr.execute("DELETE FROM hr_holidays WHERE number_of_days < 0")
- cr.execute("UPDATE hr_holidays SET number_of_days = -number_of_days, type ='remove'")
+from service import security
+import crypt
+
diff --git a/addons/base_crypt/__openerp__.py b/addons/base_crypt/__openerp__.py
new file mode 100755
index 00000000000..d6c0bbd82e3
--- /dev/null
+++ b/addons/base_crypt/__openerp__.py
@@ -0,0 +1,43 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+{
+ "name" : "Base - Password Encryption",
+ "version" : "1.1",
+ "author" : "FS3 & OpenERP SA",
+ "maintainer" : "OpenERP SA",
+ "website" : "http://www.openerp.com",
+ "category" : "Generic Modules/Base",
+ "description": """This module replaces the cleartext password in the database with a password hash,
+preventing anyone from reading the original password.
+For your existing user base, the removal of the cleartext passwords occurs the first time
+a user logs into the database, after installing base_crypt.
+After installing this module it won't be possible to recover a forgotten password for your
+users, the only solution is for an admin to set a new password.
+
+Note: installing this module does not mean you can ignore basic security measures,
+as the password is still transmitted unencrypted on the network (by the client),
+unless you are using a secure protocol such as XML-RPCS.
+ """,
+ "depends" : ["base"],
+ "data" : [],
+ "active": False,
+ "installable": True,
+}
diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py
new file mode 100755
index 00000000000..259404dc95b
--- /dev/null
+++ b/addons/base_crypt/crypt.py
@@ -0,0 +1,256 @@
+# Notice:
+# ------
+#
+# Implements encrypting functions.
+#
+# Copyright (c) 2008, F S 3 Consulting Inc.
+#
+# Maintainer:
+# Alec Joseph Rivera (agifs3.ph)
+#
+#
+# Warning:
+# -------
+#
+# This program as such is intended to be used by professional programmers
+# who take the whole responsibility 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 guarantees 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.
+
+from random import seed, sample
+from string import letters, digits
+from osv import fields,osv
+import pooler
+import tools
+from tools.translate import _
+from service import security
+
+magic_md5 = '$1$'
+
+def gen_salt( length=8, symbols=letters + digits ):
+ seed()
+ return ''.join( sample( symbols, length ) )
+
+# The encrypt_md5 is based on Mark Johnson's md5crypt.py, which in turn is
+# based on FreeBSD src/lib/libcrypt/crypt.c (1.2) by Poul-Henning Kamp.
+# Mark's port can be found in ActiveState ASPN Python Cookbook. Kudos to
+# Poul and Mark. -agi
+#
+# Original license:
+#
+# * "THE BEER-WARE LICENSE" (Revision 42):
+# *
+# * wrote this file. As long as you retain this
+# * notice you can do whatever you want with this stuff. If we meet some
+# * day, and you think this stuff is worth it, you can buy me a beer in
+# * return.
+# *
+# * Poul-Henning Kamp
+
+import md5
+
+def encrypt_md5( raw_pw, salt, magic=magic_md5 ):
+ hash = md5.new( raw_pw + magic + salt )
+ stretch = md5.new( raw_pw + salt + raw_pw).digest()
+
+ for i in range( 0, len( raw_pw ) ):
+ hash.update( stretch[i % 16] )
+
+ i = len( raw_pw )
+
+ while i:
+ if i & 1:
+ hash.update('\x00')
+ else:
+ hash.update( raw_pw[0] )
+ i >>= 1
+
+ saltedmd5 = hash.digest()
+
+ for i in range( 1000 ):
+ hash = md5.new()
+
+ if i & 1:
+ hash.update( raw_pw )
+ else:
+ hash.update( saltedmd5 )
+
+ if i % 3:
+ hash.update( salt )
+ if i % 7:
+ hash.update( raw_pw )
+ if i & 1:
+ hash.update( saltedmd5 )
+ else:
+ hash.update( raw_pw )
+
+ saltedmd5 = hash.digest()
+
+ itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
+
+ rearranged = ''
+ for a, b, c in ((0, 6, 12), (1, 7, 13), (2, 8, 14), (3, 9, 15), (4, 10, 5)):
+ v = ord( saltedmd5[a] ) << 16 | ord( saltedmd5[b] ) << 8 | ord( saltedmd5[c] )
+
+ for i in range(4):
+ rearranged += itoa64[v & 0x3f]
+ v >>= 6
+
+ v = ord( saltedmd5[11] )
+
+ for i in range( 2 ):
+ rearranged += itoa64[v & 0x3f]
+ v >>= 6
+
+ return magic + salt + '$' + rearranged
+
+class users(osv.osv):
+ _name="res.users"
+ _inherit="res.users"
+ # agi - 022108
+ # Add handlers for 'input_pw' field.
+
+ def set_pw(self, cr, uid, id, name, value, args, context):
+ if not value:
+ raise osv.except_osv(_('Error'), _("Please specify the password !"))
+
+ obj = pooler.get_pool(cr.dbname).get('res.users')
+ if not hasattr(obj, "_salt_cache"):
+ obj._salt_cache = {}
+
+ salt = obj._salt_cache[id] = gen_salt()
+ encrypted = encrypt_md5(value, salt)
+ cr.execute('update res_users set password=%s where id=%s',
+ (encrypted.encode('utf-8'), int(id)))
+ cr.commit()
+ del value
+
+ def get_pw( self, cr, uid, ids, name, args, context ):
+ cr.execute('select id, password from res_users where id in %s', (tuple(map(int, ids)),))
+ stored_pws = cr.fetchall()
+ res = {}
+
+ for id, stored_pw in stored_pws:
+ res[id] = stored_pw
+
+ return res
+
+ _columns = {
+ # The column size could be smaller as it is meant to store a hash, but
+ # an existing column cannot be downsized; thus we use the original
+ # column size.
+ 'password': fields.function(get_pw, fnct_inv=set_pw, type='char',
+ method=True, size=64, string='Password', invisible=True,
+ store=True),
+ }
+
+ def login(self, db, login, password):
+ cr = pooler.get_db(db).cursor()
+ cr.execute('select password, id from res_users where login=%s',
+ (login.encode('utf-8'),))
+ stored_pw = id = cr.fetchone()
+
+ if stored_pw:
+ stored_pw = stored_pw[0]
+ id = id[1]
+ else:
+ # Return early if there is no such login.
+ return False
+
+ stored_pw = self.maybe_encrypt(cr, stored_pw, id)
+
+ # Calculate an encrypted password from the user-provided
+ # password.
+ obj = pooler.get_pool(db).get('res.users')
+ if not hasattr(obj, "_salt_cache"):
+ obj._salt_cache = {}
+ salt = obj._salt_cache[id] = stored_pw[len(magic_md5):11]
+ encrypted_pw = encrypt_md5(password, salt)
+
+ # Check if the encrypted password matches against the one in the db.
+ cr.execute('select id from res_users where id=%s and password=%s and active', (int(id), encrypted_pw.encode('utf-8')))
+ res = cr.fetchone()
+ cr.close()
+
+ if res:
+ return res[0]
+ else:
+ return False
+
+ def check(self, db, uid, passwd):
+ # Get a chance to hash all passwords in db before using the uid_cache.
+ obj = pooler.get_pool(db).get('res.users')
+ if not hasattr(obj, "_salt_cache"):
+ obj._salt_cache = {}
+ self._uid_cache.get(db, {}).clear()
+
+ cached_pass = self._uid_cache.get(db, {}).get(uid)
+ if (cached_pass is not None) and cached_pass == passwd:
+ return True
+
+ cr = pooler.get_db(db).cursor()
+ if uid not in obj._salt_cache:
+ cr.execute('select login from res_users where id=%s', (int(uid),))
+ stored_login = cr.fetchone()
+ if stored_login:
+ stored_login = stored_login[0]
+
+ if not self.login(db,stored_login,passwd):
+ return False
+
+ salt = obj._salt_cache[uid]
+ cr.execute('select count(id) from res_users where id=%s and password=%s',
+ (int(uid), encrypt_md5(passwd, salt)))
+ res = cr.fetchone()[0]
+ cr.close()
+ if not bool(res):
+ raise Exception('AccessDenied')
+
+ if res:
+ if self._uid_cache.has_key(db):
+ ulist = self._uid_cache[db]
+ ulist[uid] = passwd
+ else:
+ self._uid_cache[db] = {uid: passwd}
+ return bool(res)
+
+ def maybe_encrypt(self, cr, pw, id):
+ # If the password 'pw' is not encrypted, then encrypt all passwords
+ # in the db. Returns the (possibly newly) encrypted password for 'id'.
+
+ if pw[0:len(magic_md5)] != magic_md5:
+ cr.execute('select id, password from res_users')
+ res = cr.fetchall()
+ for i, p in res:
+ encrypted = p
+ if p[0:len(magic_md5)] != magic_md5:
+ encrypted = encrypt_md5(p, gen_salt())
+ cr.execute('update res_users set password=%s where id=%s',
+ (encrypted.encode('utf-8'), int(i)))
+ if i == id:
+ encrypted_res = encrypted
+ cr.commit()
+ return encrypted_res
+ return pw
+
+users()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_crypt/i18n/base_crypt.pot b/addons/base_crypt/i18n/base_crypt.pot
new file mode 100755
index 00000000000..d62691cb699
--- /dev/null
+++ b/addons/base_crypt/i18n/base_crypt.pot
@@ -0,0 +1,37 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * base_crypt
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-26 09:12:09+0000\n"
+"PO-Revision-Date: 2009-11-26 09:12:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: base_crypt
+#: model:ir.module.module,description:base_crypt.module_meta_information
+msgid "Module for password encryption."
+msgstr ""
+
+#. module: base_crypt
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: base_crypt
+#: model:ir.module.module,shortdesc:base_crypt.module_meta_information
+msgid "Base"
+msgstr ""
+
+#. module: base_crypt
+#: field:res.users,input_pw:0
+msgid "Password"
+msgstr ""
+
diff --git a/addons/base_crypt/i18n/sv.po b/addons/base_crypt/i18n/sv.po
new file mode 100644
index 00000000000..a20776a2100
--- /dev/null
+++ b/addons/base_crypt/i18n/sv.po
@@ -0,0 +1,40 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * base_crypt
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.14\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-26 09:12+0000\n"
+"PO-Revision-Date: 2010-11-23 02:16+0000\n"
+"Last-Translator: Olivier Dony (OpenERP) \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-12-15 05:38+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: base_crypt
+#: model:ir.module.module,description:base_crypt.module_meta_information
+msgid "Module for password encryption."
+msgstr ""
+
+#. module: base_crypt
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: base_crypt
+#: model:ir.module.module,shortdesc:base_crypt.module_meta_information
+msgid "Base"
+msgstr ""
+
+#. module: base_crypt
+#: field:res.users,input_pw:0
+msgid "Password"
+msgstr ""
+
+#~ msgid "Module for password encryption.KKKKKKKKKKKKKKKKKKK"
+#~ msgstr "Module for password encryption.KKKKKKKKKKKKKKKKKKK"
diff --git a/addons/base_module_doc_rst/i18n/fr_BE.po b/addons/base_module_doc_rst/i18n/fr_BE.po
deleted file mode 100644
index 1a0e3c0f141..00000000000
--- a/addons/base_module_doc_rst/i18n/fr_BE.po
+++ /dev/null
@@ -1,57 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * base_module_doc_rst
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.0dev\n"
-"Report-Msgid-Bugs-To: support@openerp.com\n"
-"POT-Creation-Date: 2009-01-28 00:45:34+0000\n"
-"PO-Revision-Date: 2009-01-28 00:45:34+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: base_module_doc_rst
-#: wizard_view:tech.guide.rst,init:0
-msgid "Technical Guide in rst format"
-msgstr "Guide Technique au format rst"
-
-#. module: base_module_doc_rst
-#: wizard_field:tech.guide.rst,init,name:0
-msgid "filename"
-msgstr "Nom du Fichier"
-
-#. module: base_module_doc_rst
-#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_tech_guide_rst
-msgid "Create RST Technical Guide"
-msgstr "Crée le Guide Technical au format rst"
-
-#. module: base_module_doc_rst
-#: wizard_view:tech.guide.rst,init:0
-msgid "Please choose a file where the Technical Guide will be written."
-msgstr "Choisissez un fichier où le Guide Technique sera créé."
-
-#. module: base_module_doc_rst
-#: wizard_field:tech.guide.rst,init,rst_file:0
-msgid "file"
-msgstr "Fichier"
-
-#. module: base_module_doc_rst
-#: wizard_button:tech.guide.rst,init,end:0
-msgid "Close"
-msgstr "Fermer"
-
-#. module: base_module_doc_rst
-#: model:ir.module.module,shortdesc:base_module_doc_rst.module_meta_information
-msgid "Module Technical Guide in Restructured Text "
-msgstr ""
-
-#. module: base_module_doc_rst
-#: wizard_view:tech.guide.rst,init:0
-msgid "Create Technical Guide in rst format"
-msgstr "Crée le Guide Technique au format rst"
-
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index 9a61fda01bd..ae9f584d059 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -44,7 +44,7 @@
-
+
diff --git a/addons/delivery/report/shipping.rml b/addons/delivery/report/shipping.rml
index 42fcd71a693..563c3bda826 100644
--- a/addons/delivery/report/shipping.rml
+++ b/addons/delivery/report/shipping.rml
@@ -125,7 +125,7 @@
- [[ (not(o.sale_id) and o.type== 'out') and 'Error, no sale order attached to this picking !' or removeParentNode('para') ]]
+
@@ -226,4 +226,4 @@
-
\ No newline at end of file
+
diff --git a/addons/document_ftp/test_easyftp.py b/addons/document_ftp/test_easyftp.py
index 1f7324b821e..04a480fce36 100644
--- a/addons/document_ftp/test_easyftp.py
+++ b/addons/document_ftp/test_easyftp.py
@@ -37,7 +37,7 @@ def get_plain_ftp(timeout=10.0):
def get_ftp_login(cr, uid, ormobj):
ftp = get_plain_ftp()
user = ormobj.pool.get('res.users').read(cr, uid, uid)
- ftp.login(user.get('login',''), user.get('password',''))
+ ftp.login(user.get('login',''), user.get('login',''))
ftp.cwd("/" + cr.dbname)
return ftp
@@ -62,4 +62,4 @@ def get_ftp_fulldata(ftp, fname, limit=8192):
ftp.retrbinary('RETR %s' % fname, partial(ffp,data))
return ''.join(data)
-#eof
\ No newline at end of file
+#eof
diff --git a/addons/hr/security/ir.model.access.csv b/addons/hr/security/ir.model.access.csv
index ac06a681d8f..c21d0598de0 100644
--- a/addons/hr/security/ir.model.access.csv
+++ b/addons/hr/security/ir.model.access.csv
@@ -8,3 +8,4 @@
"access_hr_job_user","hr.job user","model_hr_job","base.group_hr_user",1,1,1,1
"access_hr_res_partner_address","res.partner.address","base.model_res_partner_address","base.group_hr_manager",1,1,1,1
"access_hr_employee_marital_status_manager","hr.employee.marital.status.manager","model_hr_employee_marital_status","base.group_hr_manager",1,1,1,1
+"access_ir_property_hr_user","ir_property hr_user","base.model_ir_property","base.group_hr_user",1,1,1,0
diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py
index 584340d6c1d..07ef528a7c9 100644
--- a/addons/hr_attendance/hr_attendance.py
+++ b/addons/hr_attendance/hr_attendance.py
@@ -137,7 +137,7 @@ class hr_employee(osv.osv):
res = {'action': type, 'employee_id': emp['id']}
if dt:
- res['name'] = dt
+ res['name'] = dt
id = obj_attendance.create(cr, uid, res, context=context)
if type != 'action':
@@ -146,4 +146,4 @@ class hr_employee(osv.osv):
hr_employee()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/report/bymonth.xsl b/addons/hr_attendance/report/bymonth.xsl
index 3975e4d1d11..23e7fb14b3d 100644
--- a/addons/hr_attendance/report/bymonth.xsl
+++ b/addons/hr_attendance/report/bymonth.xsl
@@ -29,7 +29,7 @@
- Attendance By Month
+ Attendances By Month
week
diff --git a/addons/hr_attendance/test/hr_attendance_report.yml b/addons/hr_attendance/test/hr_attendance_report.yml
index d26f6ddb9bc..523b64ee70d 100644
--- a/addons/hr_attendance/test/hr_attendance_report.yml
+++ b/addons/hr_attendance/test/hr_attendance_report.yml
@@ -1,19 +1,20 @@
-
- In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance By Month
+ Print the HR Attendance Report By Month through the wizard
-
!python {model: hr.employee}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'hr.employee', 'form': {'month': time.gmtime()[1], 'year': time.gmtime()[0]}}
- (data, format) = netsvc.LocalService('report.hr.attendance.bymonth').create(cr, uid, [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-by_month_report.'+format), 'wb+').write(data)
-
+ import time
+ ctx={}
+ ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
+ data_dict = {}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_hr_attendance_month',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
+-
+ Print HR Attendance Error Report through the wizard
-
- In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance Error
--
!python {model: hr.employee}: |
- import netsvc, tools, os, time
- data_dict = {'model': 'hr.employee', 'form': {'init_date': time.strftime('%Y-01-01'), 'end_date':time.strftime('%Y-%m-%d'), 'emp_ids': [ref('hr.employee1')], 'max_delay': 120}}
- (data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [ref('hr.employee1')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-error_report.'+format), 'wb+').write(data)
+ import time
+ ctx={}
+ ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1')]})
+ data_dict = {'init_date': time.strftime('%Y-01-01')}
+ from tools import test_reports
+ test_reports.try_report_action(cr, uid, 'action_hr_attendance_error',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
diff --git a/addons/hr_contract/security/ir.model.access.csv b/addons/hr_contract/security/ir.model.access.csv
index 202fcb3bdb4..7c87e3c36b3 100644
--- a/addons/hr_contract/security/ir.model.access.csv
+++ b/addons/hr_contract/security/ir.model.access.csv
@@ -4,3 +4,4 @@
"access_hr_resource_manager","hr.employee.resource.manager","resource.model_resource_resource","base.group_hr_manager",1,1,1,1
"access_hr_resource_calendar_user","hr.employee.resource.calendar.user","resource.model_resource_calendar","base.group_hr_user",1,1,1,1
"access_hr_contract_type_manager","hr.contract.type.manager","model_hr_contract_type","base.group_hr_manager",1,1,1,1
+"access_hr_contract_manager","hr.contract.manager","model_hr_contract","base.group_hr_manager",1,1,1,1
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 160105a69ad..68e658f87b9 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -281,7 +281,7 @@ class hr_evaluation_interview(osv.osv):
_columns = {
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True),
'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'),
- 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'),
+ 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Form'),
}
_defaults = {
'is_evaluation': True,
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index d8d69610d25..b4a3b305ca5 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -170,7 +170,26 @@
-
+
+
+
\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: hr_evaluation
-#: view:hr_evaluation.type:0
-#: field:hr_evaluation.type,info:0
-msgid "Information"
-msgstr ""
-
-#. module: hr_evaluation
-#: constraint:ir.model:0
-msgid "The Object name must start with x_ and not contain any special character !"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-msgid "Schedule next evaluation"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-#: field:hr_evaluation.evaluation,info_bad:0
-msgid "Bad Points"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_my_list
-msgid "My Next Evaluation"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.type,value_ids:0
-msgid "Values"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-#: field:hr_evaluation.evaluation,info_good:0
-msgid "Good Points"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,state:0
-msgid "State"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,score:0
-#: field:hr_evaluation.quote,score:0
-#: field:hr_evaluation.type,score:0
-#: field:hr_evaluation.type.value,score:0
-msgid "Score"
-msgstr ""
-
-#. module: hr_evaluation
-#: selection:hr_evaluation.evaluation,state:0
-msgid "Draft"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-msgid "Informal Data"
-msgstr ""
-
-#. module: hr_evaluation
-#: constraint:ir.actions.act_window:0
-msgid "Invalid model name in the action definition."
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,employee_id:0
-msgid "Employee"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-#: field:hr_evaluation.evaluation,info_improve:0
-msgid "To Improve"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.quote,evaluation_id:0
-msgid "Evaluation"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.type.value,type_id:0
-msgid "Evaluation Type"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-msgid "Status"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.type:0
-msgid "Apply to categories"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.module.module,description:hr_evaluation.module_meta_information
-msgid "Ability to create employees evaluation."
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.quote,name:0
-msgid "Quote"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.type,category_ids:0
-msgid "Appliable Role"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,user_id:0
-msgid "Evaluation User"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.type:0
-msgid "Choices Results"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,date:0
-msgid "Date"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr
-#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_form
-msgid "Evaluations"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_eval_config
-msgid "Configuration"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_list
-msgid "Next Evaluations"
-msgstr ""
-
-#. module: hr_evaluation
-#: constraint:ir.ui.view:0
-msgid "Invalid XML for View Architecture!"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_evaluation_type_form
-msgid "Evaluation Criterions"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_my_old_evaluation_list
-msgid "My Preceeding Evaluations"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_resp_hr
-msgid "HR Responsible"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.quote,value_id:0
-#: field:hr_evaluation.type.value,name:0
-msgid "Value"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,name:0
-msgid "Summary"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.type,active:0
-msgid "Active"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.type:0
-msgid "Notes"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-#: model:ir.model,name:hr_evaluation.model_hr_evaluation_evaluation
-msgid "Employee Evaluation"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type
-msgid "Employee Evaluation Type"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-msgid "Quotations"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_list
-msgid "Next Employee Evaluation"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.quote,type_id:0
-msgid "Type"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.type:0
-#: field:hr_evaluation.type,name:0
-msgid "Evaluation Criterion"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_my_list
-msgid "My Next Evaluations"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.quote:0
-msgid "Evalution Quote"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.module.module,shortdesc:hr_evaluation.module_meta_information
-msgid "Human Resources Evaluation"
-msgstr ""
-
-#. module: hr_evaluation
-#: field:hr_evaluation.evaluation,quote_ids:0
-msgid "Quotes"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-#: selection:hr_evaluation.evaluation,state:0
-msgid "Done"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.model,name:hr_evaluation.model_hr_evaluation_quote
-msgid "Employee Evaluation Quote"
-msgstr ""
-
-#. module: hr_evaluation
-#: view:hr_evaluation.evaluation:0
-#: field:hr_evaluation.evaluation,info_employee:0
-msgid "Employee Response"
-msgstr ""
-
-#. module: hr_evaluation
-#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type_value
-msgid "Evaluation Type Value"
-msgstr ""
-
diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv
index d5eaf33a6ae..9852f359243 100644
--- a/addons/hr_evaluation/security/ir.model.access.csv
+++ b/addons/hr_evaluation/security/ir.model.access.csv
@@ -1,5 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_evaluation_evaluation_user","hr_evaluation.evaluation.user","model_hr_evaluation_evaluation","base.group_hr_user",1,1,1,1
+"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0
"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1
"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,1,1,1
"access_hr_evaluation_interview_user","hr.evaluation.interview.user","model_hr_evaluation_interview","base.group_hr_user",1,1,1,1
diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml
index b12971564b1..eeb9854c059 100644
--- a/addons/hr_expense/report/expense.rml
+++ b/addons/hr_expense/report/expense.rml
@@ -68,10 +68,8 @@
-
-
-
-
+
+
@@ -113,7 +111,7 @@
-
+
|
Date
@@ -122,7 +120,7 @@
Name
|
- Ref.
+ Ref.
|
Unit Price
@@ -131,7 +129,7 @@
Qty
|
- Total Price
+ Price
|
@@ -176,7 +174,7 @@
-
+
|
Date
@@ -185,7 +183,7 @@
Name
|
- Ref.
+ Ref.
|
Unit Price
@@ -194,7 +192,7 @@
Qty
|
- Total Price
+ Price
|
@@ -203,7 +201,7 @@
[[ repeatIn(o.line_ids,'line') ]]
-
+
|
[[ formatLang(line.date_value,date=True) ]]
@@ -256,7 +254,7 @@
|
-
+
|
@@ -264,17 +262,7 @@
|
-
-
-
- |
-
-
-
-
- |
-
- Total:
+ Total:
|
[[ formatLang(o.amount) ]] [[ o.currency_id.symbol ]]
diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv
index 47b7e32e8dd..fa8b5401497 100644
--- a/addons/hr_expense/security/ir.model.access.csv
+++ b/addons/hr_expense/security/ir.model.access.csv
@@ -1,5 +1,6 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_expense_expense_user","hr.expense.expense.user","model_hr_expense_expense","base.group_hr_user",1,1,1,1
+"access_hr_expense_expense_employee","hr.expense.expense.employee","model_hr_expense_expense","base.group_user",1,1,1,1
"access_hr_expense_line_user","hr.expense.line.user","model_hr_expense_line","base.group_hr_user",1,1,1,1
"access_hr_expense_report_manager","hr.expense.report.manager","model_hr_expense_report","base.group_hr_manager",1,1,1,1
"access_product_product_hr_expense_user","product.product.hr.expense.user","product.model_product_product","base.group_hr_user",1,1,1,1
diff --git a/addons/hr_holidays/board_hr_holidays_view.xml b/addons/hr_holidays/board_hr_holidays_view.xml
index 5d3223545b5..71b4e2a98fb 100644
--- a/addons/hr_holidays/board_hr_holidays_view.xml
+++ b/addons/hr_holidays/board_hr_holidays_view.xml
@@ -10,52 +10,16 @@
parent="base.menu_hr_dasboard"
sequence="4"/>
-
- hr.holidays.allocation.leave.tree
- hr.holidays
- tree
-
-
-
-
-
-
-
-
-
-
- My Leaves
- ir.actions.act_window
- hr.holidays
- form
- tree,form
- [('state','in',('confirm', 'validate')),('user_id','=',uid)]
-
-
-
-
- board.hr.holidays.form
- board.board
-
- form
-
-
-
-
-
-
-
-
- Leaves by Month
- ir.actions.act_window
- available.holidays.report
+
+ My Leaves
+ hr.holidays.status
form
- graph,tree
- [('user_id','=',uid)]
- {'group_by':['holiday_status_id'],'group_by_no_leaf':1}
-
+ tree,form
+
+ {}
+ []
board.hr.holidays.leave.month.form
@@ -64,7 +28,7 @@
-
+
diff --git a/addons/hr_holidays/board_hr_manager_holidays_view.xml b/addons/hr_holidays/board_hr_manager_holidays_view.xml
index eb3af2781f6..980a8dd5fbb 100644
--- a/addons/hr_holidays/board_hr_manager_holidays_view.xml
+++ b/addons/hr_holidays/board_hr_manager_holidays_view.xml
@@ -3,53 +3,33 @@
- All Employee Leaves
+ Leaves To Validate
ir.actions.act_window
hr.holidays
form
tree,form
- [('state','in',('confirm', 'validate'))]
+ [('state','in',('confirm', 'validate', 'validate1'))]
-
-
- Remaining Leaves by User
- ir.actions.act_window
- hr.holidays.remaining.leaves.user
- form
- graph,tree
-
-
board.hr.holidays.manager.form
board.board
-
+
form
-
-
-
-
-
-
-
- board.hr.holidays.manager.remaining.form
- board.board
- form
-
-
-
-
-
+
+
+
+
+ sequence="5"/>
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 8fe5da805b4..83276ae63ee 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -35,37 +35,11 @@ class hr_holidays_status(osv.osv):
_name = "hr.holidays.status"
_description = "Leave Type"
- def get_days_cat(self, cr, uid, ids, category_id, return_false, context=None):
-
- cr.execute("""SELECT id, type, number_of_days, holiday_status_id FROM hr_holidays WHERE category_id = %s AND state='validate' AND holiday_status_id in %s""",
- [category_id, tuple(ids)])
- result = sorted(cr.dictfetchall(), key=lambda x: x['holiday_status_id'])
-
- grouped_lines = dict((k, [v for v in itr]) for k, itr in groupby(result, itemgetter('holiday_status_id')))
-
- res = {}
- for record in self.browse(cr, uid, ids, context=context):
- res[record.id] = {}
- max_leaves = leaves_taken = 0
- if not return_false:
- if record.id in grouped_lines:
- leaves_taken = -sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'remove'])
- max_leaves = sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'add'])
-
- res[record.id]['max_leaves'] = max_leaves
- res[record.id]['leaves_taken'] = leaves_taken
- res[record.id]['remaining_leaves'] = max_leaves - leaves_taken
-
- return res
-
def get_days(self, cr, uid, ids, employee_id, return_false, context=None):
-
cr.execute("""SELECT id, type, number_of_days, holiday_status_id FROM hr_holidays WHERE employee_id = %s AND state='validate' AND holiday_status_id in %s""",
[employee_id, tuple(ids)])
result = sorted(cr.dictfetchall(), key=lambda x: x['holiday_status_id'])
-
grouped_lines = dict((k, [v for v in itr]) for k, itr in groupby(result, itemgetter('holiday_status_id')))
-
res = {}
for record in self.browse(cr, uid, ids, context=context):
res[record.id] = {}
@@ -74,18 +48,15 @@ class hr_holidays_status(osv.osv):
if record.id in grouped_lines:
leaves_taken = -sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'remove'])
max_leaves = sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'add'])
-
res[record.id]['max_leaves'] = max_leaves
res[record.id]['leaves_taken'] = leaves_taken
res[record.id]['remaining_leaves'] = max_leaves - leaves_taken
-
return res
def _user_left_days(self, cr, uid, ids, name, args, context=None):
return_false = False
employee_id = False
res = {}
-
if context and context.has_key('employee_id'):
if not context['employee_id']:
return_false = True
@@ -102,14 +73,13 @@ class hr_holidays_status(osv.osv):
res = dict.fromkeys(ids, {'leaves_taken': 0, 'remaining_leaves': 0, 'max_leaves': 0})
return res
- # To do: we can add remaining_leaves_category field to display remaining leaves for particular type
_columns = {
'name': fields.char('Leave Type', size=64, required=True, translate=True),
- 'categ_id': fields.many2one('crm.case.categ', 'Meeting Category', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you link this type of leave with a category in the CRM, it will synchronize each leave asked with a case in this category, to display it in the company shared calendar for example.'),
+ 'categ_id': fields.many2one('crm.case.categ', 'Meeting', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you set a meeting type, OpenERP will create a meeting in the calendar once a leave is validated.'),
'color_name': fields.selection([('red', 'Red'),('blue','Blue'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color in Report', required=True, help='This color will be used in the leaves summary located in Reporting\Leaves by Departement'),
'limit': fields.boolean('Allow to Override Limit', help='If you tick this checkbox, the system will allow, for this section, the employees to take more leaves than the available ones.'),
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the leave type without removing it."),
- 'max_leaves': fields.function(_user_left_days, method=True, string='Maximum Leaves Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'),
+ 'max_leaves': fields.function(_user_left_days, method=True, string='Maximum Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'),
'leaves_taken': fields.function(_user_left_days, method=True, string='Leaves Already Taken', help='This value is given by the sum of all holidays requests with a negative value.', multi='user_left_days'),
'remaining_leaves': fields.function(_user_left_days, method=True, string='Remaining Leaves', help='Maximum Leaves Allowed - Leaves Already Taken', multi='user_left_days'),
'double_validation': fields.boolean('Apply Double Validation', help="If its True then its Allocation/Request have to be validated by second validator")
@@ -118,7 +88,6 @@ class hr_holidays_status(osv.osv):
'color_name': 'red',
'active': True,
}
-
hr_holidays_status()
class hr_holidays(osv.osv):
@@ -132,12 +101,23 @@ class hr_holidays(osv.osv):
return ids[0]
return False
+ def _compute_number_of_days(self, cr, uid, ids, name, args, context=None):
+ result = {}
+ for hol in self.browse(cr, uid, ids, context=context):
+ if hol.type=='remove':
+ result[hol.id] = -hol.number_of_days_temp
+ else:
+ result[hol.id] = hol.number_of_days_temp
+ return result
+
_columns = {
'name': fields.char('Description', required=True, size=64),
- 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
+ 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
+ ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')],
+ 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
If the admin accepts it, the state is \'Approved\'. If it is refused, the state is \'Refused\'.'),
+ 'user_id':fields.related('employee_id', 'user_id', type='many2one', relation='res.users', string='User', store=True),
'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
- 'user_id':fields.many2one('res.users', 'User', states={'draft':[('readonly',False)]}, select=True, readonly=True),
'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
'holiday_status_id': fields.many2one("hr.holidays.status", "Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
'employee_id': fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
@@ -145,27 +125,29 @@ class hr_holidays(osv.osv):
#'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
- 'number_of_days': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
- 'case_id': fields.many2one('crm.meeting', 'Case'),
+ 'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True),
+ 'case_id': fields.many2one('crm.meeting', 'Meeting'),
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"),
- 'allocation_type': fields.selection([('employee','Employee Request'),('company','Company Allocation')], 'Allocation Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help='This field is only for informative purposes, to depict if the leave request/allocation comes from an employee or from the company'),
'parent_id': fields.many2one('hr.holidays', 'Parent'),
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
- 'category_id': fields.many2one('hr.employee.category', "Category", help='Category Of employee'),
+ 'category_id': fields.many2one('hr.employee.category', "Category", help='Category of Employee'),
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category', required=True),
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
}
-
_defaults = {
'employee_id': _employee_get,
'state': 'draft',
'type': 'remove',
- 'allocation_type': 'employee',
'user_id': lambda obj, cr, uid, context: uid,
'holiday_type': 'employee'
}
+ _sql_constraints = [
+ ('type_value', "CHECK( (holiday_type='employee' AND employee_id IS NOT NULL) or (holiday_type='category' AND category_id IS NOT NULL))", "You have to select an employee or a category"),
+ ('date_check', "CHECK ( number_of_days_temp > 0 )", "The number of days must be greater than 0 !"),
+ ('date_check2', "CHECK ( (type='add') OR (date_from < date_to))", "The start date must be before the end date !")
+ ]
def _create_resource_leave(self, cr, uid, vals, context=None):
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
@@ -178,28 +160,6 @@ class hr_holidays(osv.osv):
leave_ids = obj_res_leave.search(cr, uid, [('holiday_id', 'in', ids)], context=context)
return obj_res_leave.unlink(cr, uid, leave_ids)
- def create(self, cr, uid, vals, context=None):
- if context is None:
- context = {}
- if 'holiday_type' in vals:
- if vals['holiday_type'] == 'employee':
- vals.update({'category_id': False})
- else:
- vals.update({'employee_id': False})
- if context.has_key('type'):
- vals['type'] = context['type']
- if context.has_key('allocation_type'):
- vals['allocation_type'] = context['allocation_type']
- return super(hr_holidays, self).create(cr, uid, vals, context=context)
-
- def write(self, cr, uid, ids, vals, context=None):
- if 'holiday_type' in vals:
- if vals['holiday_type'] == 'employee':
- vals.update({'category_id': False})
- else:
- vals.update({'employee_id': False})
- return super(hr_holidays, self).write(cr, uid, ids, vals, context=context)
-
def onchange_type(self, cr, uid, ids, holiday_type):
result = {}
if holiday_type == 'employee':
@@ -207,9 +167,10 @@ class hr_holidays(osv.osv):
if ids_employee:
result['value'] = {
'employee_id': ids_employee[0]
- }
+ }
return result
+ # TODO: can be improved using resource calendar method
def _get_number_of_days(self, date_from, date_to):
"""Returns a float equals to the timedelta between two dates given as string."""
@@ -220,35 +181,10 @@ class hr_holidays(osv.osv):
diff_day = timedelta.days + float(timedelta.seconds) / 86400
return diff_day
- def _update_user_holidays(self, cr, uid, ids):
- obj_crm_meeting = self.pool.get('crm.meeting')
- for record in self.browse(cr, uid, ids):
- if record.state=='validate':
- if record.case_id:
- obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
- if record.linked_request_ids:
- list_ids = [ lr.id for lr in record.linked_request_ids]
- self.holidays_cancel(cr, uid, list_ids)
- self.unlink(cr, uid, list_ids)
- return True
-
- def _check_date(self, cr, uid, ids, context=None):
- for rec in self.read(cr, uid, ids, ['number_of_days_temp', 'date_from','date_to', 'type']):
- if rec['number_of_days_temp'] < 0:
- return False
- if rec['type'] == 'add':
- continue
- date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S')
- date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S')
- if date_from > date_to:
- return False
- return True
-
- _constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days_temp'])]
-
def unlink(self, cr, uid, ids, context=None):
- self._update_user_holidays(cr, uid, ids)
- self._remove_resouce_leave(cr, uid, ids, context=context)
+ for rec in self.browse(cr, uid, ids, context=context):
+ if rec.state<>'draft':
+ raise osv.except_osv(_('Warning!'),_('You cannot delete a leave which is not in draft state !'))
return super(hr_holidays, self).unlink(cr, uid, ids, context)
def onchange_date_from(self, cr, uid, ids, date_to, date_from):
@@ -264,209 +200,115 @@ class hr_holidays(osv.osv):
}
return result
- def onchange_date_to(self, cr, uid, ids, date_from, date_to):
- return self.onchange_date_from(cr, uid, ids, date_to, date_from)
-
def onchange_sec_id(self, cr, uid, ids, status, context=None):
warning = {}
if status:
- brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, [status], context=context)[0]
+ brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, status, context=context)
if brows_obj.categ_id and brows_obj.categ_id.section_id and not brows_obj.categ_id.section_id.allow_unlink:
warning = {
'title': "Warning for ",
'message': "You won\'t be able to cancel this leave request because the CRM Sales Team of the leave type disallows."
- }
+ }
return {'warning': warning}
def set_to_draft(self, cr, uid, ids, *args):
- wf_service = netsvc.LocalService("workflow")
self.write(cr, uid, ids, {
'state': 'draft',
'manager_id': False,
- 'number_of_days': 0,
})
+ wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_create(uid, 'hr.holidays', id, cr)
return True
- def holidays_validate2(self, cr, uid, ids, *args):
- obj_emp = self.pool.get('hr.employee')
- wf_service = netsvc.LocalService("workflow")
- vals = {'state':'validate1'}
- self.check_holidays(cr, uid, ids)
- ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
- if ids2:
- vals['manager_id'] = ids2[0]
- else:
- raise osv.except_osv(_('Warning !'),_('No user related to the selected employee.'))
- # Second Time Validate all the leave requests of the category
- for leave_id in self._get_category_leave_ids(cr, uid, ids):
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
- return self.write(cr, uid, ids, vals)
-
def holidays_validate(self, cr, uid, ids, *args):
- obj_emp = self.pool.get('hr.employee')
- wf_service = netsvc.LocalService("workflow")
- data_holiday = self.browse(cr, uid, ids)
self.check_holidays(cr, uid, ids)
- vals = {'state':'validate'}
+ obj_emp = self.pool.get('hr.employee')
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
- if ids2:
- if data_holiday[0].state == 'validate1':
- vals['manager_id2'] = ids2[0]
- else:
- vals['manager_id'] = ids2[0]
- else:
- raise osv.except_osv(_('Warning !'), _('No user related to the selected employee.'))
- self.write(cr, uid, ids, vals)
+ manager = ids2 and ids2[0] or False
+ return self.write(cr, uid, ids, {'state':'validate1', 'manager_id': manager})
+
+ def holidays_validate2(self, cr, uid, ids, *args):
+ self.check_holidays(cr, uid, ids)
+ obj_emp = self.pool.get('hr.employee')
+ ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
+ manager = ids2 and ids2[0] or False
+ self.write(cr, uid, ids, {'state':'validate', 'manager_id2': manager})
+ data_holiday = self.browse(cr, uid, ids)
for record in data_holiday:
if record.holiday_type == 'employee' and record.type == 'remove':
- vals = {
- 'name': record.name,
- 'date_from': record.date_from,
- 'date_to': record.date_to,
- 'calendar_id': record.employee_id.calendar_id.id,
- 'company_id': record.employee_id.company_id.id,
- 'resource_id': record.employee_id.resource_id.id,
- 'holiday_id': record.id
- }
- self._create_resource_leave(cr, uid, vals)
- elif record.holiday_type == 'category':
- # Create leave/allocation request for employees in the category
- emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)])
- leave_ids = []
- for emp in obj_emp.browse(cr, uid, emp_ids):
- vals = {
- 'name': record.name,
- 'type': record.type,
- 'holiday_type': 'employee',
- 'holiday_status_id': record.holiday_status_id.id,
- 'date_from': record.date_from,
- 'date_to': record.date_to,
- 'notes': record.notes,
- 'number_of_days_temp': record.number_of_days_temp,
- 'parent_id': record.id,
- 'employee_id': emp.id
- }
- leave_ids.append(self.create(cr, uid, vals, context=None))
- # Confirm and validate all the leave requests of the category
- for leave_id in leave_ids:
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
- return True
-
- def holidays_confirm(self, cr, uid, ids, *args):
- obj_hr_holiday_status = self.pool.get('hr.holidays.status')
- for record in self.browse(cr, uid, ids):
- user_id = False
- leave_asked = record.number_of_days_temp
- if record.holiday_type == 'employee' and record.type == 'remove':
- if record.employee_id and not record.holiday_status_id.limit:
- leaves_rest = obj_hr_holiday_status.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
- if leaves_rest < leave_asked:
- raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s while there are too few remaining leave days.') % (record.employee_id.name))
- nb = -(record.number_of_days_temp)
- elif record.holiday_type == 'category' and record.type == 'remove':
- if record.category_id and not record.holiday_status_id.limit:
- leaves_rest = obj_hr_holiday_status.get_days_cat( cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
- if leaves_rest < leave_asked:
- raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for category %s while there are too few remaining leave days.') % (record.category_id.name))
- nb = -(record.number_of_days_temp)
- else:
- nb = record.number_of_days_temp
-
- if record.holiday_type == 'employee' and record.employee_id:
- user_id = record.employee_id.user_id and record.employee_id.user_id.id or uid
-
- self.write(cr, uid, [record.id], {'state':'confirm', 'number_of_days': nb, 'user_id': user_id})
- return True
-
- def holidays_refuse(self, cr, uid, ids, *args):
- obj_emp = self.pool.get('hr.employee')
- wf_service = netsvc.LocalService("workflow")
- vals = {'state': 'refuse'}
- ids2 = obj_emp.search(cr, uid, [('user_id','=', uid)])
- if ids2:
- vals['manager_id'] = ids2[0]
- # Refuse all the leave requests of the category
- for leave_id in self._get_category_leave_ids(cr, uid, ids):
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'refuse', cr)
- self.write(cr, uid, ids, vals)
- return True
-
- def holidays_cancel(self, cr, uid, ids, *args):
- self._update_user_holidays(cr, uid, ids)
- self.write(cr, uid, ids, {'state': 'cancel'})
- self._remove_resouce_leave(cr, uid, ids)
- return True
-
- def holidays_draft(self, cr, uid, ids, *args):
- wf_service = netsvc.LocalService("workflow")
- for leave_id in self._get_category_leave_ids(cr, uid, ids):
- wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'draft', cr)
- return self.write(cr, uid, ids, {'state': 'draft'})
-
- def check_holidays(self, cr, uid, ids):
- holi_status_obj = self.pool.get('hr.holidays.status')
- emp_obj = self.pool.get('hr.employee')
- meeting_obj = self.pool.get('crm.meeting')
- for record in self.browse(cr, uid, ids):
- if not record.number_of_days:
- raise osv.except_osv(_('Warning!'), _('Wrong leave definition.'))
- if record.holiday_type=='employee' and record.employee_id:
- leave_asked = record.number_of_days
- if leave_asked < 0.00:
- if not record.holiday_status_id.limit:
- leaves_rest = holi_status_obj.get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
- if leaves_rest < -(leave_asked):
- raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
- elif record.holiday_type == 'category' and record.category_id:
- leave_asked = record.number_of_days
- if leave_asked < 0.00:
- if not record.holiday_status_id.limit:
- leaves_rest = holi_status_obj.get_days_cat(cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
- if leaves_rest < -(leave_asked):
- raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
- else:# This condition will never meet!!
- holiday_ids = []
- vals = {
- 'name': record.name,
- 'holiday_status_id': record.holiday_status_id.id,
- 'state': 'draft',
- 'date_from': record.date_from,
- 'date_to': record.date_to,
- 'notes': record.notes,
- 'number_of_days': record.number_of_days,
- 'number_of_days_temp': record.number_of_days_temp,
- 'type': record.type,
- 'allocation_type': record.allocation_type,
- 'parent_id': record.id,
- }
- employee_ids = emp_obj.search(cr, uid, [])
- for employee in employee_ids:
- vals['employee_id'] = employee
- user_id = emp_obj.search(cr, uid, [('user_id','=',uid)])
- if user_id:
- vals['user_id'] = user_id[0]
- holiday_ids.append(self.create(cr, uid, vals, context=None))
- self.holidays_confirm(cr, uid, holiday_ids)
- self.holidays_validate(cr, uid, holiday_ids)
-
- if record.holiday_status_id.categ_id and record.date_from and record.date_to and record.employee_id:
- diff_day = self._get_number_of_days(record.date_from, record.date_to)
+ meeting_obj = self.pool.get('crm.meeting')
vals = {
'name': record.name,
'categ_id': record.holiday_status_id.categ_id.id,
- 'duration': (diff_day) * 8,
+ 'duration': record.number_of_days_temp * 8,
'note': record.notes,
'user_id': record.user_id.id,
'date': record.date_from,
+ 'end_date': record.date_to,
+ 'date_deadline': record.date_to,
}
case_id = meeting_obj.create(cr, uid, vals)
self.write(cr, uid, ids, {'case_id': case_id})
+ elif record.holiday_type == 'category':
+ emp_ids = obj_emp.search(cr, uid, [('category_ids', 'child_of', [record.category_id.id])])
+ leave_ids = []
+ for emp in obj_emp.browse(cr, uid, emp_ids):
+ vals = {
+ 'name': record.name,
+ 'type': record.type,
+ 'holiday_type': 'employee',
+ 'holiday_status_id': record.holiday_status_id.id,
+ 'date_from': record.date_from,
+ 'date_to': record.date_to,
+ 'notes': record.notes,
+ 'number_of_days_temp': record.number_of_days_temp,
+ 'parent_id': record.id,
+ 'employee_id': emp.id
+ }
+ leave_ids.append(self.create(cr, uid, vals, context=None))
+ wf_service = netsvc.LocalService("workflow")
+ for leave_id in leave_ids:
+ wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
+ wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
+ wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
+ return True
+
+ def holidays_confirm(self, cr, uid, ids, *args):
+ self.check_holidays(cr, uid, ids)
+ return self.write(cr, uid, ids, {'state':'confirm'})
+
+ def holidays_refuse(self, cr, uid, ids, *args):
+ obj_emp = self.pool.get('hr.employee')
+ ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
+ manager = ids2 and ids2[0] or False
+ self.write(cr, uid, ids, {'state': 'refuse', 'manager_id2': manager})
+ self.holidays_cancel(cr, uid, ids)
+ return True
+
+ def holidays_cancel(self, cr, uid, ids, *args):
+ obj_crm_meeting = self.pool.get('crm.meeting')
+ for record in self.browse(cr, uid, ids):
+ # Delete the meeting
+ if record.case_id:
+ obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
+
+ # If a category that created several holidays, cancel all related
+ wf_service = netsvc.LocalService("workflow")
+ for id in record.linked_request_ids or []:
+ wf_service.trg_validate(uid, 'hr.holidays', id, 'cancel', cr)
return True
+ def check_holidays(self, cr, uid, ids):
+ holi_status_obj = self.pool.get('hr.holidays.status')
+ for record in self.browse(cr, uid, ids):
+ if record.holiday_type == 'employee' and record.type == 'remove':
+ if record.employee_id and not record.holiday_status_id.limit:
+ leaves_rest = holi_status_obj.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
+ if leaves_rest < record.number_of_days_temp:
+ raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s: too few remaining days (%s).') % (record.employee_id.name, leaves_rest))
+ return True
hr_holidays()
class resource_calendar_leaves(osv.osv):
@@ -478,4 +320,3 @@ class resource_calendar_leaves(osv.osv):
resource_calendar_leaves()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 0fddec73ee0..44e5a214c54 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -56,7 +56,7 @@
calendar
-
+
@@ -70,8 +70,8 @@
| | | | | | | | |