diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 922e01963e5..9ce9b593f0f 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -824,7 +824,7 @@ class account_invoice(osv.osv): total_fixed += line.value_amount if line.value == 'procent': total_percent += line.value_amount - total_fixed = (total_fixed * 100) / inv.amount_total + total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0) if (total_fixed + total_percent) > 100: raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount.")) diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 2f793b77d67..4ab6201b507 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -79,9 +79,9 @@ class account_fiscalyear_close(osv.osv_memory): if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id: raise osv.except_osv(_('UserError'), _('The journal must have default credit and debit account')) - if not new_journal.centralisation: + if (not new_journal.centralisation) or new_journal.entry_posted: raise osv.except_osv(_('UserError'), - _('The journal must have centralised counterpart')) + _('The journal must have centralised counterpart without the Skipping draft state option checked!')) move_ids = obj_acc_move_line.search(cr, uid, [ ('journal_id', '=', new_journal.id), ('period_id.fiscalyear_id', '=', new_fyear.id)]) diff --git a/addons/account/wizard/account_validate_move_view.xml b/addons/account/wizard/account_validate_move_view.xml index 352d23d6b53..d4184dd9c8b 100644 --- a/addons/account/wizard/account_validate_move_view.xml +++ b/addons/account/wizard/account_validate_move_view.xml @@ -10,7 +10,7 @@
-