diff --git a/addons/account/account.py b/addons/account/account.py index bf072507aa0..46cfaf645a8 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -155,6 +155,7 @@ class account_account_type(osv.osv): return res def _save_report_type(self, cr, uid, account_type_id, field_name, field_value, arg, context=None): + field_value = field_value or 'none' obj_data = self.pool.get('ir.model.data') obj_financial_report = self.pool.get('account.financial.report') #unlink if it exists somewhere in the financial reports related to BS or PL @@ -299,7 +300,6 @@ class account_account(osv.osv): if aml_query.strip(): wheres.append(aml_query.strip()) filters = " AND ".join(wheres) - _logger.debug('Filters: %s',(filters)) # IN might not work ideally in case there are too many # children_and_consolidated, in that case join on a # values() e.g.: @@ -315,7 +315,6 @@ class account_account(osv.osv): " GROUP BY l.account_id") params = (tuple(children_and_consolidated),) + query_params cr.execute(request, params) - _logger.debug('Status: %s',(cr.statusmessage)) for row in cr.dictfetchall(): accounts[row['id']] = row @@ -596,10 +595,7 @@ class account_account(osv.osv): return res def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False): - if default is None: - default = {} - else: - default = default.copy() + default = {} if default is None else default.copy() if done_list is None: done_list = [] account = self.browse(cr, uid, id, context=context) @@ -781,10 +777,7 @@ class account_journal(osv.osv): ] def copy(self, cr, uid, id, default=None, context=None, done_list=None, local=False): - if default is None: - default = {} - else: - default = default.copy() + default = {} if default is None else default.copy() if done_list is None: done_list = [] journal = self.browse(cr, uid, id, context=context) @@ -1185,6 +1178,7 @@ class account_fiscalyear(osv.osv): } def copy(self, cr, uid, id, default=None, context=None): + default = {} if default is None else default.copy() default.update({ 'period_ids': [], 'end_journal_period_id': False @@ -1444,14 +1438,8 @@ class account_move(osv.osv): return result def copy(self, cr, uid, id, default=None, context=None): - if context is None: - default = {} - else: - default = default.copy() - if context is None: - context = {} - else: - context = context.copy() + default = {} if default is None else default.copy() + context = {} if context is None else context.copy() default.update({ 'state':'draft', 'name':'/', diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 8b2a9aff257..549363ce269 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -461,9 +461,10 @@ class account_bank_statement(osv.osv): return {} balance_start = self._compute_balance_end_real(cr, uid, journal_id, context=context) - journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['company_id'], context=context) + journal_data = self.pool.get('account.journal').read(cr, uid, journal_id, ['company_id', 'currency'], context=context) company_id = journal_data['company_id'] - return {'value': {'balance_start': balance_start, 'company_id': company_id}} + currency_id = journal_data['currency'] or self.pool.get('res.company').browse(cr, uid, company_id[0], context=context).currency_id.id + return {'value': {'balance_start': balance_start, 'company_id': company_id, 'currency': currency_id}} def unlink(self, cr, uid, ids, context=None): stat = self.read(cr, uid, ids, ['state'], context=context) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index c543b493831..57f16473b82 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1360,6 +1360,7 @@ class account_invoice_line(osv.osv): _columns = { 'name': fields.text('Description', required=True), 'origin': fields.char('Source', size=256, help="Reference of the document that produced this invoice."), + 'sequence': fields.integer('Sequence', help="Gives the sequence of this line when displaying the invoice."), 'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True), 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'), 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 26e18271dc2..8516fcd96ae 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -211,17 +211,17 @@ - +
- - + + - +
@@ -322,7 +322,7 @@ + options='{"always_reload": True}'/> @@ -368,16 +368,16 @@ - +
- - - + + +
@@ -458,7 +458,6 @@ - diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 1c40bebba52..d98b53ebbbd 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -633,13 +633,10 @@
+ - @@ -1130,8 +1127,8 @@ - - + + @@ -1177,8 +1174,8 @@ - - + + @@ -2567,7 +2564,7 @@ action = pool.get('res.config').next(cr, uid, [], context) - + @@ -2629,12 +2626,12 @@ action = pool.get('res.config').next(cr, uid, [], context) - - - + + + - + diff --git a/addons/account/product_view.xml b/addons/account/product_view.xml index 5f417825032..4d64af3e154 100644 --- a/addons/account/product_view.xml +++ b/addons/account/product_view.xml @@ -14,8 +14,8 @@ - - + + diff --git a/addons/account/project/report/analytic_balance.rml b/addons/account/project/report/analytic_balance.rml index 0c488eac400..1754988f7d6 100644 --- a/addons/account/project/report/analytic_balance.rml +++ b/addons/account/project/report/analytic_balance.rml @@ -163,7 +163,7 @@ [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'credit')) ]] - [[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]] + [[ formatLang(sum_balance(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id)]] [[ formatLang(sum_all(get_objects(data['form']['empty_acc']),data['form']['date1'],data['form']['date2'],'quantity')) ]] @@ -187,7 +187,7 @@ [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'credit')) ]] - [[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol]] + [[ formatLang(move_sum_balance(o['id'],data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id)]] [[ formatLang(move_sum(o['id'],data['form']['date1'],data['form']['date2'],'quantity')) ]] @@ -211,7 +211,7 @@ [[ formatLang(move_g['credit']) ]] - [[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol ]] + [[ formatLang(move_g['balance'], currency_obj = company.currency_id) ]] [[ formatLang(move_g['quantity']) ]] diff --git a/addons/account/project/report/cost_ledger.rml b/addons/account/project/report/cost_ledger.rml index 7500b655ab3..1099a8b8b4e 100644 --- a/addons/account/project/report/cost_ledger.rml +++ b/addons/account/project/report/cost_ledger.rml @@ -224,7 +224,7 @@ [[ formatLang (sum_credit(objects,data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2'])) ]] [[ company.currency_id.symbol ]] + [[ formatLang (sum_balance(objects,data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id) ]] @@ -245,7 +245,7 @@ [[ formatLang (account_sum_credit(account,data['form']['date1'],data['form']['date2'])) ]] - [[ formatLang (account_sum_balance(account,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol ]] + [[ formatLang (account_sum_balance(account,data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id) ]] @@ -266,7 +266,7 @@ [[ formatLang( move_g['credit']) ]] - [[ formatLang( move_g['balance']) ]] [[ company.currency_id.symbol ]] + [[ formatLang( move_g['balance'], currency_obj = company.currency_id) ]] @@ -290,7 +290,7 @@ [[ formatLang( move_a['credit']) ]] - [[ formatLang( move_a['balance']) ]] [[ company.currency_id.symbol]] + [[ formatLang( move_a['balance'], currency_obj = company.currency_id)]] diff --git a/addons/account/project/report/inverted_analytic_balance.rml b/addons/account/project/report/inverted_analytic_balance.rml index f112ec8fbd3..54b6878c407 100644 --- a/addons/account/project/report/inverted_analytic_balance.rml +++ b/addons/account/project/report/inverted_analytic_balance.rml @@ -164,7 +164,7 @@ [[ formatLang(sum_credit(objects,data['form']['date1'],data['form']['date2']))]] - [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2']))]] [[ company.currency_id.symbol]] + [[ formatLang(sum_balance(objects,data['form']['date1'],data['form']['date2']), currency_obj = company.currency_id)]] [[ formatLang(sum_quantity(objects,data['form']['date1'],data['form']['date2'])) ]] @@ -188,7 +188,7 @@ [[formatLang(move_g['credit'])]] - [[ formatLang(move_g['balance'])]] [[ company.currency_id.symbol]] + [[ formatLang(move_g['balance'], currency_obj = company.currency_id)]] [[formatLang(move_g['quantity']) ]] @@ -212,7 +212,7 @@ [[ formatLang(move_a['credit']) ]] - [[ formatLang(move_a['balance']) ]] [[ company.currency_id.symbol]] + [[ formatLang(move_a['balance'], currency_obj = company.currency_id)]] [[ formatLang(move_a['quantity']) ]] diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml index 8963ba97376..8a421e3cb36 100644 --- a/addons/account/report/account_analytic_entries_report_view.xml +++ b/addons/account/report/account_analytic_entries_report_view.xml @@ -5,7 +5,7 @@ analytic.entries.report.tree analytic.entries.report - + diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml index 667c61ab78f..551265252cc 100644 --- a/addons/account/report/account_entries_report_view.xml +++ b/addons/account/report/account_entries_report_view.xml @@ -5,7 +5,7 @@ account.entries.report.tree account.entries.report - + diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index c22d5d55f45..13a137e53df 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -5,7 +5,7 @@ account.invoice.report.tree account.invoice.report - + diff --git a/addons/account/report/account_print_overdue.py b/addons/account/report/account_print_overdue.py index 1b617e9afa4..4ddedc102f5 100644 --- a/addons/account/report/account_print_overdue.py +++ b/addons/account/report/account_print_overdue.py @@ -29,34 +29,11 @@ class Overdue(report_sxw.rml_parse): super(Overdue, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, - 'adr_get': self._adr_get, 'getLines': self._lines_get, 'tel_get': self._tel_get, 'message': self._message, }) self.context = context - def _adr_get(self, partner, type): - res = [] - res_partner = pooler.get_pool(self.cr.dbname).get('res.partner') - addresses = res_partner.address_get(self.cr, self.uid, [partner.id], [type]) - adr_id = addresses and addresses[type] or False - result = { - 'name': False, - 'street': False, - 'street2': False, - 'city': False, - 'zip': False, - 'state_id':False, - 'country_id': False, - } - if adr_id: - result = res_partner.read(self.cr, self.uid, [adr_id], context=self.context.copy()) - result[0]['country_id'] = result[0]['country_id'] and result[0]['country_id'][1] or False - result[0]['state_id'] = result[0]['state_id'] and result[0]['state_id'][1] or False - return result - - res.append(result) - return res def _tel_get(self,partner): if not partner: diff --git a/addons/account/report/account_print_overdue.rml b/addons/account/report/account_print_overdue.rml index 2d4238823da..577cb9142a2 100644 --- a/addons/account/report/account_print_overdue.rml +++ b/addons/account/report/account_print_overdue.rml @@ -126,15 +126,10 @@ - [[ repeatIn(adr_get(o, 'invoice'),'addr') ]] [[ o.title.name or '' ]] [[ o.name ]] - [[ addr['street'] ]] - [[ addr['street2'] or removeParentNode('para') ]] - [[ addr['zip'] ]] [[ addr['city'] ]] - [[ addr['state_id'] or removeParentNode('para')]] - [[ addr['country_id'] ]] + [[ display_address(o.partner_id)] ]] @@ -216,7 +211,7 @@ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] - [[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] + [[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit'], currency_obj = company.currency_id) ]] [[ line['blocked'] and 'X' or '' ]] @@ -241,7 +236,7 @@ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] [[ company.currency_id.symbol ]] + [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0)), currency_obj=company.currency_id) ]] @@ -261,7 +256,7 @@ Balance : - [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.symbol ]] + [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0)), currency_obj = company.currency_id) ]] diff --git a/addons/account/report/account_treasury_report_view.xml b/addons/account/report/account_treasury_report_view.xml index ee21b9e5ec6..be6ae0dfdc9 100644 --- a/addons/account/report/account_treasury_report_view.xml +++ b/addons/account/report/account_treasury_report_view.xml @@ -5,7 +5,7 @@ account.treasury.report.tree account.treasury.report - + diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml index 11703a4f259..eb636f61b50 100644 --- a/addons/account/wizard/account_invoice_state_view.xml +++ b/addons/account/wizard/account_invoice_state_view.xml @@ -6,7 +6,12 @@ account.invoice.confirm
- +

+ Once draft invoices are confirmed, you will not be able + to modify them. The invoices will receive a unique + number and journal items will be created in your chart + of accounts. +