diff --git a/addons/account/account.py b/addons/account/account.py index 470282fadcd..f79e36c7681 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -204,7 +204,7 @@ class account_account(osv.osv): args[pos] = ('id', 'in', ids1) pos += 1 - if context and context.has_key('consolidate_childs'): #add consolidated childs of accounts + if context and context.has_key('consolidate_children'): #add consolidated children of accounts ids = super(account_account, self).search(cr, uid, args, offset, limit, order, context=context, count=count) for consolidate_child in self.browse(cr, uid, context['account_id'], context=context).child_consol_ids: @@ -285,6 +285,7 @@ class account_account(osv.osv): children_and_consolidated.reverse() brs = list(self.browse(cr, uid, children_and_consolidated, context=context)) sums = {} + currency_obj = self.pool.get('res.currency') while brs: current = brs[0] # can_compute = True @@ -299,8 +300,11 @@ class account_account(osv.osv): brs.pop(0) for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) - if current.child_id: - sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id) + for child in current.child_id: + if child.company_id.currency_id.id == current.company_id.currency_id.id: + sums[current.id][fn] += sums[child.id][fn] + else: + sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) res = {} null_result = dict((fn, 0.0) for fn in field_names) for id in ids: @@ -607,8 +611,8 @@ class account_journal(osv.osv): } _defaults = { - 'user_id': lambda self,cr,uid,context: uid, - 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, + 'user_id': lambda self, cr, uid, context: uid, + 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } _sql_constraints = [ ('code_company_uniq', 'unique (code, company_id)', 'The code of the journal must be unique per company !'), @@ -708,7 +712,6 @@ class account_journal(osv.osv): return self.name_get(cr, user, ids, context=context) - def onchange_type(self, cr, uid, ids, type, currency, context=None): obj_data = self.pool.get('ir.model.data') user_pool = self.pool.get('res.users') @@ -1278,6 +1281,8 @@ class account_move(osv.osv): return super(account_move, self).copy(cr, uid, id, default, context) def unlink(self, cr, uid, ids, context=None, check=True): + if context is None: + context = {} toremove = [] obj_move_line = self.pool.get('account.move.line') for move in self.browse(cr, uid, ids, context=context): @@ -1916,7 +1921,7 @@ class account_tax(osv.osv): RETURN: [ tax ] tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} - one tax for each tax id in IDS and their childs + one tax for each tax id in IDS and their children """ res = self._unit_compute(cr, uid, taxes, price_unit, address_id, product, partner, quantity) total = 0.0 @@ -2011,7 +2016,7 @@ class account_tax(osv.osv): RETURN: [ tax ] tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2} - one tax for each tax id in IDS and their childs + one tax for each tax id in IDS and their children """ res = self._unit_compute_inv(cr, uid, taxes, price_unit, address_id, product, partner=None) total = 0.0 @@ -2611,11 +2616,12 @@ class wizard_multi_charts_accounts(osv.osv_memory): cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",)) configured_cmp = [r[0] for r in cr.fetchall()] unconfigured_cmp = list(set(company_ids)-set(configured_cmp)) - if unconfigured_cmp: - cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)] - for field in res['fields']: - if field == 'company_id': - res['fields'][field]['domain'] = unconfigured_cmp + for field in res['fields']: + if field == 'company_id': + res['fields'][field]['domain'] = unconfigured_cmp + res['fields'][field]['selection'] = [('', '')] + if unconfigured_cmp: + cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)] res['fields'][field]['selection'] = cmp_select return res diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index e24e763ff56..b59df303170 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -50,11 +50,10 @@ class account_analytic_line(osv.osv): if context is None: context = {} if context.get('from_date',False): - args.append(['date', '>=',context['from_date']]) + args.append(['date', '>=', context['from_date']]) if context.get('to_date',False): - args.append(['date','<=',context['to_date']]) - + args.append(['date','<=', context['to_date']]) return super(account_analytic_line, self).search(cr, uid, args, offset, limit, order, context=context, count=count) @@ -158,4 +157,4 @@ class res_partner(osv.osv): res_partner() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/account_end_fy.xml b/addons/account/account_end_fy.xml index 5f4ed44adfe..650bffc58e9 100644 --- a/addons/account/account_end_fy.xml +++ b/addons/account/account_end_fy.xml @@ -14,7 +14,7 @@ action="action_account_period_tree" id="menu_action_account_period_close_tree" parent="account.menu_account_end_year_treatments" - sequence="0" groups="base.group_extended,group_account_manager,group_account_user"/> + sequence="0" groups="base.group_extended"/> diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 22ab46a1775..7b7e6b308b1 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -26,14 +26,19 @@ - - + + - - + + + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 02b8be3a8c1..2522e53b2a0 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -309,7 +309,7 @@ class account_move_line(osv.osv): context = {} c = context.copy() c['initital_bal'] = True - sql = """SELECT l2.id, SUM(l1.debit-l1.credit) + sql = """SELECT l2.id, SUM(l1.debit-l1.credit) FROM account_move_line l1, account_move_line l2 WHERE l2.account_id = l1.account_id AND l1.id <= l2.id @@ -318,8 +318,7 @@ class account_move_line(osv.osv): " GROUP BY l2.id" cr.execute(sql, [tuple(ids)]) - res = dict(cr.fetchall()) - return res + return dict(cr.fetchall()) def _invoice(self, cursor, user, ids, name, arg, context=None): invoice_obj = self.pool.get('account.invoice') @@ -887,7 +886,7 @@ class account_move_line(osv.osv): fld = [] fields = {} flds = [] - title = "Accounting Entries" #self.view_header_get(cr, uid, view_id, view_type, context) + title = _("Accounting Entries") #self.view_header_get(cr, uid, view_id, view_type, context) xml = '''\n\n\t''' % (title) ids = journal_pool.search(cr, uid, []) @@ -906,8 +905,8 @@ class account_move_line(osv.osv): else: fields.get(field.field).append(journal.id) common_fields[field.field] = common_fields[field.field] + 1 - fld.append(('period_id', 3, 'Period')) - fld.append(('journal_id', 10, 'Journal')) + fld.append(('period_id', 3, _('Period'))) + fld.append(('journal_id', 10, _('Journal'))) flds.append('period_id') flds.append('journal_id') fields['period_id'] = all_journal @@ -927,10 +926,10 @@ class account_move_line(osv.osv): # state = 'colors="red:state==\'draft\'"' attrs = [] if field == 'debit': - attrs.append('sum = "Total debit"') + attrs.append('sum = "%s"' % _("Total debit")) elif field == 'credit': - attrs.append('sum = "Total credit"') + attrs.append('sum = "%s"' % _("Total credit")) elif field == 'move_id': attrs.append('required = "False"') @@ -1284,4 +1283,4 @@ class account_move_line(osv.osv): account_move_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index a8b3f5ad31d..db2984b5593 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -276,6 +276,7 @@ + @@ -762,7 +763,7 @@ An account type is used to determine how an account is used in each journal. The deferral method of an account type determines the process for the annual closing. Reports such as the Balance Sheet and the Profit and Loss report use the category (profit/loss or balance sheet). For example, the account type could be linked to an asset account, expense account or payable account. From this view, you can create and manage the account types you need for your company. - + @@ -1227,7 +1228,7 @@ id="menu_action_account_moves_all" parent="account.menu_finance_entries" sequence="1" - groups="group_account_user,group_account_manager" + groups="group_account_user" /> @@ -1475,7 +1476,7 @@ action="action_move_journal_line" id="menu_action_move_journal_line_form" parent="account.menu_finance_entries" - groups="group_account_user,group_account_manager" + groups="group_account_user" sequence="5"/> @@ -1742,7 +1743,7 @@ + parent="account.menu_configuration_misc" groups="base.group_extended"/> - - Leads Analysis - crm.lead.report - form - {'search_default_filter_lead': 1, 'search_default_lead':1, "search_default_user":1,"search_default_this_month":1,'group_by_no_leaf':1,'group_by':[]} - tree,graph - [('type', '=', 'lead')] - Leads Analysis allows you to check different CRM related information. Check for treatment delays, number of responses given and emails sent. You can sort out your leads analysis by different groups to get accurate grained analysis. - - + + Leads Analysis + crm.lead.report + form + {'search_default_filter_lead': 1, "search_default_user":1, "search_default_this_month":1, 'group_by_no_leaf':1, 'group_by':[]} + tree,graph + [] + Leads Analysis allows you to check different CRM related information. Check for treatment delays, number of responses given and emails sent. You can sort out your leads analysis by different groups to get accurate grained analysis. + tree - graph diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml index 3f5620d9751..cbe3ec94c20 100644 --- a/addons/crm/res_partner_view.xml +++ b/addons/crm/res_partner_view.xml @@ -92,7 +92,8 @@ icon="terp-partner" name="%(action_crm_phonecall2partner)d" type="action" - attrs="{'invisible':[('partner_id','!=',False)]}" /> + attrs="{'invisible':[('partner_id','!=',False)]}" + groups="base.group_partner_manager" /> diff --git a/addons/crm/scripts/php/xmlrpc.inc b/addons/crm/scripts/php/xmlrpc.inc old mode 100755 new mode 100644 diff --git a/addons/crm/wizard/crm_phonecall_to_partner_view.xml b/addons/crm/wizard/crm_phonecall_to_partner_view.xml index 6da8a168b21..b9f7dad6c07 100644 --- a/addons/crm/wizard/crm_phonecall_to_partner_view.xml +++ b/addons/crm/wizard/crm_phonecall_to_partner_view.xml @@ -14,7 +14,7 @@