diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 2bd436fdf1d..02d7cd17357 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -174,6 +174,8 @@ class account_invoice(osv.osv): lines = [] if invoice.move_id: for m in invoice.move_id.line_id: + if m.account_id != invoice.account_id: + continue temp_lines = [] if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 24723d7fb12..2ebeece7113 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -32,7 +32,7 @@ - + diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 266b8ccbc50..52708b6e87a 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -132,7 +132,7 @@ class account_fiscalyear_close(osv.osv_memory): FROM account_account a LEFT JOIN account_account_type t ON (a.user_type = t.id) WHERE a.active - AND a.type != 'view' + AND a.type not in ('view', 'consolidation') AND a.company_id = %s AND t.close_method = %s''', (company_id, 'unreconciled', )) account_ids = map(lambda x: x[0], cr.fetchall()) @@ -182,7 +182,7 @@ class account_fiscalyear_close(osv.osv_memory): FROM account_account a LEFT JOIN account_account_type t ON (a.user_type = t.id) WHERE a.active - AND a.type != 'view' + AND a.type not in ('view', 'consolidation') AND a.company_id = %s AND t.close_method = %s''', (company_id, 'detail', )) account_ids = map(lambda x: x[0], cr.fetchall()) @@ -211,7 +211,7 @@ class account_fiscalyear_close(osv.osv_memory): FROM account_account a LEFT JOIN account_account_type t ON (a.user_type = t.id) WHERE a.active - AND a.type != 'view' + AND a.type not in ('view', 'consolidation') AND a.company_id = %s AND t.close_method = %s''', (company_id, 'balance', )) account_ids = map(lambda x: x[0], cr.fetchall()) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index b4f02b6ed0c..ae2d0dcdcfb 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1041,7 +1041,8 @@ class account_voucher(osv.osv): 'period_id': voucher.period_id.id, 'partner_id': voucher.partner_id.id, 'currency_id': company_currency <> current_currency and current_currency or False, - 'amount_currency': company_currency <> current_currency and sign * voucher.amount or 0.0, + 'amount_currency': (sign * abs(voucher.amount) # amount < 0 for refunds + if company_currency != current_currency else 0.0), 'date': voucher.date, 'date_maturity': voucher.date_due } @@ -1203,7 +1204,7 @@ class account_voucher(osv.osv): if line.amount == line.amount_unreconciled: if not line.move_line_id: raise osv.except_osv(_('Wrong voucher line'),_("The invoice you are willing to pay is not valid anymore.")) - sign = voucher.type in ('payment', 'purchase') and -1 or 1 + sign = line.type =='dr' and -1 or 1 currency_rate_difference = sign * (line.move_line_id.amount_residual - amount) else: currency_rate_difference = 0.0 @@ -1261,8 +1262,7 @@ class account_voucher(osv.osv): # otherwise we use the rates of the system amount_currency = currency_obj.compute(cr, uid, company_currency, line.move_line_id.currency_id.id, move_line['debit']-move_line['credit'], context=ctx) if line.amount == line.amount_unreconciled: - sign = voucher.type in ('payment', 'purchase') and -1 or 1 - foreign_currency_diff = sign * line.move_line_id.amount_residual_currency + amount_currency + foreign_currency_diff = line.move_line_id.amount_residual_currency - abs(amount_currency) move_line['amount_currency'] = amount_currency voucher_line = move_line_obj.create(cr, uid, move_line) diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index 059989801d1..c9d229e554d 100644 --- a/addons/account_voucher/wizard/account_statement_from_invoice.py +++ b/addons/account_voucher/wizard/account_statement_from_invoice.py @@ -82,7 +82,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): if line.journal_id.type in ('sale', 'sale_refund'): type = 'customer' ttype = 'receipt' - elif line.journal_id.type in ('purchase', 'purhcase_refund'): + elif line.journal_id.type in ('purchase', 'purchase_refund'): type = 'supplier' ttype = 'payment' sign = -1 diff --git a/addons/l10n_be/account_financial_report.xml b/addons/l10n_be/account_financial_report.xml index ccc118d30ae..2abfce472f7 100644 --- a/addons/l10n_be/account_financial_report.xml +++ b/addons/l10n_be/account_financial_report.xml @@ -640,7 +640,7 @@ - Bénéfice (Perte) de l'excercice avant impôts + Bénéfice (Perte) de l'exercice avant impôts no_detail @@ -674,7 +674,7 @@ - Bénéfice (Perte) de l'excercice + Bénéfice (Perte) de l'exercice no_detail diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 5d3175b40d7..92023b742bb 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -50,10 +50,11 @@ diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index f600e20c03b..e13d4292b15 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -301,6 +301,9 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ self.do_clear_groups(); self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).done(function(records) { var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset); + if (!_.isEmpty(self.dataset.ids) && (self.dataset.index === null || self.dataset.index >= self.dataset.ids.length)) { + self.dataset.index = 0; + } self.do_add_groups([kgroup]).done(function() { if (_.isEmpty(records)) { self.no_result(); diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py index 78e0af7d6fe..76533b20777 100644 --- a/openerp/report/report_sxw.py +++ b/openerp/report/report_sxw.py @@ -267,7 +267,9 @@ class rml_parse(object): elif (hasattr(obj, '_field') and\ isinstance(obj._field, (float_field, function_field)) and\ obj._field.digits): - d = obj._field.digits[1] or DEFAULT_DIGITS + d = obj._field.digits[1] + if not d and d is not 0: + d = DEFAULT_DIGITS return d def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False):