@@ -44,7 +44,6 @@
help="Analytic Entries of last 30 days"/>
diff --git a/addons/account/report/account_balance_sheet_horizontal.rml b/addons/account/report/account_balance_sheet_horizontal.rml
index d9f0bcba6a7..0ecc907e0b4 100644
--- a/addons/account/report/account_balance_sheet_horizontal.rml
+++ b/addons/account/report/account_balance_sheet_horizontal.rml
@@ -218,7 +218,7 @@
|
[[ '. '*(a['level']-1) ]]
- [[ (a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) and a['name']!='Net Profit') or removeParentNode('font') ]][[ a['name'] ]]
+ [[ ( a['level']<4 or a['name']=='Net Profit') and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]
|
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index b1913fa8fcc..1ceb3b3bbbe 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -67,7 +67,7 @@
search
-
+
).
+#
+# 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 report import report_sxw
+from common_report_header import common_report_header
+from tools.translate import _
+
+class report_account_common(report_sxw.rml_parse, common_report_header):
+
+ def __init__(self, cr, uid, name, context=None):
+ super(report_account_common, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update( {
+ 'get_lines': self.get_lines,
+ 'time': time,
+ 'get_fiscalyear': self._get_fiscalyear,
+ 'get_account': self._get_account,
+ 'get_start_period': self.get_start_period,
+ 'get_end_period': self.get_end_period,
+ 'get_filter': self._get_filter,
+ 'get_start_date':self._get_start_date,
+ 'get_end_date':self._get_end_date,
+ })
+ self.context = context
+
+ def set_context(self, objects, data, ids, report_type=None):
+ new_ids = ids
+ if (data['model'] == 'ir.ui.menu'):
+ new_ids = 'chart_account_id' in data['form'] and [data['form']['chart_account_id']] or []
+ objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
+ return super(report_account_common, self).set_context(objects, data, new_ids, report_type=report_type)
+
+ def get_lines(self, data):
+ lines = []
+ account_obj = self.pool.get('account.account')
+ currency_obj = self.pool.get('res.currency')
+ ids2 = self.pool.get('account.financial.report')._get_children_by_order(self.cr, self.uid, [data['form']['account_report_id'][0]], context=data['form']['used_context'])
+ for report in self.pool.get('account.financial.report').browse(self.cr, self.uid, ids2, context=data['form']['used_context']):
+ vals = {
+ 'name': report.name,
+ 'balance': report.balance,
+ 'type': 'report',
+ 'level': report.level,
+ }
+ if data['form']['enable_filter']:
+ vals['balance_cmp'] = self.pool.get('account.financial.report').browse(self.cr, self.uid, report.id, context=data['form']['comparison_context']).balance
+ lines.append(vals)
+ if report.type == 'accounts' and report.display_detail and report.account_ids:
+ account_ids = account_obj._get_children_and_consol(self.cr, self.uid, [x.id for x in report.account_ids])
+ for account in account_obj.browse(self.cr, self.uid, account_ids, context=data['form']['used_context']):
+ if account.type != 'view':
+ flag = False
+ vals = {
+ 'name': account.code + ' ' + account.name,
+ 'balance': account.balance,
+ 'type': 'account',
+ 'level': 6,
+ 'account_type': account.type,
+ }
+ if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance']):
+ flag = True
+ if data['form']['enable_filter']:
+ vals['balance_cmp'] = account_obj.browse(self.cr, self.uid, account.id, context=data['form']['comparison_context']).balance
+ if not currency_obj.is_zero(self.cr, self.uid, account.company_id.currency_id, vals['balance_cmp']):
+ flag = True
+ if flag:
+ lines.append(vals)
+ return lines
+
+report_sxw.report_sxw('report.account.financial.report', 'account.financial.report',
+ 'addons/account/report/account_financial_report.rml', parser=report_account_common, header='internal')
+
diff --git a/addons/account/report/account_financial_report.rml b/addons/account/report/account_financial_report.rml
new file mode 100644
index 00000000000..8dd92335266
--- /dev/null
+++ b/addons/account/report/account_financial_report.rml
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ [[ data['form']['account_report_id'][1] ]]
+ |
+
+
+
+
+
+
+
+
+ | Chart of Account |
+ Fiscal Year |
+ Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]] |
+
+
+ | [[ get_account(data) or removeParentNode('para') ]] |
+ [[ get_fiscalyear(data) or '' ]] |
+ [[ 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') ]] |
+
+
+ |
+
+
+
+
+
+
+
+
+
+ [[ data['form']['enable_filter'] == 0 or removeParentNode('blockTable') ]]
+
+ |
+ Name
+ |
+
+ Balance
+ |
+
+
+ [[ repeatIn(get_lines(data), 'a') ]]
+ [[ (a.get('level') <> 0) or removeParentNode('tr') ]]
+ [[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
+ | [[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]] |
+ [[ a.get('level') == 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
+ [[ a.get('level') <> 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
+
+
+
+
+
+
+ [[ data['form']['enable_filter'] == 1 or removeParentNode('blockTable') ]]
+
+ |
+ Name
+ |
+
+ Balance
+ |
+
+ [[ data['form']['label_filter'] ]]
+ |
+
+
+ [[ repeatIn(get_lines(data), 'a') ]]
+ [[ (a.get('level') <> 0) or removeParentNode('tr') ]]
+ [[ setTag('tr','tr',{'style': 'Table'+str(min(3,'level' in a and a.get('level') or 1))}) ]]
+ | [[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_name'}) ]] [[ a.get('name') ]] |
+ [[ a.get('level') == 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
+ [[ a.get('level') <> 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance'))]] [[company.currency_id.symbol]] |
+ [[ a.get('level') == 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]] |
+ [[ a.get('level') <> 4 or removeParentNode('td') ]][[ setTag('para','para',{'style': 'terp_level_'+str(min(6,a['level']))+'_balance'}) ]][[ formatLang(a.get('balance_cmp'))]] [[company.currency_id.symbol]] |
+
+
+
+
+
+
+
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index cee5d6a8cc2..0941294dbba 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -57,7 +57,7 @@
search
-
+
@@ -87,7 +86,6 @@
help="Customer And Supplier Invoices"/>
diff --git a/addons/account/report/account_report_view.xml b/addons/account/report/account_report_view.xml
index a625439f6ae..c581f19c17b 100644
--- a/addons/account/report/account_report_view.xml
+++ b/addons/account/report/account_report_view.xml
@@ -152,8 +152,8 @@
-
-
+
+
@@ -218,8 +218,8 @@
-
-
+
+
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index cd945a2248d..79e4dbb0c03 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -67,6 +67,7 @@
"access_account_fiscalyear_employee","account.fiscalyear employee","model_account_fiscalyear","base.group_user",1,0,0,0
"access_res_currency_account_manager","res.currency account manager","base.model_res_currency","group_account_manager",1,1,1,1
"access_res_currency_rate_account_manager","res.currency.rate account manager","base.model_res_currency_rate","group_account_manager",1,1,1,1
+"access_res_currency_rate_type_account_manager","res.currency.rate.type account manager","base.model_res_currency_rate_type","group_account_manager",1,1,1,1
"access_account_invoice_user","account.invoice user","model_account_invoice","base.group_user",1,0,0,0
"access_account_invoice_user","account.invoice.line user","model_account_invoice_line","base.group_user",1,0,0,0
"access_account_payment_term_partner_manager","account.payment.term partner manager","model_account_payment_term","base.group_user",1,0,0,0
@@ -127,4 +128,7 @@
"access_account_sequence_fiscal_year_sale_user","account.sequence.fiscalyear.sale.user","model_account_sequence_fiscalyear","base.group_sale_salesman",1,1,1,0
"access_account_sequence_fiscal_year_sale_manager","account.sequence.fiscalyear.sale.manager","model_account_sequence_fiscalyear","base.group_sale_manager",1,1,1,1
"access_account_treasury_report_manager","account.treasury.report.manager","model_account_treasury_report","account.group_account_manager",1,0,0,0
+"access_account_financial_report","account.financial.report","model_account_financial_report","account.group_account_user",1,1,1,1
+"access_account_financial_report_invoice","account.financial.report invoice","model_account_financial_report","account.group_account_invoice",1,0,0,0
+"access_account_financial_report_manager","account.financial.report","model_account_financial_report","account.group_account_manager",1,1,1,1
diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py
index caed6fc3977..d82eff62142 100644
--- a/addons/account/wizard/__init__.py
+++ b/addons/account/wizard/__init__.py
@@ -47,6 +47,7 @@ import account_open_closed_fiscalyear
import account_invoice_state
import account_chart
import account_tax_chart
+import account_financial_report
#TODO: remove this file no moe used
# also remove related view fiel
diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py
new file mode 100644
index 00000000000..de9cae3a00c
--- /dev/null
+++ b/addons/account/wizard/account_financial_report.py
@@ -0,0 +1,86 @@
+# -*- 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 .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class accounting_report(osv.osv_memory):
+ _name = "accounting.report"
+ _inherit = "account.common.report"
+ _description = "Accounting Report"
+
+ _columns = {
+ 'enable_filter': fields.boolean('Enable Comparison'),
+ 'account_report_id': fields.many2one('account.financial.report', 'Account Reports', required=True),
+ 'label_filter': fields.char('Column Label', size=32, help="This label will be displayed on report to show the balance computed for the given comparison filter."),
+ 'fiscalyear_id_cmp': fields.many2one('account.fiscalyear', 'Fiscal Year', help='Keep empty for all open fiscal year'),
+ 'filter_cmp': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
+ 'period_from_cmp': fields.many2one('account.period', 'Start Period'),
+ 'period_to_cmp': fields.many2one('account.period', 'End Period'),
+ 'date_from_cmp': fields.date("Start Date"),
+ 'date_to_cmp': fields.date("End Date"),
+ }
+
+ _defaults = {
+ 'filter_cmp': 'filter_no',
+ 'target_move': 'posted',
+ }
+
+ def _build_comparison_context(self, cr, uid, ids, data, context=None):
+ if context is None:
+ context = {}
+ result = {}
+ result['fiscalyear'] = 'fiscalyear_id_cmp' in data['form'] and data['form']['fiscalyear_id_cmp'] or False
+ result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
+ result['chart_account_id'] = 'chart_account_id' in data['form'] and data['form']['chart_account_id'] or False
+ if data['form']['filter_cmp'] == 'filter_date':
+ result['date_from'] = data['form']['date_from_cmp']
+ result['date_to'] = data['form']['date_to_cmp']
+ elif data['form']['filter_cmp'] == 'filter_period':
+ if not data['form']['period_from_cmp'] or not data['form']['period_to_cmp']:
+ raise osv.except_osv(_('Error'),_('Select a starting and an ending period'))
+ result['period_from'] = data['form']['period_from_cmp']
+ result['period_to'] = data['form']['period_to_cmp']
+ return result
+
+ def check_report(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ res = super(accounting_report, self).check_report(cr, uid, ids, context=context)
+ data = {}
+ data['form'] = self.read(cr, uid, ids, ['account_report_id', 'date_from_cmp', 'date_to_cmp', 'fiscalyear_id_cmp', 'journal_ids', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'chart_account_id', 'target_move'], context=context)[0]
+ for field in ['fiscalyear_id_cmp', 'chart_account_id', 'period_from_cmp', 'period_to_cmp', 'account_report_id']:
+ if isinstance(data['form'][field], tuple):
+ data['form'][field] = data['form'][field][0]
+ comparison_context = self._build_comparison_context(cr, uid, ids, data, context=context)
+ res['datas']['form']['comparison_context'] = comparison_context
+ return res
+
+ def _print_report(self, cr, uid, ids, data, context=None):
+ data['form'].update(self.read(cr, uid, ids, ['date_from_cmp', 'date_to_cmp', 'fiscalyear_id_cmp', 'period_from_cmp', 'period_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter'], context=context)[0])
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'account.financial.report',
+ 'datas': data,
+ }
+
+accounting_report()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_financial_report_view.xml b/addons/account/wizard/account_financial_report_view.xml
new file mode 100644
index 00000000000..2083fd0ed53
--- /dev/null
+++ b/addons/account/wizard/account_financial_report_view.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Accounting Report
+ accounting.report
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Financial Report
+ accounting.report
+ ir.actions.act_window
+ form
+ form
+
+ new
+
+
+
+
+
+
diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py
index 74feaca27be..8de1dc79bfb 100644
--- a/addons/account/wizard/account_invoice_refund.py
+++ b/addons/account/wizard/account_invoice_refund.py
@@ -41,12 +41,16 @@ class account_invoice_refund(osv.osv_memory):
def _get_journal(self, cr, uid, context=None):
obj_journal = self.pool.get('account.journal')
+ user_obj = self.pool.get('res.users')
if context is None:
context = {}
- journal = obj_journal.search(cr, uid, [('type', '=', 'sale_refund')])
- if context.get('type', False):
- if context['type'] in ('in_invoice', 'in_refund'):
- journal = obj_journal.search(cr, uid, [('type', '=', 'purchase_refund')])
+ inv_type = context.get('type', 'out_invoice')
+ company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id
+ type = (inv_type == 'out_invoice') and 'sale_refund' or \
+ (inv_type == 'out_refund') and 'sale' or \
+ (inv_type == 'in_invoice') and 'purchase_refund' or \
+ (inv_type == 'in_refund') and 'purchase'
+ journal = obj_journal.search(cr, uid, [('type', '=', type), ('company_id','=',company_id)], limit=1, context=context)
return journal and journal[0] or False
_defaults = {
@@ -57,15 +61,17 @@ class account_invoice_refund(osv.osv_memory):
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
journal_obj = self.pool.get('account.journal')
+ user_obj = self.pool.get('res.users')
res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
- type = context.get('journal_type', 'sale_refund')
- if type in ('sale', 'sale_refund'):
- type = 'sale_refund'
- else:
- type = 'purchase_refund'
+ type = context.get('type', 'out_invoice')
+ company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id
+ journal_type = (type == 'out_invoice') and 'sale_refund' or \
+ (type == 'out_refund') and 'sale' or \
+ (type == 'in_invoice') and 'purchase_refund' or \
+ (type == 'in_refund') and 'purchase'
for field in res['fields']:
if field == 'journal_id':
- journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', type)], context=context, limit=None, name_get_uid=1)
+ journal_select = journal_obj._name_search(cr, uid, '', [('type', '=', journal_type), ('company_id','child_of',[company_id])], context=context)
res['fields'][field]['selection'] = journal_select
return res
@@ -198,10 +204,10 @@ class account_invoice_refund(osv.osv_memory):
if 'value' in data and data['value']:
inv_obj.write(cr, uid, [inv_id], data['value'])
created_inv.append(inv_id)
- if inv.type in ('out_invoice', 'out_refund'):
- xml_id = 'action_invoice_tree3'
- else:
- xml_id = 'action_invoice_tree4'
+ xml_id = (inv.type == 'out_refund') and 'action_invoice_tree1' or \
+ (inv.type == 'in_refund') and 'action_invoice_tree2' or \
+ (inv.type == 'out_invoice') and 'action_invoice_tree3' or \
+ (inv.type == 'in_invoice') and 'action_invoice_tree4'
result = mod_obj.get_object_reference(cr, uid, 'account', xml_id)
id = result and result[1] or False
result = act_obj.read(cr, uid, id, context=context)
diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py
index 30bac2ae1fd..d03051b2ccb 100644
--- a/addons/account/wizard/account_reconcile.py
+++ b/addons/account/wizard/account_reconcile.py
@@ -110,7 +110,7 @@ class account_move_line_reconcile_writeoff(osv.osv_memory):
It opens the write off wizard form, in that user can define the journal, account, analytic account for reconcile
"""
_name = 'account.move.line.reconcile.writeoff'
- _description = 'Account move line reconcile'
+ _description = 'Account move line reconcile (writeoff)'
_columns = {
'journal_id': fields.many2one('account.journal','Write-Off Journal', required=True),
'writeoff_acc_id': fields.many2one('account.account','Write-Off account', required=True),
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml
index 4ee4693abcb..bfb7a892668 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml
@@ -11,7 +11,7 @@
[('invoice_id','=',False)]
-
+
Overpassed Accounts
@@ -20,6 +20,6 @@
tree,form,graph
[('date','<=',time.strftime('%Y-%m-%d')),('state','=','open')]
-
+
diff --git a/addons/account_analytic_default/__openerp__.py b/addons/account_analytic_default/__openerp__.py
index c2bea6783df..07cde53d003 100644
--- a/addons/account_analytic_default/__openerp__.py
+++ b/addons/account_analytic_default/__openerp__.py
@@ -39,7 +39,11 @@ Allows to automatically select analytic accounts based on criterions:
'images' : ['images/analytic_defaults.jpeg'],
'depends' : ['sale'],
'init_xml' : [],
- 'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'security/account_analytic_default_security.xml',
+ 'account_analytic_default_view.xml'
+ ],
'demo_xml' : [],
'installable': True,
'active': False,
diff --git a/addons/account_analytic_default/account_analytic_default_view.xml b/addons/account_analytic_default/account_analytic_default_view.xml
index f078ba09c22..753765019f6 100644
--- a/addons/account_analytic_default/account_analytic_default_view.xml
+++ b/addons/account_analytic_default/account_analytic_default_view.xml
@@ -44,7 +44,7 @@
search
-
+
diff --git a/addons/account_analytic_default/security/account_analytic_default_security.xml b/addons/account_analytic_default/security/account_analytic_default_security.xml
new file mode 100644
index 00000000000..7ff68c7d849
--- /dev/null
+++ b/addons/account_analytic_default/security/account_analytic_default_security.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+ Analytic Default multi company rule
+
+
+ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]
+
+
+
+
diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py
index c37a93b4be4..7c808e810cd 100644
--- a/addons/account_anglo_saxon/invoice.py
+++ b/addons/account_anglo_saxon/invoice.py
@@ -25,7 +25,7 @@ from osv import osv
class account_invoice_line(osv.osv):
_inherit = "account.invoice.line"
-
+
def move_line_get(self, cr, uid, invoice_id, context=None):
res = super(account_invoice_line,self).move_line_get(cr, uid, invoice_id, context=context)
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
@@ -33,9 +33,9 @@ class account_invoice_line(osv.osv):
def get_price(cr, uid, inv, company_currency,i_line):
cur_obj = self.pool.get('res.currency')
if inv.currency_id.id != company_currency:
- price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, context={'date': inv.date_invoice})
+ price = cur_obj.compute(cr, uid, company_currency, inv.currency_id.id, i_line.product_id.standard_price * i_line.quantity, context={'date': inv.date_invoice})
else:
- price = i_line.product_id.product_tmpl_id.standard_price * i_line.quantity
+ price = i_line.product_id.standard_price * i_line.quantity
return price
if inv.type in ('out_invoice','out_refund'):
@@ -43,27 +43,27 @@ class account_invoice_line(osv.osv):
if i_line.product_id:
if inv.type == 'out_invoice':
# debit account dacc will be the output account
- # first check the product, if empty check the category
- dacc = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
+ # first check the product, if empty check the category
+ dacc = i_line.product_id.property_stock_account_output and i_line.product_id.property_stock_account_output.id
if not dacc:
dacc = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
else:
# = out_refund
# debit account dacc will be the input account
- # first check the product, if empty check the category
- dacc = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
+ # first check the product, if empty check the category
+ dacc = i_line.product_id.property_stock_account_input and i_line.product_id.property_stock_account_input.id
if not dacc:
dacc = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
# in both cases the credit account cacc will be the expense account
- # first check the product, if empty check the category
- cacc = i_line.product_id.product_tmpl_id.property_account_expense and i_line.product_id.product_tmpl_id.property_account_expense.id
+ # first check the product, if empty check the category
+ cacc = i_line.product_id.property_account_expense and i_line.product_id.property_account_expense.id
if not cacc:
cacc = i_line.product_id.categ_id.property_account_expense_categ and i_line.product_id.categ_id.property_account_expense_categ.id
if dacc and cacc:
res.append({
'type':'src',
'name': i_line.name[:64],
- 'price_unit':i_line.product_id.product_tmpl_id.standard_price,
+ 'price_unit':i_line.product_id.standard_price,
'quantity':i_line.quantity,
'price':get_price(cr, uid, inv, company_currency, i_line),
'account_id':dacc,
@@ -72,11 +72,11 @@ class account_invoice_line(osv.osv):
'account_analytic_id':i_line.account_analytic_id.id,
'taxes':i_line.invoice_line_tax_id,
})
-
+
res.append({
'type':'src',
'name': i_line.name[:64],
- 'price_unit':i_line.product_id.product_tmpl_id.standard_price,
+ 'price_unit':i_line.product_id.standard_price,
'quantity':i_line.quantity,
'price': -1 * get_price(cr, uid, inv, company_currency, i_line),
'account_id':cacc,
@@ -88,36 +88,36 @@ class account_invoice_line(osv.osv):
elif inv.type in ('in_invoice','in_refund'):
for i_line in inv.invoice_line:
if i_line.product_id:
- if i_line.product_id.product_tmpl_id.type != 'service':
- # get the price difference account at the product
- acc = i_line.product_id.product_tmpl_id.property_account_creditor_price_difference and i_line.product_id.product_tmpl_id.property_account_creditor_price_difference.id
+ if i_line.product_id.type != 'service':
+ # get the price difference account at the product
+ acc = i_line.product_id.property_account_creditor_price_difference and i_line.product_id.property_account_creditor_price_difference.id
if not acc:
- # if not found on the product get the price difference account at the category
+ # if not found on the product get the price difference account at the category
acc = i_line.product_id.categ_id.property_account_creditor_price_difference_categ and i_line.product_id.categ_id.property_account_creditor_price_difference_categ.id
a = None
if inv.type == 'in_invoice':
# oa will be the stock input account
- # first check the product, if empty check the category
- oa = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id
+ # first check the product, if empty check the category
+ oa = i_line.product_id.property_stock_account_input and i_line.product_id.property_stock_account_input.id
if not oa:
oa = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id
else:
# = in_refund
# oa will be the stock output account
- # first check the product, if empty check the category
- oa = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id
+ # first check the product, if empty check the category
+ oa = i_line.product_id.property_stock_account_output and i_line.product_id.property_stock_account_output.id
if not oa:
oa = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id
if oa:
- # get the fiscal position
+ # get the fiscal position
fpos = i_line.invoice_id.fiscal_position or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
diff_res = []
- # calculate and write down the possible price difference between invoice price and product price
+ # calculate and write down the possible price difference between invoice price and product price
for line in res:
if a == line['account_id'] and i_line.product_id.id == line['product_id']:
uom = i_line.product_id.uos_id or i_line.product_id.uom_id
- standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.product_tmpl_id.standard_price, i_line.uos_id.id)
+ standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.standard_price, i_line.uos_id.id)
if standard_price != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc:
price_diff = i_line.price_unit - standard_price
line.update({'price':standard_price * line['quantity']})
@@ -134,8 +134,8 @@ class account_invoice_line(osv.osv):
'taxes':line.get('taxes',[]),
})
res += diff_res
- return res
-
+ return res
+
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
if not product:
return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
@@ -145,19 +145,19 @@ class account_invoice_line(osv.osv):
if type in ('in_invoice','in_refund'):
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
if type == 'in_invoice':
- oa = product_obj.product_tmpl_id.property_stock_account_input and product_obj.product_tmpl_id.property_stock_account_input.id
+ oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id
if not oa:
oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id
else:
- oa = product_obj.product_tmpl_id.property_stock_account_output and product_obj.product_tmpl_id.property_stock_account_output.id
+ oa = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id
if not oa:
oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
if oa:
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id, context=context) or False
a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa)
- res['value'].update({'account_id':a})
+ res['value'].update({'account_id':a})
return res
-
+
account_invoice_line()
class account_invoice(osv.osv):
@@ -170,7 +170,7 @@ class account_invoice(osv.osv):
if inv_obj.type == 'in_invoice':
if line.get('product_id',False):
product_obj = self.pool.get('product.product').browse(cr, uid, line['product_id'][0])
- oa = product_obj.product_tmpl_id.property_stock_account_output and product_obj.product_tmpl_id.property_stock_account_output.id
+ oa = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id
if not oa:
oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id
if oa:
@@ -180,6 +180,6 @@ class account_invoice(osv.osv):
line.update({'account_id': (account_data['id'],account_data['name'])})
res = super(account_invoice,self)._refund_cleanup_lines(cr, uid, lines)
return res
-
+
account_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_anglo_saxon/product_view.xml b/addons/account_anglo_saxon/product_view.xml
index 63c21407b69..8697631c394 100644
--- a/addons/account_anglo_saxon/product_view.xml
+++ b/addons/account_anglo_saxon/product_view.xml
@@ -8,6 +8,7 @@
+
@@ -36,7 +37,7 @@
diff --git a/addons/account_anglo_saxon/purchase.py b/addons/account_anglo_saxon/purchase.py
index ac2dffbfd22..362d5028a24 100644
--- a/addons/account_anglo_saxon/purchase.py
+++ b/addons/account_anglo_saxon/purchase.py
@@ -29,7 +29,7 @@ class purchase_order(osv.osv):
def inv_line_create(self, cr, uid, a, ol):
line = super(purchase_order, self).inv_line_create(cr, uid, a, ol)
if ol.product_id:
- oa = ol.product_id.product_tmpl_id.property_stock_account_input and ol.product_id.product_tmpl_id.property_stock_account_input.id
+ oa = ol.product_id.property_stock_account_input and ol.product_id.property_stock_account_input.id
if not oa:
oa = ol.product_id.categ_id.property_stock_account_input_categ and ol.product_id.categ_id.property_stock_account_input_categ.id
if oa:
diff --git a/addons/account_asset/i18n/fr.po b/addons/account_asset/i18n/fr.po
index 65ccfcf1bbd..cfdf5e5432b 100755
--- a/addons/account_asset/i18n/fr.po
+++ b/addons/account_asset/i18n/fr.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-11-24 12:54+0000\n"
-"PO-Revision-Date: 2011-08-29 20:43+0000\n"
+"PO-Revision-Date: 2011-09-17 13:42+0000\n"
"Last-Translator: lholivier \n"
"Language-Team: French \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:59+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-18 04:58+0000\n"
+"X-Generator: Launchpad (build 13955)\n"
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal
@@ -94,7 +94,7 @@ msgstr "Écritures générées"
#: field:account.asset.property,method_delay:0
#: field:account.asset.property.history,method_delay:0
msgid "Number of interval"
-msgstr ""
+msgstr "Période"
#. module: account_asset
#: wizard_button:account.asset.compute,asset_compute,asset_open:0
@@ -173,7 +173,7 @@ msgstr "Compte Analytique"
#. module: account_asset
#: field:account.asset.property,state:0
msgid "State"
-msgstr ""
+msgstr "État"
#. module: account_asset
#: view:account.asset.asset:0
@@ -252,7 +252,7 @@ msgstr ""
#: field:account.asset.board,value_gross:0
#: field:account.asset.property,value_total:0
msgid "Gross value"
-msgstr ""
+msgstr "Valeur brute"
#. module: account_asset
#: selection:account.asset.property,method_time:0
@@ -315,7 +315,7 @@ msgstr "Emplacement"
#. module: account_asset
#: field:account.asset.property,method:0
msgid "Computation method"
-msgstr ""
+msgstr "Méthode de calcul"
#. module: account_asset
#: field:account.asset.property,method_time:0
@@ -325,7 +325,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,active:0
msgid "Active"
-msgstr ""
+msgstr "Actif"
#. module: account_asset
#: field:account.asset.property.history,user_id:0
@@ -480,12 +480,12 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,value_total:0
msgid "Total value"
-msgstr ""
+msgstr "Valeur totale"
#. module: account_asset
#: selection:account.asset.asset,state:0
msgid "View"
-msgstr ""
+msgstr "Vue"
#. module: account_asset
#: view:account.asset.asset:0
@@ -495,17 +495,17 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,sequence:0
msgid "Sequence"
-msgstr ""
+msgstr "Séquence"
#. module: account_asset
#: field:account.asset.property,value_residual:0
msgid "Residual value"
-msgstr ""
+msgstr "Valeur résiduelle"
#. module: account_asset
#: wizard_button:account.asset.close,init,asset_close:0
msgid "End of asset"
-msgstr ""
+msgstr "Fin de l'immobilisation"
#. module: account_asset
#: selection:account.asset.property,type:0
@@ -515,7 +515,7 @@ msgstr ""
#. module: account_asset
#: selection:account.asset.property,type:0
msgid "Indirect"
-msgstr ""
+msgstr "Indirect"
#. module: account_asset
#: field:account.asset.asset,parent_id:0
@@ -526,4 +526,4 @@ msgstr ""
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_tree
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_tree
msgid "Asset Hierarchy"
-msgstr ""
+msgstr "Hiérarchie des immobilisations"
diff --git a/addons/account_budget/account_budget_view.xml b/addons/account_budget/account_budget_view.xml
index 41ebcdf437d..2f8c8b5d27b 100644
--- a/addons/account_budget/account_budget_view.xml
+++ b/addons/account_budget/account_budget_view.xml
@@ -170,12 +170,12 @@
search
-
+
-
-
+
+
@@ -222,13 +222,13 @@
|