Filter By [[ get_filter(data)!='No Filter' and '' or removeParentNode('font') ]]
Display Account
-
Printing Date
+
Target Moves
[[ get_account(data) or removeParentNode('para') ]]
@@ -187,7 +187,7 @@
[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]
Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]
Display Account
-
Printing Date
+
Target Moves
[[ get_account(data) or removeParentNode('para') ]]
@@ -186,7 +186,7 @@
[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]
Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]
Partner's
-
Printing Date
+
Target Moves
-
-
[[ get_account(data) or '' ]]
+
+
[[ get_account(data) or '' ]]
[[ get_fiscalyear(data) or '' ]]
-
[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]
+
[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]
[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]]
- [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]]
-
-
Start Date
-
End Date
-
-
-
[[ formatLang(get_start_date(data),date=True) ]]
-
[[ formatLang(get_end_date(data),date=True) ]]
-
-
- [[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]]
-
-
Start Period
-
End Period
-
-
-
[[ get_start_period(data) or removeParentNode('para') ]]
-
[[ get_end_period(data) or removeParentNode('para') ]]
diff --git a/addons/account/report/invoice.py b/addons/account/report/account_print_invoice.py
similarity index 95%
rename from addons/account/report/invoice.py
rename to addons/account/report/account_print_invoice.py
index b232a33b9d9..280bc0bc7a0 100644
--- a/addons/account/report/invoice.py
+++ b/addons/account/report/account_print_invoice.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -31,7 +31,7 @@ class account_invoice(report_sxw.rml_parse):
report_sxw.report_sxw(
'report.account.invoice',
'account.invoice',
- 'addons/account/report/invoice.rml',
+ 'addons/account/report/account_print_invoice.rml',
parser=account_invoice
)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/invoice.rml b/addons/account/report/account_print_invoice.rml
similarity index 100%
rename from addons/account/report/invoice.rml
rename to addons/account/report/account_print_invoice.rml
diff --git a/addons/account/report/overdue.py b/addons/account/report/account_print_overdue.py
similarity index 98%
rename from addons/account/report/overdue.py
rename to addons/account/report/account_print_overdue.py
index ebf50224a50..c59dd56a02f 100644
--- a/addons/account/report/overdue.py
+++ b/addons/account/report/account_print_overdue.py
@@ -90,7 +90,7 @@ class Overdue(report_sxw.rml_parse):
return message
report_sxw.report_sxw('report.account.overdue', 'res.partner',
- 'addons/account/report/overdue.rml', parser=Overdue)
+ 'addons/account/report/account_print_overdue.rml', parser=Overdue)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/overdue.rml b/addons/account/report/account_print_overdue.rml
similarity index 100%
rename from addons/account/report/overdue.rml
rename to addons/account/report/account_print_overdue.rml
diff --git a/addons/account/report/account_profit_horizontal.rml b/addons/account/report/account_profit_horizontal.rml
index d55b2e93a43..8c66f223df9 100644
--- a/addons/account/report/account_profit_horizontal.rml
+++ b/addons/account/report/account_profit_horizontal.rml
@@ -156,7 +156,7 @@
Fiscal Year
Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]
Display Account
-
Printing Date
+
Target Moves
[[ get_account(data) or removeParentNode('para') ]]
@@ -184,7 +184,7 @@
[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]
Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]
Display Account
-
Printing Date
+
Target Moves
[[ get_account(data) or removeParentNode('para') ]]
@@ -185,7 +185,7 @@
[[ (data['form']['display_account']=='bal_all' and 'All') or (data['form']['display_account']=='bal_movement' and 'With movements') or 'With balance is not equal to 0']]
diff --git a/addons/account/report/tax_report.py b/addons/account/report/account_tax_report.py
similarity index 90%
rename from addons/account/report/tax_report.py
rename to addons/account/report/account_tax_report.py
index a89335f99c5..d9bcabf0ce4 100644
--- a/addons/account/report/tax_report.py
+++ b/addons/account/report/account_tax_report.py
@@ -36,7 +36,7 @@ class tax_report(rml_parse.rml_parse):
'get_general': self._get_general,
'get_company': self._get_company,
'get_currency': self._get_currency,
- 'get_lines' : self._get_lines,
+ 'get_lines': self._get_lines,
})
@@ -45,12 +45,12 @@ class tax_report(rml_parse.rml_parse):
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
- else :
+ else:
self.cr.execute ("select id from account_fiscalyear")
fy = self.cr.fetchall()
self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
periods = self.cr.fetchall()
- for p in periods :
+ for p in periods:
period_list.append(p[0])
res = self._add_codes(based_on, res, period_list, context=context)
@@ -58,20 +58,20 @@ class tax_report(rml_parse.rml_parse):
top_result = []
while i < len(res):
- res_dict = { 'code' : res[i][1].code,
- 'name' : res[i][1].name,
- 'debit' : 0,
- 'credit' : 0,
- 'tax_amount' : res[i][1].sum_period,
- 'type' : 1,
- 'level' : res[i][0],
- 'pos' : 0
+ res_dict = { 'code': res[i][1].code,
+ 'name': res[i][1].name,
+ 'debit': 0,
+ 'credit': 0,
+ 'tax_amount': res[i][1].sum_period,
+ 'type': 1,
+ 'level': res[i][0],
+ 'pos': 0
}
top_result.append(res_dict)
res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, context=context)
ind_general = 0
- while ind_general < len(res_general) :
+ while ind_general < len(res_general):
res_general[ind_general]['type'] = 2
res_general[ind_general]['pos'] = 0
res_general[ind_general]['level'] = res_dict['level']
@@ -84,7 +84,7 @@ class tax_report(rml_parse.rml_parse):
def _get_period(self, period_id, context={}):
return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name
- def _get_general(self, tax_code_id, period_list ,company_id, based_on, context={}):
+ def _get_general(self, tax_code_id, period_list,company_id, based_on, context={}):
res=[]
obj_account = self.pool.get('account.account')
periods_ids = tuple(period_list)
@@ -112,7 +112,7 @@ class tax_report(rml_parse.rml_parse):
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, periods_ids, 'paid',))
- else :
+ else:
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
SUM(line.credit) AS credit, \
@@ -191,14 +191,14 @@ class tax_report(rml_parse.rml_parse):
while (bcl_current_level >= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
tot_elem = copy.copy(accounts[bcl_rup_ind], context=context)
- res_tot = { 'code' : accounts[bcl_rup_ind]['code'],
- 'name' : '',
- 'debit' : 0,
- 'credit' : 0,
- 'tax_amount' : accounts[bcl_rup_ind]['tax_amount'],
- 'type' : accounts[bcl_rup_ind]['type'],
- 'level' : 0,
- 'pos' : 0
+ res_tot = { 'code': accounts[bcl_rup_ind]['code'],
+ 'name': '',
+ 'debit': 0,
+ 'credit': 0,
+ 'tax_amount': accounts[bcl_rup_ind]['tax_amount'],
+ 'type': accounts[bcl_rup_ind]['type'],
+ 'level': 0,
+ 'pos': 0
}
if res_tot['type'] == 1:
@@ -215,6 +215,6 @@ class tax_report(rml_parse.rml_parse):
return result_accounts
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
- 'addons/account/report/tax_report.rml', parser=tax_report, header="internal")
+ 'addons/account/report/account_tax_report.rml', parser=tax_report, header="internal")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/report/tax_report.rml b/addons/account/report/account_tax_report.rml
similarity index 100%
rename from addons/account/report/tax_report.rml
rename to addons/account/report/account_tax_report.rml
diff --git a/addons/account/report/voucher_print.py b/addons/account/report/account_voucher_print.py
similarity index 81%
rename from addons/account/report/voucher_print.py
rename to addons/account/report/account_voucher_print.py
index 8d763837c1f..44587b3e689 100644
--- a/addons/account/report/voucher_print.py
+++ b/addons/account/report/account_voucher_print.py
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
+# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved
# $Id$
#
@@ -21,27 +21,25 @@
##############################################################################
import time
+
from report import report_sxw
from tools import amount_to_text_en
class report_voucher_move(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(report_voucher_move, self).__init__(cr, uid, name, context)
+ def __init__(self, cr, uid, name, context=None):
+ super(report_voucher_move, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'convert':self.convert,
'get_title': self.get_title,
'debit':self.debit,
'credit':self.credit,
- #'get_ref' : self._get_ref
})
- self.user=uid
-
+ self.user = uid
+
def convert(self, amount):
- user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0]
- cur = user_id.company_id.currency_id.name
- amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur);
- return amt_en
+ user_id = self.pool.get('res.users').browse(self.cr, self.user, [self.user])[0]
+ return amount_to_text_en.amount_to_text(amount, 'en', user_id.company_id.currency_id.name)
def get_title(self, voucher):
title = ''
@@ -49,22 +47,24 @@ class report_voucher_move(report_sxw.rml_parse):
type = voucher.journal_id.type
title = type[0].swapcase() + type[1:] + " Voucher"
return title
-
+
def debit(self, move_ids):
debit = 0.0
for move in move_ids:
debit +=move.debit
return debit
-
+
def credit(self, move_ids):
credit = 0.0
for move in move_ids:
credit +=move.credit
return credit
-
+
report_sxw.report_sxw(
'report.account.move.voucher',
'account.move',
- 'addons/account/report/voucher_print.rml',
+ 'addons/account/report/account_voucher_print.rml',
parser=report_voucher_move,header="external"
)
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account/report/voucher_print.rml b/addons/account/report/account_voucher_print.rml
similarity index 100%
rename from addons/account/report/voucher_print.rml
rename to addons/account/report/account_voucher_print.rml
diff --git a/addons/account/report/common_report_header.py b/addons/account/report/common_report_header.py
index 3bce3c10ed0..35d0c1356ef 100644
--- a/addons/account/report/common_report_header.py
+++ b/addons/account/report/common_report_header.py
@@ -60,6 +60,13 @@ class common_report_header(object):
return data['form']['date_from']
return ''
+ def _get_target_move(self, data):
+ if data.get('form', False) and data['form'].get('target_move', False):
+ if data['form']['target_move'] == 'all':
+ return 'All Entries'
+ return 'All Posted Entries'
+ return ''
+
def _get_end_date(self, data):
if data.get('form', False) and data['form'].get('date_to', False):
return data['form']['date_to']
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index f7b62aa164f..56e75a3c036 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -20,14 +20,16 @@
"access_account_tax","account.tax","model_account_tax","account.group_account_invoice",1,0,0,0
"access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1
"access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1
+"access_account_model_manager","account.model","model_account_model","account.group_account_manager",1,1,1,1
+"access_account_model_line_manager","account.model.line","model_account_model_line","account.group_account_manager",1,1,1,1
"access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1
"access_account_subscription_line","account.subscription.line","model_account_subscription_line","account.group_account_user",1,1,1,1
"access_account_subscription_manager","account.subscription manager","model_account_subscription","account.group_account_manager",1,0,0,0
"access_account_subscription_line_manager","account.subscription.line manager","model_account_subscription_line","account.group_account_manager",1,0,0,0
-"access_account_account_template","account.account.template","model_account_account_template","account.group_account_manager",1,0,0,0
-"access_account_tax_code_template","account.tax.code.template","model_account_tax_code_template","account.group_account_manager",1,0,0,0
+"access_account_account_template","account.account.template","model_account_account_template","account.group_account_manager",1,1,1,1
+"access_account_tax_code_template","account.tax.code.template","model_account_tax_code_template","account.group_account_manager",1,1,1,1
"access_account_chart_template","account.chart.template","model_account_chart_template","account.group_account_manager",1,1,1,1
-"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,0,0,0
+"access_account_tax_template","account.tax.template","model_account_tax_template","account.group_account_manager",1,1,1,1
"access_account_bank_statement","account.bank.statement","model_account_bank_statement","account.group_account_user",1,0,0,0
"access_account_bank_statement_line","account.bank.statement.line","model_account_bank_statement_line","account.group_account_user",1,0,0,0
"access_account_analytic_line","account.analytic.line","model_account_analytic_line","account.group_account_user",1,1,1,1
@@ -41,22 +43,22 @@
"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
"access_account_journal_period_uinvoice","account.journal.period","model_account_journal_period","account.group_account_invoice",1,1,1,1
-"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,0,0,0
+"access_account_payment_term_manager","account.payment.term","model_account_payment_term","account.group_account_manager",1,1,1,1
"access_account_payment_term_line_manager","account.payment.term.line","model_account_payment_term_line","account.group_account_manager",1,0,0,0
-"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,0,0,0
-"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,0,0,0
-"access_account_account_manager","account.account","model_account_account","account.group_account_manager",1,0,0,0
-"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,0,0,0
+"access_account_account_type_manager","account.account.type","model_account_account_type","account.group_account_manager",1,1,1,1
+"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
+"access_account_account_manager","account.account","model_account_account","account.group_account_manager",1,1,1,1
+"access_account_journal_view_manager","account.journal.view","model_account_journal_view","account.group_account_manager",1,1,1,1
"access_account_journal_column_manager","account.journal.column","model_account_journal_column","account.group_account_manager",1,0,0,0
-"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,0,0,0
+"access_account_journal_manager","account.journal","model_account_journal","account.group_account_manager",1,1,1,1
"access_account_journal_invoice","account.journal invoice","model_account_journal","account.group_account_invoice",1,0,0,0
-"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,0,0,0
+"access_account_period_manager","account.period","model_account_period","account.group_account_manager",1,1,1,1
"access_account_period_invoice","account.period invoice","model_account_period","account.group_account_invoice",1,0,0,0
-"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,0,0,0
+"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
-"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","account.group_account_manager",1,0,0,0
-"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,0,0,0
-"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,0,0,0
+"access_account_analytic_account_manager","account.analytic.account","analytic.model_account_analytic_account","account.group_account_manager",1,1,1,1
+"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
+"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
"access_account_fiscalyear_user","account.fiscalyear.user","model_account_fiscalyear","account.group_account_user",1,0,0,0
"access_account_fiscalyear_invoice","account.fiscalyear.invoice","model_account_fiscalyear","account.group_account_invoice",1,0,0,0
"access_account_fiscalyear_partner_manager","account.fiscalyear.partnermanager","model_account_fiscalyear","base.group_partner_manager",1,0,0,0
@@ -68,13 +70,13 @@
"access_account_payment_term_line_partner_manager","account.payment.term.line partner manager","model_account_payment_term_line","base.group_user",1,0,0,0
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
-"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,0,0,0
+"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,0,0,0
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
-"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,0,0,0
+"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,0,0,0
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,0,0,0
"access_account_sequence_fiscal_year","account.sequence.fiscalyear","model_account_sequence_fiscalyear","account.group_account_user",1,1,1,1
@@ -149,8 +151,3 @@
"access_report_account_receivable_invoice","report.account.receivable.invoice","model_report_account_receivable","account.group_account_invoice",1,1,1,1
"access_report_account_receivable_user","report.account.receivable.user","model_report_account_receivable","account.group_account_user",1,1,1,1
"access_account_sequence_fiscal_year_invoice","account.sequence.fiscalyear invoice","model_account_sequence_fiscalyear","account.group_account_invoice",1,1,1,1
-"access_account_analytic_journal_analytic_accounting","account.analytic.journal","model_account_analytic_journal","analytic.group_analytic_accounting",1,1,1,1
-"access_account_account_analytic_accounting","account.account","model_account_account","analytic.group_analytic_accounting",1,0,0,0
-"access_product_product_analytic_accounting","product.product","product.model_product_product","analytic.group_analytic_accounting",1,0,0,0
-"access_product_category_analytic_accounting","product.category","product.model_product_category","analytic.group_analytic_accounting",1,0,0,0
-"access_product_template_analytic_accounting","product.template","product.model_product_template","analytic.group_analytic_accounting",1,0,0,0
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
index f94082445da..6a1afc45bcf 100644
--- a/addons/account/wizard/account_automatic_reconcile.py
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -21,7 +21,6 @@
import time
-import netsvc
from osv import osv, fields
from tools.translate import _
@@ -150,12 +149,12 @@ class account_automatic_reconcile(osv.osv_memory):
for account_id in form['account_ids']:
params = (account_id,)
if not allow_write_off:
- query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
- AND state <> 'draft' GROUP BY partner_id
+ query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
+ AND state <> 'draft' GROUP BY partner_id
HAVING ABS(SUM(debit-credit)) = 0.0 AND count(*)>0"""
else:
- query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
- AND state <> 'draft' GROUP BY partner_id
+ query = """SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL
+ AND state <> 'draft' GROUP BY partner_id
HAVING ABS(SUM(debit-credit)) < %s AND count(*)>0"""
params += (max_amount,)
# reconcile automatically all transactions from partners whose balance is 0
diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py
index 4e74774ce58..c7e75f205f8 100644
--- a/addons/account/wizard/account_invoice_refund.py
+++ b/addons/account/wizard/account_invoice_refund.py
@@ -202,14 +202,11 @@ class account_invoice_refund(osv.osv_memory):
inv_obj.write(cr, uid, [inv_id], data['value'])
created_inv.append(inv_id)
- if inv.type == 'out_invoice':
- xml_id = 'action_invoice_tree1'
- elif inv.type == 'in_invoice':
- xml_id = 'action_invoice_tree2'
- elif inv.type == 'out_refund':
+ if inv.type in ('out_invoice', 'out_refund'):
xml_id = 'action_invoice_tree3'
else:
xml_id = 'action_invoice_tree4'
+
result = mod_obj._get_id(cr, uid, 'account', xml_id)
id = mod_obj.read(cr, uid, result, ['res_id'], context=context)['res_id']
result = act_obj.read(cr, uid, id, context=context)
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py
index 8422ece3fcb..c03176a0536 100644
--- a/addons/account/wizard/account_move_journal.py
+++ b/addons/account/wizard/account_move_journal.py
@@ -43,7 +43,7 @@ class account_move_journal(osv.osv_memory):
"""
journal_id = False
-
+
journal_pool = self.pool.get('account.journal')
if context.get('journal_type', False):
jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])
@@ -52,7 +52,7 @@ class account_move_journal(osv.osv_memory):
journal_id = jids[0]
return journal_id
-
+
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
"""
Returns views and fields for current model where view will depend on {view_type}.
@@ -62,7 +62,7 @@ class account_move_journal(osv.osv_memory):
@param view_type: defines a view type. it can be one of (form, tree, graph, calender, gantt, search, mdx)
@param context: context arguments, like lang, time zone
@param toolbar: contains a list of reports, wizards, and links related to current model
-
+
@return: Returns a dict that contains definition for fields, views, and toolbars
"""
@@ -115,47 +115,47 @@ class account_move_journal(osv.osv_memory):
@param ids: account move journal’s ID or list of IDs
@return: dictionary of Open action move line window on given period and Journal/Payment Mode
"""
-
+
period_pool = self.pool.get('account.journal.period')
data_pool = self.pool.get('ir.model.data')
journal_pool = self.pool.get('account.journal')
-
+
if context is None:
context = {}
-
+
journal_id = self._get_journal(cr, uid, context)
period_id = self._get_period(cr, uid, context)
name = _("Journal Items")
if journal_id:
ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context)
-
- if not len(ids):
+
+ if not ids:
journal = journal_pool.browse(cr, uid, journal_id)
period = self.pool.get('account.period').browse(cr, uid, period_id)
-
+
name = journal.name
state = period.state
-
+
if state == 'done':
raise osv.except_osv(_('UserError'), _('This period is already closed !'))
-
+
company = period.company_id.id
res = {
- 'name': name,
- 'period_id': period_id,
- 'journal_id': journal_id,
+ 'name': name,
+ 'period_id': period_id,
+ 'journal_id': journal_id,
'company_id': company
}
period_pool.create(cr, uid, res,context=context)
-
+
ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
period = period_pool.browse(cr, uid, ids[0], context=context)
name = (period.journal_id.code or '') + ':' + (period.period_id.code or '')
-
+
result = data_pool._get_id(cr, uid, 'account', 'view_account_move_line_filter')
res_id = data_pool.browse(cr, uid, result, context=context).res_id
-
+
return {
'name': name,
'view_type': 'form',
@@ -166,7 +166,7 @@ class account_move_journal(osv.osv_memory):
'type': 'ir.actions.act_window',
'search_view_id': res_id
}
-
+
account_move_journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_report_account_balance.py b/addons/account/wizard/account_report_account_balance.py
index 475a7da5a74..6b8c4371dd2 100644
--- a/addons/account/wizard/account_report_account_balance.py
+++ b/addons/account/wizard/account_report_account_balance.py
@@ -21,21 +21,15 @@
from lxml import etree
-from osv import osv, fields
+from osv import osv
class account_balance_report(osv.osv_memory):
_inherit = "account.common.account.report"
_name = 'account.balance.report'
_description = 'Trial Balance Report'
- _columns = {
- 'target_move': fields.selection([('all', 'All Entries'),
- ('posted', 'All Posted Entries')], 'Target Moves', required=True),
- }
-
_defaults = {
'journal_ids': [],
- 'target_move': 'all'
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
@@ -51,7 +45,6 @@ class account_balance_report(osv.osv_memory):
def _print_report(self, cr, uid, ids, data, context=None):
data = self.pre_print_report(cr, uid, ids, data, context=context)
- data['form'].update(self.read(cr, uid, ids, ['target_move'])[0])
return {'type': 'ir.actions.report.xml', 'report_name': 'account.account.balance', 'datas': data}
account_balance_report()
diff --git a/addons/account/wizard/account_report_account_balance_view.xml b/addons/account/wizard/account_report_account_balance_view.xml
index 8c09e954dbf..eb31f4e20f0 100644
--- a/addons/account/wizard/account_report_account_balance_view.xml
+++ b/addons/account/wizard/account_report_account_balance_view.xml
@@ -9,9 +9,8 @@
form
-
+
-
diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py
index f421f3735fa..f13214cb6da 100644
--- a/addons/account/wizard/account_report_aged_partner_balance.py
+++ b/addons/account/wizard/account_report_aged_partner_balance.py
@@ -40,7 +40,7 @@ class account_aged_trial_balance(osv.osv_memory):
}
_defaults = {
'period_length': 30,
- 'date_from' : time.strftime('%Y-%m-%d'),
+ 'date_from': time.strftime('%Y-%m-%d'),
'direction_selection': 'past',
}
@@ -84,7 +84,7 @@ class account_aged_trial_balance(osv.osv_memory):
for i in range(5):
stop = start + relativedelta(days=period_length)
res[str(5-(i+1))] = {
- 'name' : (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
+ 'name': (i!=4 and str((i) * period_length)+'-' + str((i+1) * period_length) or ('+'+str(4 * period_length))),
'start': start.strftime('%Y-%m-%d'),
'stop': (i!=4 and stop.strftime('%Y-%m-%d') or False),
}
diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml
index 9f894f0f670..ad9c90b2e36 100644
--- a/addons/account/wizard/account_report_aged_partner_balance_view.xml
+++ b/addons/account/wizard/account_report_aged_partner_balance_view.xml
@@ -17,7 +17,6 @@
-
diff --git a/addons/account/wizard/account_report_balance_sheet.py b/addons/account/wizard/account_report_balance_sheet.py
index df6d58c9ae7..a4ad0c58524 100644
--- a/addons/account/wizard/account_report_balance_sheet.py
+++ b/addons/account/wizard/account_report_balance_sheet.py
@@ -36,14 +36,11 @@ class account_bs_report(osv.osv_memory):
'display_type': fields.boolean("Landscape Mode"),
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',required = True,
help='This Account is used for trasfering Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]),
- 'target_move': fields.selection([('all', 'All Entries'),
- ('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults={
'display_type': True,
'journal_ids': [],
- 'target_move': 'all',
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
@@ -65,7 +62,7 @@ class account_bs_report(osv.osv_memory):
if not account.company_id.property_reserve_and_surplus_account:
raise osv.except_osv(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
data['form']['reserve_account_id'] = account.company_id.property_reserve_and_surplus_account.id
- data['form'].update(self.read(cr, uid, ids, ['display_type','target_move'])[0])
+ data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
if data['form']['display_type']:
return {
'type': 'ir.actions.report.xml',
diff --git a/addons/account/wizard/account_report_balance_sheet_view.xml b/addons/account/wizard/account_report_balance_sheet_view.xml
index f0a943fd050..f1c5ef35de9 100644
--- a/addons/account/wizard/account_report_balance_sheet_view.xml
+++ b/addons/account/wizard/account_report_balance_sheet_view.xml
@@ -8,9 +8,8 @@
form
-
+
-
diff --git a/addons/account/wizard/account_report_central_journal.py b/addons/account/wizard/account_report_central_journal.py
index 0b402ae5f3d..d66be0a70e4 100644
--- a/addons/account/wizard/account_report_central_journal.py
+++ b/addons/account/wizard/account_report_central_journal.py
@@ -18,7 +18,8 @@
# along with this program. If not, see .
#
##############################################################################
-from osv import osv, fields
+
+from osv import osv
class account_central_journal(osv.osv_memory):
_name = 'account.central.journal'
diff --git a/addons/account/wizard/account_report_central_journal_view.xml b/addons/account/wizard/account_report_central_journal_view.xml
index 3e24510a470..ca7103c685e 100644
--- a/addons/account/wizard/account_report_central_journal_view.xml
+++ b/addons/account/wizard/account_report_central_journal_view.xml
@@ -8,7 +8,7 @@
form
-
+
diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py
index ed5e5b144ef..038973c4ed8 100644
--- a/addons/account/wizard/account_report_common.py
+++ b/addons/account/wizard/account_report_common.py
@@ -40,7 +40,10 @@ class account_common_report(osv.osv_memory):
'journal_ids': fields.many2many('account.journal', 'account_common_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'date_from': fields.date("Start Date"),
'date_to': fields.date("End Date"),
- }
+ 'target_move': fields.selection([('all', 'All Entries'),
+ ('posted', 'All Posted Entries')], 'Target Moves', required=True),
+
+ }
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')
@@ -101,6 +104,7 @@ class account_common_report(osv.osv_memory):
'journal_ids': _get_all_journal,
'filter': 'filter_no',
'chart_account_id': _get_account,
+ 'target_move': 'all',
}
def _build_contexts(self, cr, uid, ids, data, context=None):
@@ -118,7 +122,8 @@ class account_common_report(osv.osv_memory):
elif data['form']['filter'] == 'filter_period':
if not data['form']['period_from'] or not data['form']['period_to']:
raise osv.except_osv(_('Error'),_('Select a starting and an ending period'))
- result['periods'] = period_obj.build_ctx_periods(cr, uid, data['form']['period_from'], data['form']['period_to'])
+ result['period_from'] = data['form']['period_from']
+ result['period_to'] = data['form']['period_to']
return result
def _print_report(self, cr, uid, ids, data, context=None):
@@ -131,7 +136,7 @@ class account_common_report(osv.osv_memory):
data = {}
data['ids'] = context.get('active_ids', [])
data['model'] = context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id'])[0]
+ data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from', 'period_to', 'filter', 'chart_account_id', 'target_move'])[0]
used_context = self._build_contexts(cr, uid, ids, data, context=context)
data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
data['form']['used_context'] = used_context
diff --git a/addons/account/wizard/account_report_common_partner.py b/addons/account/wizard/account_report_common_partner.py
index 35ece1c0b02..d9f3934d9a4 100644
--- a/addons/account/wizard/account_report_common_partner.py
+++ b/addons/account/wizard/account_report_common_partner.py
@@ -30,19 +30,16 @@ class account_common_partner_report(osv.osv_memory):
('supplier','Payable Accounts'),
('customer_supplier' ,'Receivable and Payable Accounts')],
"Partner's", required=True),
- 'target_move': fields.selection([('all', 'All Entries'),
- ('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults = {
'result_selection': 'customer',
- 'target_move': 'all'
}
def pre_print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
- data['form'].update(self.read(cr, uid, ids, ['result_selection', 'target_move'])[0])
+ data['form'].update(self.read(cr, uid, ids, ['result_selection'])[0])
return data
account_common_partner_report()
diff --git a/addons/account/wizard/account_report_common_view.xml b/addons/account/wizard/account_report_common_view.xml
index ec3aa6b227b..b9c629acf28 100644
--- a/addons/account/wizard/account_report_common_view.xml
+++ b/addons/account/wizard/account_report_common_view.xml
@@ -10,6 +10,7 @@
diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv
index 7c57d67d1cd..fba2a5f2202 100644
--- a/addons/hr_evaluation/security/ir.model.access.csv
+++ b/addons/hr_evaluation/security/ir.model.access.csv
@@ -1,21 +1,9 @@
"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_manager","hr_evaluation.evaluation.manager","model_hr_evaluation_evaluation","base.group_hr_manager",1,1,1,1
-"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_evaluation","base.group_hr_user",1,0,0,0
-"access_hr_evaluation_plan_manager","hr_evaluation.plan.manager","model_hr_evaluation_plan","base.group_hr_manager",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,0,0,0
-"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase.manager","model_hr_evaluation_plan_phase","base.group_hr_manager",1,1,1,1
+"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
-"access_hr_evaluation_interview_manager","hr.evaluation.interview.manager","model_hr_evaluation_interview","base.group_hr_manager",1,1,1,1
"access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report","base.group_hr_manager",1,1,1,1
-"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_plan","base.group_system",1,1,1,1
-"access_hr_evaluation_plan_phase_system","hr_evaluation.plan.phase.system","model_hr_evaluation_plan_phase","base.group_system",1,1,1,1
-"access_hr_evaluation_evaluation_system","hr_evaluation.evaluation.system","model_hr_evaluation_evaluation","base.group_system",1,0,0,0
-"access_hr_evaluation_interview_system","hr.evaluation.interview.system","model_hr_evaluation_interview","base.group_system",1,0,0,0
-"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0
-"access_hr_evaluation_interview_employee","hr.evaluation.interview.employee","model_hr_evaluation_interview","base.group_user",1,0,0,0
-"access_hr_evaluation_user","hr_evaluation.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1
-"access_hr_evaluation_employee","hr_evaluation.employee","model_hr_evaluation_plan","base.group_user",1,0,0,0
"access_survey_type_hr_manager","survey.type","survey.model_survey_type","base.group_hr_manager",1,1,1,1
"access_survey_hr_manager","survey.hr.manager","survey.model_survey","base.group_hr_manager",1,1,1,1
"access_survey_history_manager","survey.history","survey.model_survey_history","base.group_hr_manager",1,1,1,1
@@ -28,7 +16,6 @@
"access_survey_tbl_column_heading_hr_manager","survey.tbl.column.heading","survey.model_survey_tbl_column_heading","base.group_hr_manager",1,1,1,1
"access_survey_response_answer_hr_manager","survey.response.answer","survey.model_survey_response_answer","base.group_hr_manager",1,1,1,1
"access_survey_request_hr_manager","survey.request","survey.model_survey_request","base.group_hr_manager",1,1,1,1
-"access_survey_hr_user","survey.hr.user","survey.model_survey","base.group_hr_user",1,1,1,0
"access_survey_answer_hr_user","survey.answer.hr.user","survey.model_survey_answer","base.group_hr_user",1,1,1,0
"access_survey_response_answer_hr_user","survey.response.answer.hr.user","survey.model_survey_response_answer","base.group_hr_user",1,1,1,0
"access_survey_type_hr_user","survey.type.hr.user","survey.model_survey_type","base.group_hr_user",1,1,1,0
diff --git a/addons/hr_expense/board_hr_expense_manager_view.xml b/addons/hr_expense/board_hr_expense_manager_view.xml
index 9063ac32458..d86c7614d7f 100644
--- a/addons/hr_expense/board_hr_expense_manager_view.xml
+++ b/addons/hr_expense/board_hr_expense_manager_view.xml
@@ -9,14 +9,14 @@
[('state','in',('confirm', 'accepted'))]
-
+
board.hr.manager.expense.formboard.board
-
+ form
-
+
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index 4003cded168..e9e64f76c4e 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -97,6 +97,13 @@ class hr_expense_expense(osv.osv):
'currency_id': _get_currency,
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
+
+ def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
+ if not employee_id:
+ return {'value':{'department_id': False}}
+ dept = self.pool.get('hr.employee').browse(cr, uid, employee_id).department_id
+ return {'value': {'department_id':dept and dept.id or False}}
+
def expense_confirm(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {
'state':'confirm',
diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml
index c3fa9e90c67..cb9e28b5543 100644
--- a/addons/hr_expense/hr_expense_demo.xml
+++ b/addons/hr_expense/hr_expense_demo.xml
@@ -108,13 +108,13 @@
Employee Expense[('employee_id.user_id','=',user.id)]
-
+ Manager Expense['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )]
-
+
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 79c0d5513f0..7ffdb349826 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -13,7 +13,7 @@
-
+
@@ -30,8 +30,8 @@
-
-
+
+
@@ -67,7 +67,7 @@
-
+
@@ -98,7 +98,7 @@
-
+
@@ -136,23 +136,27 @@
-
-
+
+
+
-
+
+
+
-
-
+
+
@@ -165,7 +169,7 @@
Expenseshr.expense.expenseform
- {"search_default_user_id":uid,'search_default_this':1}
+ {"search_default_user_id":uid,"search_default_department_id": department_id,"search_default_this":1}The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow.
diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml
index 0037831391a..3de4776b29f 100644
--- a/addons/hr_expense/report/hr_expense_report_view.xml
+++ b/addons/hr_expense/report/hr_expense_report_view.xml
@@ -15,7 +15,7 @@
-
+
@@ -65,8 +65,8 @@
-
+
@@ -82,7 +82,7 @@
-
+
@@ -93,15 +93,15 @@
-
-
-
+
+
+
-
-
-
+
+
+
@@ -265,4 +243,4 @@
-
\ No newline at end of file
+
diff --git a/addons/hr_payroll/report/payslip.rml b/addons/hr_payroll/report/payslip.rml
index 58b2fd81275..cdbbe6bd5f4 100755
--- a/addons/hr_payroll/report/payslip.rml
+++ b/addons/hr_payroll/report/payslip.rml
@@ -1,6 +1,6 @@
-
+
@@ -333,7 +333,7 @@
Identification No
- [[ o.employee_id.otherid or '' ]]
+ [[ o.employee_id.passport_id and o.employee_id.passport_id.name or '' ]]
@@ -349,7 +349,7 @@
Designation
- [[ o.employee_id.contract_ids and o.employee_id.contract_ids[0].job_id.name or '' ]]
+ [[ o.employee_id.contract_id and o.employee_id.contract_id.job_id.name or '' ]]
@@ -392,7 +392,7 @@
Basic Salary
- [[ formatLang(o.basic_before_leaves) ]] [[ o.company_id.currency_id.symbol ]]
+ [[ formatLang(o.basic_before_leaves) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]]
- Total Deductions([[ o.company_id.currency_id.code ]])
+ Total Deductions([[ o.company_id and o.company_id.currency_id.code or '' ]])
- [[ formatLang(o.deduction) ]] [[ o.company_id.currency_id.symbol ]]
+ [[ formatLang(o.deduction) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]]
@@ -539,13 +539,13 @@
- [[ ol.type in ['advance','loan','otherpay','otherdeduct','installment'] and ol.code or '' ]]
+ [[ ol.code or '' ]]
- [[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]]
+ [[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id and o.company_id.currency_id.symbol or '' ]]
- [[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]]
+ [[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total) or '' ]] [[ ol.type in ['otherdeduct','installment'] and o.company_id and o.company_id.currency_id.symbol or '' ]]
@@ -558,10 +558,10 @@
- Net Amount([[ o.company_id.currency_id.code ]])
+ Net Amount([[ o.company_id and o.company_id.currency_id.code or '' ]])
- [[ formatLang(o.net) ]] [[ o.company_id.currency_id.symbol ]]
+ [[ formatLang(o.net) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]]
@@ -609,4 +609,4 @@
-
\ No newline at end of file
+
diff --git a/addons/hr_payroll/report/report_emp_salary_structure.py b/addons/hr_payroll/report/report_emp_salary_structure.py
index 7deafcf63e4..e875e774b43 100644
--- a/addons/hr_payroll/report/report_emp_salary_structure.py
+++ b/addons/hr_payroll/report/report_emp_salary_structure.py
@@ -33,32 +33,32 @@ class salary_structure_report(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
'get_type':self.get_type,
- 'get_contract':self.get_contract,
+ #'get_contract':self.get_contract,
'get_line_amount_type':self.get_line_amount_type,
'get_line_type':self.get_line_type,
'get_line_amount_symbol':self.get_line_amount_symbol
})
- def get_contract(self,emp):
- curr_date = "'"+time.strftime("%Y-%m-%d")+"'"
- sql_req= '''
- SELECT c.id as id, c.wage as wage, struct_id as struct
- FROM hr_contract c
- LEFT JOIN hr_employee emp on (c.employee_id=emp.id)
- LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id)
- LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id)
- WHERE
- (emp.id=%s) AND
- (date_start <= %s) AND
- (date_end IS NULL OR date_end >= %s)
- LIMIT 1
- '''%(emp.id, curr_date, curr_date)
- self.cr.execute(sql_req)
- contract_id = self.cr.dictfetchone()
- if not contract_id:
- return []
- contract = self.pool.get('hr.contract').browse(self.cr, self.uid, [contract_id['id']])
- return contract
+# def get_contract(self,emp):
+# curr_date = "'"+time.strftime("%Y-%m-%d")+"'"
+# sql_req= '''
+# SELECT c.id as id, c.wage as wage, struct_id as struct
+# FROM hr_contract c
+# LEFT JOIN hr_employee emp on (c.employee_id=emp.id)
+# LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id)
+# LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id)
+# WHERE
+# (emp.id=%s) AND
+# (date_start <= %s) AND
+# (date_end IS NULL OR date_end >= %s)
+# LIMIT 1
+# '''%(emp.id, curr_date, curr_date)
+# self.cr.execute(sql_req)
+# contract_id = self.cr.dictfetchone()
+# if not contract_id:
+# return []
+# contract = self.pool.get('hr.contract').browse(self.cr, self.uid, [contract_id['id']])
+# return contract
def get_type(self,type):
return type[0].swapcase() + type[1:] +' Salary'
diff --git a/addons/hr_payroll/report/report_emp_salary_structure.rml b/addons/hr_payroll/report/report_emp_salary_structure.rml
index 6bfc528e4e0..5f81a0942ae 100644
--- a/addons/hr_payroll/report/report_emp_salary_structure.rml
+++ b/addons/hr_payroll/report/report_emp_salary_structure.rml
@@ -1,6 +1,6 @@
-
+
@@ -10,10 +10,6 @@
-
-
-
-
@@ -127,6 +123,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -138,10 +174,6 @@
-
-
-
-
@@ -150,10 +182,6 @@
-
-
-
-
@@ -166,9 +194,6 @@
-
-
-
@@ -177,9 +202,6 @@
-
-
-
@@ -241,24 +263,11 @@
[[repeatIn(objects,'employee')]]
-
-
-
- Salary Structure
-
-
-
-
-
-
-
-
-
-
+
- [[repeatIn(get_contract(employee),'cont')]]
+ [[ not employee.contract_id and removeParentNode('section') ]]
@@ -290,7 +299,7 @@
[[ employee.name ]]
- Other Id
+ Other No.
[[ employee.otherid or '' ]]
@@ -309,7 +318,7 @@
Designation
- [[ cont.job_id.name or '' ]]
+ [[ employee.contract_id.job_id and employee.contract_id.job_id.name or '' ]]
Phone No.
@@ -325,7 +334,7 @@
-
+
@@ -347,19 +356,19 @@
Start Date
- [[ formatLang(cont.date_start,date=True) or '' ]]
+ [[ formatLang(employee.contract_id.date_start,date=True) or '' ]]
End Date
- [[ formatLang(cont.date_end,date=True) or removeParentNode('para') ]]
+ [[ formatLang(employee.contract_id.date_end,date=True) or removeParentNode('para') ]]
Type
- [[ get_type(cont.wage_type_id.type) or '' ]]
+ [[ get_type(employee.contract_id.wage_type_id.type) or '' ]]
@@ -369,17 +378,55 @@
Salary
- [[ formatLang(cont.wage) or '' ]] [[ employee.company_id.currency_id.symbol]]
+ [[ formatLang(employee.contract_id.wage) or '' ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]]
Notes:
- [[ cont.notes or '' ]]
+ [[ employee.contract_id.notes or '' ]]
-
+
+
+
+ Basic
+
+
+ [[ formatLang(employee.basic) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]]
+
+
+ Allowances
+
+
+ [[ formatLang(employee.advantages_gross) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]]
+
+
+ Gross Salary
+
+
+ [[ formatLang(employee.gross) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]]
+
+
+
+
+
+
+ Deductions
+
+
+ [[ formatLang(employee.advantages_net) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]]
+
+
+ Net Salary
+
+
+ [[ formatLang(employee.net) ]] [[ employee.company_id and employee.company_id.currency_id.symbol or '' ]]
+
+
+
+
@@ -396,7 +443,7 @@
-
+
Code
@@ -404,32 +451,20 @@
Name
+
+ Amount
+
Amount Type
-
- Amount / Percentage
-
-
- Type
-
-
- Category
-
-
- General Account
-
-
- Analytic Account
-
- [[repeatIn(cont.struct_id.line_ids,'line')]]
-
+ [[repeatIn(employee.contract_id.struct_id and employee.contract_id.struct_id.line_ids or [],'line')]]
+
[[ line.code or '' ]]
@@ -437,24 +472,12 @@
[[ line.name ]]
+
+ [[ line.amount_type =='per' and formatLang(line.amount*100) or formatLang(line.amount)]] [[ get_line_amount_symbol(line.amount_type) ]]
+
[[ get_line_amount_type(line.amount_type) ]]
-
- [[ formatLang(line.amount) or '']][[ get_line_amount_symbol(line.amount_type) ]]
-
-
- [[ get_line_type(line.type) ]]
-
-
- [[ line.category_id.name ]]
-
-
- [[ line.account_id.name ]]
-
-
- [[ line.analytic_account_id and line.analytic_account_id.name or '' ]]
-
- Membership product
+ Membership Productsproduct.product
@@ -59,10 +113,11 @@
- Memberships
+ Membership Productsproduct.product[('membership','=',True), ('type', '=', 'service')]{'membership':True, 'type':'service'}
+
@@ -81,13 +136,11 @@
-
-
-
-
-
+
@@ -99,10 +152,11 @@
+
-
+
@@ -113,14 +167,15 @@
search
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -133,12 +188,14 @@
-
-
-
+
+
+
+
+
-
-
+
+
@@ -149,6 +206,7 @@
res.partner{"search_default_old": 1}
+ {"search_default_all_members": 1}
@@ -161,6 +219,7 @@
form
+
@@ -190,7 +249,7 @@
-
+
diff --git a/addons/membership/report/report_membership.py b/addons/membership/report/report_membership.py
index 1bfdce82404..b631ef64d9b 100644
--- a/addons/membership/report/report_membership.py
+++ b/addons/membership/report/report_membership.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,12 +15,24 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
from osv import fields, osv
import tools
+import decimal_precision as dp
+
+
+STATE = [
+ ('none', 'Non Member'),
+ ('canceled', 'Cancelled Member'),
+ ('old', 'Old Member'),
+ ('waiting', 'Waiting Member'),
+ ('invoiced', 'Invoiced Member'),
+ ('free', 'Free Member'),
+ ('paid', 'Paid Member'),
+]
class report_membership(osv.osv):
@@ -38,27 +50,21 @@ class report_membership(osv.osv):
('07', 'July'), ('08', 'August'),\
('09', 'September'), ('10', 'October'),\
('11', 'November'), ('12', 'December')], 'Month', readonly=True),
- 'date': fields.datetime('Create Date', readonly=True),
- 'canceled_number': fields.integer('Canceled', readonly=True),
- 'waiting_number': fields.integer('Waiting', readonly=True),
- 'invoiced_number': fields.integer('Invoiced', readonly=True),
- 'paid_number': fields.integer('Paid', readonly=True),
- 'canceled_amount': fields.float('Canceled', digits=(16, 2), readonly=True),
- 'waiting_amount': fields.float('Waiting', digits=(16, 2), readonly=True),
- 'invoiced_amount': fields.float('Invoiced', digits=(16, 2), readonly=True),
- 'paid_amount': fields.float('Paid', digits=(16, 2), readonly=True),
- 'currency': fields.many2one('res.currency', 'Currency', readonly=True,
- select=2),
-
- 'state':fields.selection([('draft', 'Non Member'),
- ('cancel', 'Cancelled Member'),
- ('done', 'Old Member'),
- ('open', 'Invoiced Member'),
- ('free', 'Free Member'), ('paid', 'Paid Member')], 'State'),
- 'partner_id': fields.many2one('res.partner', 'Members', readonly=True, select=3),
- 'membership_id': fields.many2one('product.product', 'Membership', readonly=True, select=3)
-
-
+ 'date_from': fields.datetime('Start Date', readonly=True, help="Start membership date"),
+ 'date_to': fields.datetime('End Date', readonly=True, help="End membership date"),
+ 'num_canceled': fields.integer('# Canceled', readonly=True),
+ 'num_old': fields.integer('# Old', readonly=True),
+ 'num_waiting': fields.integer('# Waiting', readonly=True),
+ 'num_invoiced': fields.integer('# Invoiced', readonly=True),
+ 'num_free': fields.integer('# Free', readonly=True),
+ 'num_paid': fields.integer('# Paid', readonly=True),
+ 'tot_pending': fields.float('Pending Amount', digits_compute= dp.get_precision('Account'), readonly=True),
+ 'tot_earned': fields.float('Earned Amount', digits_compute= dp.get_precision('Account'), readonly=True),
+ 'state':fields.selection(STATE, 'Membership State'),
+ 'partner_id': fields.many2one('res.partner', 'Members', readonly=True),
+ 'membership_id': fields.many2one('product.product', 'Membership Product', readonly=True),
+ 'user_id': fields.many2one('res.users', 'Salesman', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', readonly=True)
}
def init(self, cr):
@@ -67,61 +73,62 @@ class report_membership(osv.osv):
cr.execute("""
CREATE OR REPLACE VIEW report_membership AS (
SELECT
- MIN(id) as id,
- COUNT(ncanceled) as canceled_number,
- COUNT(npaid) as paid_number,
- COUNT(ninvoiced) as invoiced_number,
- COUNT(nwaiting) as waiting_number,
- SUM(acanceled) as canceled_amount,
- SUM(apaid) as paid_amount,
- SUM(ainvoiced) as invoiced_amount,
- SUM(awaiting) as waiting_amount,
+ MIN(id) AS id,
+ COUNT(num_canceled) AS num_canceled,
+ COUNT(num_old) AS num_old,
+ COUNT(num_waiting) AS num_waiting,
+ COUNT(num_invoiced) AS num_invoiced,
+ COUNT(num_free) AS num_free,
+ COUNT(num_paid) AS num_paid,
+ SUM(tot_pending) AS tot_pending,
+ SUM(tot_earned) AS tot_earned,
year,
month,
- date,
+ date_from,
+ date_to,
partner_id,
membership_id,
- state,
- currency
-
- FROM (SELECT
- CASE WHEN ai.state = 'cancel' THEN ml.id END AS ncanceled,
- CASE WHEN ai.state = 'paid' THEN ml.id END AS npaid,
- CASE WHEN ai.state = 'open' THEN ml.id END AS ninvoiced,
- CASE WHEN (ai.state = 'draft' OR ai.state = 'proforma')
- THEN ml.id END AS nwaiting,
- CASE WHEN ai.state = 'cancel'
- THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100))
- ELSE 0 END AS acanceled,
- CASE WHEN ai.state = 'paid'
- THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100))
- ELSE 0 END AS apaid,
- CASE WHEN ai.state = 'open'
- THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100))
- ELSE 0 END AS ainvoiced,
- CASE WHEN (ai.state = 'draft' OR ai.state = 'proforma')
- THEN SUM(ail.price_unit * ail.quantity * (1 - ail.discount / 100))
- ELSE 0 END AS awaiting,
+ company_id,
+ user_id,
+ state
+ FROM
+ (SELECT
+ CASE WHEN ml.state = 'canceled' THEN ml.id END AS num_canceled,
+ CASE WHEN ml.state = 'old' THEN ml.id END AS num_old,
+ CASE WHEN ml.state = 'waiting' THEN ml.id END AS num_waiting,
+ CASE WHEN ml.state = 'invoiced' THEN ml.id END AS num_invoiced,
+ CASE WHEN ml.state = 'free' THEN ml.id END AS num_free,
+ CASE WHEN ml.state = 'paid' THEN ml.id END AS num_paid,
+ CASE WHEN ml.state IN ('waiting', 'invoiced') THEN SUM(il.price_subtotal) ELSE 0 END AS tot_pending,
+ CASE WHEN ml.state IN ('old', 'paid') THEN SUM(il.price_subtotal) ELSE 0 END AS tot_earned,
TO_CHAR(ml.date_from, 'YYYY') AS year,
- TO_CHAR(ml.date_from, 'MM')as month,
- TO_CHAR(ml.date_from, 'YYYY-MM-DD') as date,
- ai.partner_id AS partner_id,
- ai.currency_id AS currency,
- ai.state as state,
+ TO_CHAR(ml.date_from, 'MM') AS month,
+ TO_CHAR(ml.date_from, 'YYYY-MM-DD') AS date_from,
+ TO_CHAR(ml.date_to, 'YYYY-MM-DD') AS date_to,
+ ml.partner AS partner_id,
MIN(ml.id) AS id,
- ml.membership_id AS membership_id
+ ml.membership_id AS membership_id,
+ p.user_id AS user_id,
+ ml.company_id AS company_id,
+ ml.state AS state
FROM membership_membership_line ml
- JOIN (account_invoice_line ail
- LEFT JOIN account_invoice ai
- ON (ail.invoice_id = ai.id))
- ON (ml.account_invoice_line = ail.id)
- JOIN res_partner p
- ON (ml.partner = p.id)
- GROUP BY TO_CHAR(ml.date_from, 'YYYY'), TO_CHAR(ml.date_from, 'MM'), TO_CHAR(ml.date_from, 'YYYY-MM-DD'), ai.state, ai.partner_id,
- ai.currency_id, ml.id, ml.membership_id) AS foo
- GROUP BY year, month, date, currency, partner_id, membership_id, state)
+ LEFT JOIN account_invoice_line il ON (ml.account_invoice_line = il.id)
+ LEFT JOIN account_invoice ai ON (il.invoice_id = ai.id)
+ LEFT JOIN res_partner p ON (ml.partner = p.id)
+ GROUP BY
+ TO_CHAR(ml.date_from, 'YYYY'),
+ TO_CHAR(ml.date_from, 'MM'),
+ TO_CHAR(ml.date_from, 'YYYY-MM-DD'),
+ TO_CHAR(ml.date_to, 'YYYY-MM-DD'),
+ ml.partner,
+ ml.id,
+ p.user_id,
+ ml.company_id,
+ ml.state,
+ ml.membership_id) AS foo
+ GROUP BY year, month, date_from, date_to, partner_id, user_id, membership_id, company_id, state)
""")
-
+
report_membership()
-#
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/membership/report/report_membership_view.xml b/addons/membership/report/report_membership_view.xml
index 90330a92a55..abe8b44bcba 100644
--- a/addons/membership/report/report_membership_view.xml
+++ b/addons/membership/report/report_membership_view.xml
@@ -10,15 +10,24 @@
tree
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -31,45 +40,43 @@
+ domain="[('date_from','<=', time.strftime('%%Y-%%m-%%d')), ('date_from','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"/>
+ domain="[('date_from','<=', time.strftime('%%Y-%%m-%%d')), ('date_from','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"/>
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
-
+ domain="[]" context="{'group_by':'month'}"/>
-
+
report.membership.graph1report.membership
@@ -89,7 +96,7 @@
report.membershipform
- {"search_default_member":1}
+ {"search_default_member":1, 'search_default_Revenue':1}
@@ -107,9 +114,9 @@
-
-
+
diff --git a/addons/membership/wizard/__init__.py b/addons/membership/wizard/__init__.py
index 07d484d7125..7ad7cc32008 100644
--- a/addons/membership/wizard/__init__.py
+++ b/addons/membership/wizard/__init__.py
@@ -20,5 +20,4 @@
##############################################################################
import membership_invoice
-import membership_unpaid_invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/membership/wizard/membership_invoice.py b/addons/membership/wizard/membership_invoice.py
index 7536bd4b942..9b9fddc2313 100644
--- a/addons/membership/wizard/membership_invoice.py
+++ b/addons/membership/wizard/membership_invoice.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
import time
from osv import fields, osv
@@ -27,12 +28,12 @@ import decimal_precision as dp
class membership_invoice(osv.osv_memory):
"""Membership Invoice"""
-
+
_name = "membership.invoice"
_description = "Membership Invoice"
_columns = {
'product_id': fields.many2one('product.product','Membership', required=True),
- 'member_price':fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True),
+ 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True),
}
def onchange_product(self, cr, uid, ids, product_id):
"""This function returns value of product's member price based on product id.
diff --git a/addons/membership/wizard/membership_unpaid_invoice.py b/addons/membership/wizard/membership_unpaid_invoice.py
deleted file mode 100644
index 0dbbbb3c952..00000000000
--- a/addons/membership/wizard/membership_unpaid_invoice.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 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 .
-#
-##############################################################################
-import time
-
-from osv import fields, osv
-
-class member_unpaid_invoice(osv.osv_memory):
- _name = "membership.unpaid.invoice"
- _description = "List of Unpaid Partner"
- _columns ={
- 'product': fields.many2one('product.product','Membership', size=64,required=True, help='Select Membership.'),
- }
-
- def invoice_membership(self, cr, uid, ids, context):
- model_obj = self.pool.get('ir.model.data')
- partners = []
- result = model_obj._get_id(cr, uid, 'base', 'view_res_partner_filter')
- res = model_obj.read(cr, uid, result, ['res_id'], context=context)
- for data in self.read(cr, uid, ids, context=context):
- cr.execute('''select p.id from res_partner as p \
- left join account_invoice as i on p.id=i.partner_id \
- left join account_invoice_line as il on i.id=il.invoice_id \
- left join product_product as pr on pr.id=il.product_id \
- where i.state = 'open' and pr.id=%s \
- group by p.id''' % (data['product']))
- map(lambda x: partners.append(x[0]),cr.fetchall())
-
- return {
- 'domain': [('id', 'in', partners)],
- 'name': 'Unpaid Members',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'res.partner',
- 'type': 'ir.actions.act_window',
- 'res_id' : partners,
- 'search_view_id' : res['res_id']
- }
-
-member_unpaid_invoice()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/membership/wizard/membership_unpaid_invoice_view.xml b/addons/membership/wizard/membership_unpaid_invoice_view.xml
deleted file mode 100644
index 9c5db96d5e3..00000000000
--- a/addons/membership/wizard/membership_unpaid_invoice_view.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
- unpaid.invoice.view.form
- membership.unpaid.invoice
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- List Unpaid Members
- membership.unpaid.invoice
- form
- tree,form
-
- new
-
-
-
-
-
-
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 615b5cee009..39ecec5ad95 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -163,7 +163,7 @@
-
+
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index 3132367d8bf..3b5f235251f 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -187,7 +187,7 @@ class pos_order(osv.osv):
res[order.id]['amount_tax'])
elif line.qty != 0.0:
for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']:
- val += c['amount']
+ val += c.get('amount', 0.0)
res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
return res
@@ -351,7 +351,7 @@ class pos_order(osv.osv):
def test_order_lines(self, cr, uid, order, context=None):
- """ Test order line is created or not for the order "
+ """ Test order line is created or not for the order "
@param name: Names of fields.
@return: True
"""
@@ -552,7 +552,7 @@ class pos_order(osv.osv):
"""Create a new payment for the order"""
- statement_obj= self.pool.get('account.bank.statement')
+ statement_obj= self.pool.get('account.bank.statement')
statementl_obj = self.pool.get('account.bank.statement.line')
prod_obj = self.pool.get('product.product')
property_obj=self.pool.get('ir.property')
@@ -625,7 +625,7 @@ class pos_order(osv.osv):
return order_line_id, price
def refund(self, cr, uid, ids, context=None):
- """Create a copy of order for refund order"""
+ """Create a copy of order for refund order"""
clone_list = []
line_obj = self.pool.get('pos.order.line')
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index 649eb727f0c..376f0965633 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -32,7 +32,7 @@ class pos_invoice(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
})
-
+
def set_context(self, objects, data, ids, report_type=None):
super(pos_invoice, self).set_context(objects, data, ids, report_type)
@@ -54,5 +54,5 @@ class pos_invoice(report_sxw.rml_parse):
self.localcontext['data'] = data
self.localcontext['objects'] = iids
-report_sxw.report_sxw('report.pos.invoice', 'pos.order', 'addons/account/report/invoice.rml', parser= pos_invoice)
+report_sxw.report_sxw('report.pos.invoice', 'pos.order', 'addons/account/report/account_print_invoice.rml', parser= pos_invoice)
diff --git a/addons/project_planning/project_planning.py b/addons/project_planning/project_planning.py
index 729a8ee6bbb..759057fbaef 100644
--- a/addons/project_planning/project_planning.py
+++ b/addons/project_planning/project_planning.py
@@ -25,7 +25,6 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta
from osv import fields, osv
-from tools.translate import _
import tools
@@ -215,7 +214,7 @@ class report_account_analytic_planning_line(osv.osv):
return result
_columns = {
- 'account_id': fields.many2one('account.analytic.account', 'Analytic account', required=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic account'),
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True, ondelete='cascade'),
'user_id': fields.many2one('res.users', 'User'),
'amount': fields.float('Quantity', required=True),
@@ -577,7 +576,7 @@ WHERE user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'),
'user_id': fields.many2one('res.users', 'User'),
'manager_id': fields.many2one('res.users', 'Manager'),
- 'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Account'),
'sum_amount': fields.float('Planned Days', required=True),
'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'),
'sum_amount_tasks': fields.function(_sum_amount_tasks, method=True, string='Tasks'),
diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml
index 9363413e4a2..ff354c69ccd 100644
--- a/addons/project_planning/project_planning_view.xml
+++ b/addons/project_planning/project_planning_view.xml
@@ -54,7 +54,7 @@
-
+
@@ -68,7 +68,7 @@
-
+
@@ -78,7 +78,7 @@
-
+
@@ -180,7 +180,7 @@
-
+
@@ -197,7 +197,7 @@
-
+
@@ -233,7 +233,7 @@
-
+
@@ -248,7 +248,7 @@
-
+
@@ -262,7 +262,7 @@
graph
-
+
@@ -281,7 +281,7 @@
-
+
@@ -324,7 +324,7 @@
-
+
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 51e294200cb..eb1f2a1ace0 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -59,7 +59,7 @@ class purchase_order(osv.osv):
for line in order.order_line:
val1 += line.price_subtotal
for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id.id, line.product_id.id, order.partner_id)['taxes']:
- val += c['amount']
+ val += c.get('amount', 0.0)
res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val)
res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1)
res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']
@@ -150,12 +150,12 @@ class purchase_order(osv.osv):
('wait', 'Waiting'),
('confirmed', 'Waiting Supplier Ack'),
('approved', 'Approved'),
- ('except_picking', 'Shipping Exception'),
+ ('except_picking', 'Shipping Exception'),
('except_invoice', 'Invoice Exception'),
('done', 'Done'),
('cancel', 'Cancelled')
]
-
+
_columns = {
'name': fields.char('Order Reference', size=64, required=True, select=True, help="unique number of the purchase order,computed automatically when the purchase order is created"),
'origin': fields.char('Source Document', size=64,
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index e151cdc56f9..c85088c9b53 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -190,7 +190,7 @@
-
+
@@ -257,7 +257,7 @@
-
+
-
+
@@ -319,7 +319,7 @@
-
+
-
+
diff --git a/addons/sale/board_sale_view.xml b/addons/sale/board_sale_view.xml
index 6da7f9e312b..0629ad041df 100644
--- a/addons/sale/board_sale_view.xml
+++ b/addons/sale/board_sale_view.xml
@@ -34,7 +34,7 @@
-
+
\ No newline at end of file
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index b914e2b2d4b..751e74d52be 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -26,7 +26,7 @@
-
+
@@ -101,9 +101,9 @@
-
-
-
+
+
+
@@ -129,7 +129,7 @@
-
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 33db15d5ed0..6c8bf247b23 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -75,7 +75,7 @@ class sale_order(osv.osv):
context = {}
val = 0.0
for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, line.order_id.partner_invoice_id.id, line.product_id, line.order_id.partner_id)['taxes']:
- val += c['amount']
+ val += c.get('amount', 0.0)
return val
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
@@ -559,7 +559,7 @@ class sale_order(osv.osv):
#
if order.state == 'invoice_except':
self.write(cr, uid, [order.id], {'state' : 'progress'}, context=context)
-
+
return True
def action_cancel(self, cr, uid, ids, context=None):
@@ -731,7 +731,7 @@ class sale_order(osv.osv):
if picking_id:
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
-
+
if order.state == 'shipping_except':
val['state'] = 'progress'
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index b22f944d56f..a30c05d5c2b 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -1,6 +1,7 @@
+
@@ -19,7 +20,7 @@
-
+
@@ -32,7 +33,7 @@
-
+
@@ -48,7 +49,7 @@
+ groups="base.group_extended,base.group_sale_manager"/>
sale.order.calendar
@@ -115,7 +116,7 @@
+ groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
@@ -293,7 +294,7 @@ orders, purchases, etc. It support several invoicing methods according
to your configuration: from the sales order, from the pickings, etc.
-
+
Sales in Exception
@@ -451,7 +452,7 @@ to your configuration: from the sales order, from the pickings, etc.
name="sale order"
help="Confirmed Sale Order Lines"
/>
-
+
-
-
-
+
diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv
index 89a2003698c..0d523202a10 100644
--- a/addons/sale/security/ir.model.access.csv
+++ b/addons/sale/security/ir.model.access.csv
@@ -1,19 +1,23 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_sale_shop","sale.shop","model_sale_shop","base.group_sale_salesman",1,1,1,1
-"access_sale_order","sale.order","model_sale_order","base.group_sale_salesman",1,1,1,1
-"access_sale_order_line","sale.order.line","model_sale_order_line","base.group_sale_salesman",1,1,1,0
+"access_sale_shop","sale.shop","model_sale_shop","base.group_sale_salesman",1,1,1,0
+"access_sale_order","sale.order","model_sale_order","base.group_sale_salesman",1,1,1,0
+"access_sale_order_line","sale.order.line","model_sale_order_line","base.group_sale_salesman",1,1,1,1
"access_sale_shop_admin","sale.shop","model_sale_shop","base.group_system",1,1,1,1
-"access_account_invoice_salesman","account_invoice salesman","account.model_account_invoice","base.group_sale_salesman",1,1,1,1
+"access_account_invoice_salesman","account_invoice salesman","account.model_account_invoice","base.group_sale_salesman",1,1,1,0
+"access_account_invoice_manager","account_invoice manager","account.model_account_invoice","base.group_sale_manager",1,1,1,1
"access_account_invoice_line_salesman","account_invoice.line salesman","account.model_account_invoice_line","base.group_sale_salesman",1,1,1,1
"access_account_payment_term_salesman","account_payment_term salesman","account.model_account_payment_term","base.group_sale_salesman",1,0,0,0
-"access_account_analytic_account_salesman","account_analytic_account salesman","analytic.model_account_analytic_account","base.group_sale_salesman",1,1,1,1
-"access_stock_picking_salesman","stock_picking salesman","stock.model_stock_picking","base.group_sale_salesman",1,1,1,1
+"access_account_analytic_account_salesman","account_analytic_account salesman","analytic.model_account_analytic_account","base.group_sale_salesman",1,1,1,0
+"access_stock_picking_salesman","stock_picking salesman","stock.model_stock_picking","base.group_sale_salesman",1,1,1,0
"access_stock_move_salesman","stock_move salesman","stock.model_stock_move","base.group_sale_salesman",1,1,1,0
-"access_procurement_salesman","procurement.order salesman","procurement.model_procurement_order","base.group_sale_salesman",1,1,1,1
+"access_stock_move_manager","stock_move manager","stock.model_stock_move","base.group_sale_manager",1,1,1,1
+"access_procurement_salesman","procurement.order salesman","procurement.model_procurement_order","base.group_sale_salesman",1,1,1,0
+"access_procurement_manager","procurement.order manager","procurement.model_procurement_order","base.group_sale_manager",1,1,1,1
"access_sale_order_stock_worker","sale.order stock worker","model_sale_order","stock.group_stock_user",1,1,0,0
"access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0
-"access_sale_order_manager","sale.order.manager","model_sale_order","base.group_sale_manager",1,0,0,0
+"access_sale_order_manager","sale.order.manager","model_sale_order","base.group_sale_manager",1,1,1,1
"access_sale_order_line_manager","sale.order.line.manager","model_sale_order_line","base.group_sale_manager",1,0,0,0
+"access_sale_report_salesman","sale.report","model_sale_report","base.group_sale_salesman",1,1,1,0
"access_sale_report_manager","sale.report","model_sale_report","base.group_sale_manager",1,1,1,1
"access_ir_property_sales","ir.property.sales","base.model_ir_property","base.group_sale_salesman",1,1,1,1
"access_sale_account_journal","account.journal sale order.user","account.model_account_journal","base.group_sale_salesman",1,0,0,0
@@ -26,12 +30,12 @@
"access_product_product_sale_user","product.product sale use","product.model_product_product","base.group_sale_salesman",1,0,0,0
"access_product_template_sale","product.template sale manager","product.model_product_template","base.group_sale_manager",1,0,0,0
"access_product_product_sale","product.product sale manager","product.model_product_product","base.group_sale_manager",1,0,0,0
-"access_sale_shop_manager","account.journal sale order.user","model_sale_shop","base.group_sale_manager",1,0,0,0
+"access_sale_shop_manager","account.journal sale order.user","model_sale_shop","base.group_sale_manager",1,1,1,1
"access_account_fiscalyear_manager","account.fiscalyear.manager","account.model_account_fiscalyear","base.group_sale_manager",1,0,0,0
-"access_account_fiscalyear_user","account.fiscalyear.user","account.model_account_fiscalyear","base.group_sale_salesman",1,1,1,1
+"access_account_fiscalyear_user","account.fiscalyear.user","account.model_account_fiscalyear","base.group_sale_salesman",1,0,0,0
"access_res_partner_address_user","res.partner.address.user","base.model_res_partner_address","base.group_sale_salesman",1,0,0,0
-"access_account_tax_user","account.tax.user","account.model_account_tax","base.group_sale_salesman",1,1,1,1
-"access_product_packaging_user","product.packaging.user","product.model_product_packaging","base.group_sale_salesman",1,1,1,1
+"access_account_tax_user","account.tax.user","account.model_account_tax","base.group_sale_salesman",1,1,1,0
+"access_product_packaging_user","product.packaging.user","product.model_product_packaging","base.group_sale_salesman",1,1,1,0
"access_res_country_system","res.country system","base.model_res_country","base.group_system",1,1,1,1
"access_res_country_state_system","res.country.state system","base.model_res_country_state","base.group_system",1,1,1,1
"access_res_partner_title_system","res.partner.title system","base.model_res_partner_title","base.group_system",1,1,1,1
@@ -41,8 +45,8 @@
"access_stock_picking_system","stock.picking.system","stock.model_stock_picking","base.group_system",1,0,0,0
"access_sale_report_system","sale.report.system","model_sale_report","base.group_system",1,0,0,0
"access_ir_attachment_system","ir.attachment.system","base.model_ir_attachment","base.group_system",1,0,0,0
-"access_ir_attachment_sales","ir.attachment.sales","base.model_ir_attachment","base.group_sale_salesman",1,1,1,1
-"access_ir_attachment_manager","ir.attachment.manager","base.model_ir_attachment","base.group_sale_manager",1,0,0,0
+"access_ir_attachment_sales","ir.attachment.sales","base.model_ir_attachment","base.group_sale_salesman",1,1,1,0
+"access_ir_attachment_manager","ir.attachment.manager","base.model_ir_attachment","base.group_sale_manager",1,1,1,1
"access_res_partner_bank_type_system","res.partner.bank.type.system","base.model_res_partner_bank_type","base.group_system",1,0,0,0
"access_stock_warehouse_manager","stock.warehouse.manager","stock.model_stock_warehouse","base.group_sale_manager",1,0,0,0
"access_product_uom_manager","product.uom.manager","product.model_product_uom","base.group_sale_manager",1,0,0,0
diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml
index 19da6a6f81f..36a8fc15118 100644
--- a/addons/sale/security/sale_security.xml
+++ b/addons/sale/security/sale_security.xml
@@ -12,6 +12,10 @@
+
+
+
+ Sale Order multi-company
diff --git a/addons/sale_crm/wizard/crm_make_sale_view.xml b/addons/sale_crm/wizard/crm_make_sale_view.xml
index a5561ac0e62..ed0b9ef780e 100644
--- a/addons/sale_crm/wizard/crm_make_sale_view.xml
+++ b/addons/sale_crm/wizard/crm_make_sale_view.xml
@@ -8,15 +8,15 @@
crm.make.saleform
-