diff --git a/addons/account/account.py b/addons/account/account.py index 5a0ce67b8a2..208bf1d6f68 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1654,11 +1654,11 @@ class account_tax(osv.osv): _columns = { 'name': fields.char('Tax Name', size=64, required=True, translate=True, help="This name will be displayed on reports"), 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the tax lines from the lowest sequences to the higher ones. The order is important if you have a tax with several tax children. In this case, the evaluation order is important."), - 'amount': fields.float('Amount', required=True, digits=(14,4), help="For Tax Type percent enter % ratio between 0-1."), + 'amount': fields.float('Amount', required=True, digits_compute=dp.get_precision('Account'), help="For taxes of type percentage, enter % ratio between 0-1."), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the tax without removing it."), - 'type': fields.selection( [('percent','Percent'), ('fixed','Fixed'), ('none','None'), ('code','Python Code'),('balance','Balance')], 'Tax Type', required=True, + 'type': fields.selection( [('percent','Percentage'), ('fixed','Fixed Amount'), ('none','None'), ('code','Python Code'), ('balance','Balance')], 'Tax Type', required=True, help="The computation method for the tax amount."), - 'applicable_type': fields.selection( [('true','True'), ('code','Python Code')], 'Applicable Type', required=True, + 'applicable_type': fields.selection( [('true','Always'), ('code','Given by Python Code')], 'Applicability', required=True, help="If not applicable (computed through a Python code), the tax won't appear on the invoice."), 'domain':fields.char('Domain', size=32, help="This field is only used if you develop your own module allowing developers to create specific taxes in a custom domain."), 'account_collected_id':fields.many2one('account.account', 'Invoice Tax Account'), @@ -1669,7 +1669,6 @@ class account_tax(osv.osv): 'python_compute':fields.text('Python Code'), 'python_compute_inv':fields.text('Python Code (reverse)'), 'python_applicable':fields.text('Python Code'), - 'tax_group': fields.selection([('vat','VAT'),('other','Other')], 'Tax Group', help="If a default tax is given in the partner it only overrides taxes from accounts (or products) in the same group."), # # Fields used for the VAT declaration @@ -1762,7 +1761,6 @@ class account_tax(osv.osv): 'active': 1, 'type_tax_use': 'all', 'sequence': 1, - 'tax_group': 'vat', 'ref_tax_sign': 1, 'ref_base_sign': 1, 'tax_sign': 1, @@ -2421,7 +2419,6 @@ class account_tax_template(osv.osv): 'python_compute':fields.text('Python Code'), 'python_compute_inv':fields.text('Python Code (reverse)'), 'python_applicable':fields.text('Python Code'), - 'tax_group': fields.selection([('vat','VAT'),('other','Other')], 'Tax Group', help="If a default tax if given in the partner it only override taxes from account (or product) of the same group."), # # Fields used for the VAT declaration @@ -2464,7 +2461,6 @@ class account_tax_template(osv.osv): 'type': 'percent', 'amount': 0, 'sequence': 1, - 'tax_group': 'vat', 'ref_tax_sign': 1, 'ref_base_sign': 1, 'tax_sign': 1, @@ -2609,7 +2605,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'python_compute': tax.python_compute, 'python_compute_inv': tax.python_compute_inv, 'python_applicable': tax.python_applicable, - 'tax_group':tax.tax_group, 'base_code_id': tax.base_code_id and ((tax.base_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.base_code_id.id]) or False, 'tax_code_id': tax.tax_code_id and ((tax.tax_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.tax_code_id.id]) or False, 'base_sign': tax.base_sign, diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 647d80e61be..bbcd6188327 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -222,11 +222,11 @@ class account_bank_statement(osv.osv): account_move_line_obj = self.pool.get('account.move.line') account_analytic_line_obj = self.pool.get('account.analytic.line') account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') - st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context) st = st_line.statement_id context.update({'date': st_line.date}) + move_id = account_move_obj.create(cr, uid, { 'journal_id': st.journal_id.id, 'period_id': st.period_id.id, @@ -501,4 +501,4 @@ class account_bank_statement_line(osv.osv): account_bank_statement_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_cash_statement.py b/addons/account/account_cash_statement.py index aebff216c3b..ed987de7e37 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -247,7 +247,7 @@ class account_cash_statement(osv.osv): open_jrnl = self.search(cr, uid, sql) if open_jrnl: raise osv.except_osv('Error', _('You can not have two open register for the same journal')) - + if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash': open_close = self._get_cash_open_close_box_lines(cr, uid, context) vals.update({ @@ -370,16 +370,6 @@ class account_cash_statement(osv.osv): super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context) return self.write(cr, uid, ids, {'closing_date':time.strftime("%Y-%m-%d %H:%M:%S")}, context=context) - - def button_cancel(self, cr, uid, ids, context={}): - done = [] - for st in self.browse(cr, uid, ids, context): - ids = [] - for line in st.line_ids: - ids += [x.id for x in line.move_ids] - self.pool.get('account.move').unlink(cr, uid, ids, context) - done.append(st.id) - self.write(cr, uid, done, {'state':'draft'}, context=context) - return True - account_cash_statement() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index ecce5df944f..fc4d350ea36 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -3,33 +3,33 @@ - - + + - + - + - - + + - - - + + + - + - + + groups="group_account_user,group_account_manager"/> - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a85bfd00316..1fda3fa8a6c 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -36,12 +36,18 @@ class account_move_line(osv.osv): fiscalperiod_obj = self.pool.get('account.period') fiscalyear_ids = [] fiscalperiod_ids = [] - if not context.get('fiscalyear', False) and not context.get('empty_fy_allow', False): + initial_bal = context.get('initial_bal', False) + company_clause = "" + if context.get('company_id', False): + company_clause = " AND " +obj+".company_id = %s" % context.get('company_id', False) + if not context.get('fiscalyear', False): fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')]) - elif context.get('empty_fy_allow', False): - fiscalyear_ids = context['fiscalyear'] else: - fiscalyear_ids = [context['fiscalyear']] + if initial_bal: + fiscalyear_date_start = fiscalyear_obj.read(cr, uid, context['fiscalyear'], ['date_start'])['date_start'] + fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_stop', '<', fiscalyear_date_start), ('state', '=', 'draft')], context=context) + else: + fiscalyear_ids = [context['fiscalyear']] fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0' state = context.get('state',False) @@ -50,12 +56,23 @@ class account_move_line(osv.osv): where_move_lines_by_date = '' if context.get('date_from', False) and context.get('date_to', False): - where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date >= '" +context['date_from']+"' AND date <= '"+context['date_to']+"')" + if initital_bal: + where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date < '"+context['date_from']+"')" + else: + where_move_lines_by_date = " AND " +obj+".move_id in ( select id from account_move where date >= '" +context['date_from']+"' AND date <= '"+context['date_to']+"')" if state: if state.lower() not in ['all']: where_move_state= " AND "+obj+".move_id in (select id from account_move where account_move.state = '"+state+"')" + if context.get('period_from', False) and context.get('periof_from', False) and not context.get('periods', False): + if initial_bal: + period_company_id = period_obj.browse(cr, uid, data['form']['period_from'], context=context).company_id.id + first_period = self.pool.get('account.period').search(cr, uid, [('company_id', '=', period_company_id)], order='date_start', limit=1)[0] + context['periods'] = period_obj.build_ctx_periods(cr, uid, first_period, data['form']['period_from']) + else: + context['periods'] = period_obj.build_ctx_periods(cr, uid, data['form']['period_from'], data['form']['period_to']) + if context.get('periods', False): ids = ','.join([str(x) for x in context['periods']]) query = obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s %s" % (fiscalyear_clause, ids, where_move_state, where_move_lines_by_date) @@ -69,6 +86,8 @@ class account_move_line(osv.osv): child_ids = self.pool.get('account.account')._get_children_and_consol(cr, uid, [context['chart_account_id']], context=context) query += ' AND '+obj+'.account_id in (%s)' % ','.join(map(str, child_ids)) + query += company_clause + if context.get('period_manner','') == 'created': #the query have to be build with no reference to periods but thanks to the creation date if context.get('periods',False): @@ -77,8 +96,6 @@ class account_move_line(osv.osv): else: fiscalperiod_ids = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id','in',fiscalyear_ids)]) - - #remove from the old query the clause related to the period selection res = '' count = 1 @@ -309,15 +326,27 @@ class account_move_line(osv.osv): ml = self.browse(cr, uid, id, context) return map(lambda x: x.id, ml.move_id.line_id) - # TODO: this is false, it does not uses draft and closed periods - def _balance(self, cr, uid, ids, prop, unknow_none, unknow_dict): - res={} - # TODO group the foreach in sql - for id in ids: - cr.execute('SELECT date,account_id FROM account_move_line WHERE id=%s', (id,)) - dt, acc = cr.fetchone() - cr.execute('SELECT SUM(debit-credit) FROM account_move_line WHERE account_id=%s AND (date<%s OR (date=%s AND id<=%s))', (acc,dt,dt,id)) - res[id] = cr.fetchone()[0] + def _balance(self, cr, uid, ids, name, arg, context=None): + if context is None: + context = {} + + c = context.copy() + c['initital_bal'] = True + + 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""", + """and""", + """l2.id in %s""", + """and""", + self._query_get(cr, uid, obj='l1', context=c), + """ group by l2.id""", + ] + + cr.execute('\n'.join(sql), [tuple(ids)]) + res = dict(cr.fetchall()) return res def _invoice(self, cursor, user, ids, name, arg, context=None): diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 4aaac87a25b..8fca640bdf7 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -433,7 +433,7 @@ - account.bank.statement.select + account.cash.statement.select account.bank.statement search @@ -444,7 +444,7 @@ - + @@ -489,7 +489,7 @@ - + @@ -600,6 +600,7 @@ tree,form,graph [('journal_id.type', '=', 'bank')] {'journal_type':'bank'} + @@ -614,12 +615,13 @@ - + Bank Statements account.bank.statement form tree,form,graph [('journal_id.type', '=', 'bank')] + {'journal_type':'bank'} @@ -808,7 +810,6 @@ - @@ -819,15 +820,12 @@ - - - @@ -841,52 +839,46 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - + + + + + @@ -1154,7 +1146,7 @@ id="menu_action_account_moves_all" parent="account.menu_finance_entries" sequence="1" - groups="group_account_user,group_account_manager,base.group_system" + groups="group_account_user,group_account_manager" /> @@ -1418,10 +1410,6 @@ res_model="account.move.line" src_model="account.move"/> - - - - Journal Items ir.actions.act_window @@ -1505,6 +1493,7 @@ account.bank.statement form form,tree + @@ -1646,17 +1635,17 @@ search - - - - - - - + + + + + + + - + @@ -1800,7 +1789,7 @@ - + account.subscription.search account.subscription search @@ -2184,7 +2173,6 @@ - @@ -2248,8 +2236,6 @@ - - diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index e8aecb2033c..5ae2890fd20 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -49,7 +49,7 @@ - + diff --git a/addons/account/company.py b/addons/account/company.py index 873a65c415e..8e14fe53c3a 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -24,7 +24,7 @@ from osv import fields, osv class res_company(osv.osv): _inherit = "res.company" _columns = { - 'overdue_msg' : fields.text('Overdue Payments Message', translate=True), + 'overdue_msg': fields.text('Overdue Payments Message', translate=True), 'property_reserve_and_surplus_account': fields.property( 'account.account', type='many2one', @@ -41,6 +41,7 @@ class res_company(osv.osv): out after this mail was sent, please consider the present one as \ void. Do not hesitate to contact our accounting department' } + res_company() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/i18n/nl.po b/addons/account/i18n/nl.po index b6aa1acd5f3..7cfdfc93898 100644 --- a/addons/account/i18n/nl.po +++ b/addons/account/i18n/nl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-09-29 10:28+0000\n" +"PO-Revision-Date: 2010-09-30 06:57+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-09-30 04:40+0000\n" +"X-Launchpad-Export-Date: 2010-10-01 08:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account diff --git a/addons/account/installer.py b/addons/account/installer.py index b85ac874874..680f8284295 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -170,7 +170,6 @@ class account_installer(osv.osv_memory): 'python_compute': tax.python_compute, 'python_compute_inv': tax.python_compute_inv, 'python_applicable': tax.python_applicable, - 'tax_group':tax.tax_group, 'base_code_id': tax.base_code_id and ((tax.base_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.base_code_id.id]) or False, 'tax_code_id': tax.tax_code_id and ((tax.tax_code_id.id in tax_code_template_ref) and tax_code_template_ref[tax.tax_code_id.id]) or False, 'base_sign': tax.base_sign, diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index b9e01e48bbf..21aa455b9c2 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -30,7 +30,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header): def __init__(self, cr, uid, name, context): super(aged_trial_report, self).__init__(cr, uid, name, context=context) - self.query_line = '' self.total_account = [] self.localcontext.update({ 'time': time, @@ -47,7 +46,8 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header): }) def set_context(self, objects, data, ids, report_type=None): - self.query = data['form'].get('query_line', '') + obj_move = self.pool.get('account.move.line') + self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) self.direction_selection = data['form'].get('direction_selection', 'past') self.target_move = data['form'].get('target_move', 'all') self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d')) diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py index 440460ce1f3..36af31da363 100644 --- a/addons/account/report/account_central_journal.py +++ b/addons/account/report/account_central_journal.py @@ -51,12 +51,13 @@ class journal_print(report_sxw.rml_parse, common_report_header): }) def set_context(self, objects, data, ids, report_type=None): + obj_move = self.pool.get('account.move.line') new_ids = ids self.query_get_clause = '' if (data['model'] == 'ir.ui.menu'): new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or [] self.query_get_clause = 'AND ' - self.query_get_clause += data['form']['query_line'] or '' + self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) if new_ids: self.cr.execute('SELECT period_id, journal_id FROM account_journal_period WHERE id IN %s', (tuple(new_ids),)) diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py index 684a75b1f20..e38f32ac217 100644 --- a/addons/account/report/account_general_journal.py +++ b/addons/account/report/account_general_journal.py @@ -53,12 +53,13 @@ class journal_print(report_sxw.rml_parse, common_report_header): }) def set_context(self, objects, data, ids, report_type=None): + obj_move = self.pool.get('account.move.line') new_ids = ids self.query_get_clause = '' if (data['model'] == 'ir.ui.menu'): new_ids = 'active_ids' in data['form'] and data['form']['active_ids'] or [] self.query_get_clause = 'AND ' - self.query_get_clause += data['form']['query_line'] or '' + self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) if new_ids: self.cr.execute('SELECT period_id, journal_id FROM account_journal_period WHERE id IN %s', (tuple(new_ids),)) diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index d8ab573b083..80a7ff44f0e 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -38,9 +38,12 @@ class general_ledger(rml_parse.rml_parse, common_report_header): def set_context(self, objects, data, ids, report_type=None): new_ids = ids + obj_move = self.pool.get('account.move.line') self.sortby = data['form'].get('sortby', 'sort_date') - self.query = data['form'].get('query_line', '') - self.init_query = data['form']['initial_bal_query'] + self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context',{})) + ctx2 = data['form'].get('used_context',{}).copy() + ctx2.update({'initial_bal': True}) + self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2) self.init_balance = data['form']['initial_balance'] self.display_account = data['form']['display_account'] self.target_move = data['form'].get('target_move', 'all') @@ -97,7 +100,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header): FROM account_move_line l \ WHERE l.account_id = %s AND %s '%(account.id, self.init_query)) sum_currency += self.cr.fetchone()[0] or 0.0 - return str(sum_currency) + return sum_currency def get_children_accounts(self, account): res = [] diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index 163d5cb5f2c..1321bdea750 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -266,10 +266,10 @@ [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]] - [[formatLang(sum_debit_account(o)) ]] - [[formatLang(sum_credit_account(o)) ]] - [[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]] - [[ o.currency_id and sum_currency_amount_account(o) +o.currency_id.code or '' ]] + [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]] + [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]] + [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]] @@ -292,9 +292,9 @@ [[ line['move'] ]] [[ line['lname'] ]] [[ strip_name(line['line_corresp'].replace(', ',','),40) ]] - [[ formatLang(line['debit']) ]] - [[ formatLang(line['credit']) ]] - [[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]] + [[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]] + [[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] [[ formatLang(line['amount_currency'] or '')]] [[ line['currency_code'] or '' ]] @@ -327,9 +327,9 @@ [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]] - [[formatLang(sum_debit_account(o)) ]] - [[formatLang(sum_credit_account(o)) ]] - [[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]] + [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]] + [[ formatLang(sum_credit_account(o), digits=get_digits(dp=Account)) ]] + [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] @@ -352,9 +352,9 @@ [[ line['move'] ]] [[ line['lname'] ]] [[ strip_name(line['line_corresp'],15) ]] - [[ formatLang(line['debit']) ]] - [[ formatLang(line['credit']) ]] - [[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line['debit'], dp='Account') ]] + [[ formatLang(line['credit'], dp='Account') ]] + [[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]] diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 9d62829ef93..ac41bf0b3fd 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -52,13 +52,14 @@ class journal_print(report_sxw.rml_parse, common_report_header): }) def set_context(self, objects, data, ids, report_type=None): + obj_move = self.pool.get('account.move.line') new_ids = ids self.query_get_clause = '' self.target_move = data['form'].get('target_move', 'all') if (data['model'] == 'ir.ui.menu'): new_ids = data['form'].get('active_ids', []) self.query_get_clause = 'AND ' - self.query_get_clause += data['form'].get('query_line', '') + self.query_get_clause += obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) self.sort_selection = data['form'].get('sort_selection', 'date') objects = self.pool.get('account.journal.period').browse(self.cr, self.uid, new_ids) if new_ids: diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py index dcf35665a02..7668a1ae2a6 100644 --- a/addons/account/report/account_partner_balance.py +++ b/addons/account/report/account_partner_balance.py @@ -22,6 +22,7 @@ import time import re import copy + from tools.translate import _ from report import report_sxw from common_report_header import common_report_header @@ -52,8 +53,8 @@ class partner_balance(report_sxw.rml_parse, common_report_header): def set_context(self, objects, data, ids, report_type=None): self.display_partner = data['form'].get('display_partner', 'non-zero_balance') - self.query = data['form'].get('query_line', '') - self.init_query = data['form'].get('initial_bal_query', '') + obj_move = self.pool.get('account.move.line') + self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) self.result_selection = data['form'].get('result_selection') self.target_move = data['form'].get('target_move', 'all') @@ -116,7 +117,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header): for rec in full_account: if not rec.get('name', False): rec.update({'name': _('Unknown Partner')}) - + ## We will now compute Total subtotal_row = self._add_subtotal(full_account) return subtotal_row @@ -141,8 +142,8 @@ class partner_balance(report_sxw.rml_parse, common_report_header): new_header['ref'] = '' new_header['name'] = r['account_name'] new_header['code'] = r['code'] - new_header['debit'] = r['debit'] - new_header['credit'] = r['credit'] + new_header['debit'] = r['debit'] + new_header['credit'] = r['credit'] new_header['scredit'] = tot_scredit new_header['sdebit'] = tot_sdebit new_header['enlitige'] = tot_enlitige diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 2a0c7446b6b..6ce8813fabb 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -56,8 +56,11 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): }) def set_context(self, objects, data, ids, report_type=None): - self.query = data['form'].get('query_line', '') - self.init_query = data['form'].get('initial_bal_query', '') + obj_move = self.pool.get('account.move.line') + self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {})) + ctx2 = data['form'].get('used_context',{}).copy() + ctx2.update({'initial_bal': True}) + self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2) self.reconcil = data['form'].get('reconcil', True) self.initial_balance = data['form'].get('initial_balance', True) self.result_selection = data['form'].get('result_selection', 'customer') diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index 326584d1b6b..f6d4ec3d88e 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -13,17 +13,12 @@ Accounting / Manager - - Accounting / Accountant and Manager - - - - + @@ -47,27 +42,27 @@ - + - + - + - + - + - + @@ -75,7 +70,7 @@ - + @@ -87,15 +82,15 @@ - + - + - + @@ -103,27 +98,27 @@ - + - + - + - + - + - + @@ -142,17 +137,17 @@ - - - + - + Account Entry diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 11c83ff48fd..f7b62aa164f 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -149,51 +149,6 @@ "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_invoice_accounting_accountant","account.invoice","model_account_invoice","account.group_accounting_accountant",1,1,1,1 -"access_account_invoice_line_accounting_accountant","account.invoice.line","model_account_invoice_line","account.group_accounting_accountant",1,1,1,1 -"access_res_partner_accounting_accountant","res.partner","base.model_res_partner","account.group_accounting_accountant",1,1,1,1 -"access_account_account_accounting_accountant","account.account","model_account_account","account.group_accounting_accountant",1,0,0,0 -"access_account_account_type_accounting_accountant","account.type","model_account_account_type","account.group_accounting_accountant",1,0,0,0 -"access_account_tax_accounting_accountant","account.tax","model_account_tax","account.group_accounting_accountant",1,0,0,0 -"access_account_tax_code_accounting_accountant","account.tax.code","model_account_tax_code","account.group_accounting_accountant",1,0,0,0 -"access_account_invoice_tax_accounting_accountant","account.invoice.tax","model_account_invoice_tax","account.group_accounting_accountant",1,0,0,0 -"access_res_partner_address_accounting_accountant","res.partner.address","base.model_res_partner_address","account.group_accounting_accountant",1,1,1,1 -"access_account_move_accounting_accountant","account.move","model_account_move","account.group_accounting_accountant",1,1,1,1 -"access_account_move_line_accounting_accountant","account.move.line","model_account_move_line","account.group_accounting_accountant",1,1,1,1 -"access_res_partner_bank_accounting_accountant","res.partner.bank","base.model_res_partner_bank","account.group_accounting_accountant",1,0,0,0 -"access_res_partner_event_accounting_accountant","res.partner.event","base.model_res_partner_event","account.group_accounting_accountant",1,0,0,0 -"access_res_currency_rate_accounting_accountant","res.currency.rate","base.model_res_currency_rate","account.group_accounting_accountant",1,1,0,0 -"access_res_currency_accounting_accountant","res.currency","base.model_res_currency","account.group_accounting_accountant",1,1,0,0 -"access_product_template_accounting_accountant","product.template","product.model_product_template","account.group_accounting_accountant",1,0,0,0 -"access_product_product_accounting_accountant","product.product","product.model_product_product","account.group_accounting_accountant",1,0,0,0 -"access_product_category_accounting_accountant","product.category","product.model_product_category","account.group_accounting_accountant",1,0,0,0 -"access_product_pricelist_accounting_accountant","product.pricelist","product.model_product_pricelist","account.group_accounting_accountant",1,0,0,0 -"access_product_pricelist_version_accounting_accountant","product.pricelist.version","product.model_product_pricelist_version","account.group_accounting_accountant",1,0,0,0 -"access_product_pricelist_item_accounting_accountant","product.pricelist.item","product.model_product_pricelist_item","account.group_accounting_accountant",1,0,0,0 -"access_account_payment_term_accounting_accountant","account.payment.term","model_account_payment_term","account.group_accounting_accountant",1,0,0,0 -"access_res_payterm_accounting_accountant","res.payterm","base.model_res_payterm","account.group_accounting_accountant",1,0,0,0 -"access_account_payment_term_line_accounting_accountant","account.payment.term.line","model_account_payment_term_line","account.group_accounting_accountant",1,0,0,0 -"access_account_journal_accounting_accountant","account.journal","model_account_journal","account.group_accounting_accountant",1,0,0,0 -"access_account_fiscalyear_accounting_accountant","account.fiscalyear","model_account_fiscalyear","account.group_accounting_accountant",1,0,0,0 -"access_account_period_accounting_accountant","account.period","model_account_period","account.group_accounting_accountant",1,0,0,0 -"access_account_move_reconcile_accounting_accountant","account.move.reconcile","model_account_move_reconcile","account.group_accounting_accountant",1,1,1,1 -"access_account_tax_code_accounting_accountant","account.tax.code","model_account_tax_code","account.group_accounting_accountant",1,0,0,0 -"access_account_bank_statement_accounting_accountant","account.bank.statement","model_account_bank_statement","account.group_accounting_accountant",1,1,1,1 -"access_account_cashbox_line_accounting_accountant","account.cashbox.line","model_account_cashbox_line","account.group_accounting_accountant",1,1,1,1 -"access_account_bank_statement_line_accounting_accountant","account.bank.statement.line","model_account_bank_statement_line","account.group_accounting_accountant",1,1,1,1 -"access_account_invoice_report_accounting_accountant","account.invoice.report","model_account_invoice_report","account.group_accounting_accountant",1,0,0,0 -"access_report_account_receivable_accounting_accountant","report.account.receivable","model_report_account_receivable","account.group_accounting_accountant",1,0,0,0 -"access_temp_range_accounting_accountant","temp.range","model_temp_range","account.group_accounting_accountant",1,0,0,0 -"access_report_aged_receivable_accounting_accountant","report.aged.receivable","model_report_aged_receivable","account.group_accounting_accountant",1,0,0,0 -"access_report_invoice_created_accounting_accountant","report.invoice.created","model_report_invoice_created","account.group_accounting_accountant",1,0,0,0 -"access_account_entries_report_accounting_accountant","account.entries.report","model_account_entries_report","account.group_accounting_accountant",1,0,0,0 -"access_account_invoice_report_accounting_accountant","account.invoice.report","model_account_invoice_report","account.group_accounting_accountant",1,0,0,0 -"access_account_journal_view_accounting_accountant","account.journal.view","model_account_journal_view","account.group_accounting_accountant",1,0,0,0 -"access_account_journal_period_accounting_accountant","account.journal.period","model_account_journal_period","account.group_accounting_accountant",1,1,1,1 -"access_account_journal_column_accounting_accountant","account.journal.column","model_account_journal_column","account.group_accounting_accountant",1,1,1,1 -"access_account_analytic_account_accounting_accountant","account.analytic.account","analytic.model_account_analytic_account","account.group_accounting_accountant",1,0,0,0 -"access_account_analytic_line_accounting_accountant","account.analytic.line","analytic.model_account_analytic_line","account.group_accounting_accountant",1,0,0,0 -"access_account_analytic_journal_accounting_accountant","account.analytic.journal","model_account_analytic_journal","account.group_accounting_accountant",1,0,0,0 "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 diff --git a/addons/account/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml index 75db8250207..6fc3cfc1f7a 100644 --- a/addons/account/wizard/account_automatic_reconcile_view.xml +++ b/addons/account/wizard/account_automatic_reconcile_view.xml @@ -8,29 +8,27 @@ form
- - - - - - - - - - - - - - - - - - - -