From d909f763b8d6c57c23f71b14e66fbb3e8fe79044 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 6 Aug 2014 14:18:57 +0200 Subject: [PATCH 1/9] [FIX] mail: add tooltip to send a message and log a note links --- addons/mail/static/src/xml/mail.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index e718a42c813..1e52105c739 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -50,9 +50,10 @@ From 02f0caf1b8adf3a56931dc4e5feb0f9abc32e0df Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 6 Aug 2014 14:51:48 +0200 Subject: [PATCH 2/9] [FIX] account_voucher: validation of refund in multicurrency Fixing several issues for refunds in multicurrency mode that prevented the moves to be balanced. The amount_currency needs to use the absolute value, as a refund will have a negative amount. The sign for currency_rate_difference needs to use the line instead of the voucher as they can have different value. e.g. a voucher of 1000$ with invoice of 1200$ and refund of 200$ will have two lines and their currency_rate_difference should have different signs. Avoids doubling the value in foreign_currency_diff Fixes #1490, opw 607118 & 611580 --- addons/account_voucher/account_voucher.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index a7c7646f6e1..ce6a35adb32 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1055,7 +1055,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 } @@ -1217,7 +1218,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 @@ -1275,8 +1276,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) From 518649c371bf6a2ec528e4e5eb66dc266ba3b64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Thu, 17 Jul 2014 17:43:02 +0200 Subject: [PATCH 3/9] [FIX] l10n_be: spelling error in financial reports --- addons/l10n_be/account_financial_report.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 629e3709d019cb570cdae08e02dd5b416c526b5e Mon Sep 17 00:00:00 2001 From: Humberto Arocha Date: Thu, 10 Jul 2014 01:23:51 -0430 Subject: [PATCH 4/9] [FIX] Account: Consolidation Account should not be carried to next fiscalyear --- addons/account/wizard/account_fiscalyear_close.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 28ddf39cd7f..5b6881f6ae1 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()) From 5ca6b09375ce018e8e44e7e3cb5d0107c5a3a835 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 6 Aug 2014 19:00:01 +0200 Subject: [PATCH 5/9] [FIX] account: payment_ids should list payments of same account than the invoice account --- addons/account/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index afd0077bbc8..00d0b0d57a0 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -177,6 +177,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) From ed79bc203fdcbb4e7c3b6b6b68bd73ef0bb15bad Mon Sep 17 00:00:00 2001 From: fka-odoo Date: Wed, 23 Jul 2014 17:27:25 +0530 Subject: [PATCH 6/9] [FIX] account: child_of operator in invoice analysis report When displaying invoice analysis of a company, include the invoices of the members of this company (opw 611084) --- addons/account/report/account_invoice_report_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index dad70f695dc..93c80708253 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -61,7 +61,7 @@ - + From ea05a21938daad8eba97644264f8b8dcbf553178 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 7 Aug 2014 14:50:14 +0200 Subject: [PATCH 7/9] [FIX] report: allow using 0 decimal precision in rml reports --- openerp/report/report_sxw.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py index 493d0b6b37e..bde915b8919 100644 --- a/openerp/report/report_sxw.py +++ b/openerp/report/report_sxw.py @@ -265,7 +265,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): From b9c4bb6b6c4320880e21122ac2db8c2c519fcbc3 Mon Sep 17 00:00:00 2001 From: Somesh Khare Date: Thu, 7 Aug 2014 16:57:23 +0200 Subject: [PATCH 8/9] [FIX] account_voucher: fix typo in journal_id type --- addons/account_voucher/wizard/account_statement_from_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index 289a110fdbd..4644bdee62d 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 From a86dfb803592fd77e87b9aabc047781e25ba1daf Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 7 Aug 2014 18:04:13 +0200 Subject: [PATCH 9/9] [FIX] web_kanban: in non-grouped kanban, on switch to form, display first record in view_form.js, in do_show method, if the dataset index is not set, the on_button_new method is triggered, opening a new record In regular kanbans (non-grouped kanban), the dataset index wasn't set, and, therefore, when switching to the view mode, it opened a form for a new record instead of opening the first record of the list, like this is the case for the view list and the grouped kanban --- addons/web_kanban/static/src/js/kanban.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index de263d381d9..b7cc68fbb82 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -288,6 +288,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();