diff --git a/addons/account/i18n/pl.po b/addons/account/i18n/pl.po index 48b88ee171d..95a498d8632 100644 --- a/addons/account/i18n/pl.po +++ b/addons/account/i18n/pl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-05-02 10:11+0000\n" +"PO-Revision-Date: 2010-05-05 14:54+0000\n" "Last-Translator: Grzegorz Grzelak (Cirrus.pl) \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-05-05 03:48+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -1596,7 +1596,7 @@ msgstr "" #: selection:account.tax,tax_group:0 #: selection:account.tax.template,tax_group:0 msgid "VAT" -msgstr "NIP" +msgstr "VAT" #. module: account #: rml:account.analytic.account.journal:0 diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index 12e1bb3bf30..020de45656d 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.6\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-05-03 05:57+0000\n" -"Last-Translator: KenSai \n" +"PO-Revision-Date: 2010-05-06 01:44+0000\n" +"Last-Translator: digitalsatori \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-05-05 03:48+0000\n" +"X-Launchpad-Export-Date: 2010-05-06 04:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -40,7 +40,7 @@ msgstr "凭证录入" #. module: account #: model:ir.actions.todo,note:account.config_wizard_account_base_setup_form msgid "Specify The Message for the Overdue Payment Report." -msgstr "设定这逾期应付款表单的消息" +msgstr "设置过期支付的催款信息" #. module: account #: model:process.transition,name:account.process_transition_confirmstatementfromdraft0 @@ -115,7 +115,7 @@ msgstr "上级科目" #. module: account #: selection:account.move,type:0 msgid "Journal Voucher" -msgstr "原始凭证分类帐" +msgstr "日记账凭证" #. module: account #: field:account.invoice,residual:0 diff --git a/addons/account/wizard/account_invoice_state.py b/addons/account/wizard/account_invoice_state.py index 6b1a41f49af..c3934e38db0 100644 --- a/addons/account/wizard/account_invoice_state.py +++ b/addons/account/wizard/account_invoice_state.py @@ -21,6 +21,7 @@ from osv import fields, osv from tools.translate import _ import netsvc +import pooler class account_invoice_confirm(osv.osv_memory): """ @@ -34,7 +35,12 @@ class account_invoice_confirm(osv.osv_memory): wf_service = netsvc.LocalService('workflow') if context is None: context = {} - for id in context['active_ids']: + pool_obj = pooler.get_pool(cr.dbname) + data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) + + for record in data_inv: + if record['state'] not in ('draft','proforma','proforma2'): + raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state!")) wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_open', cr) return {} @@ -47,14 +53,19 @@ class account_invoice_cancel(osv.osv_memory): """ _name = "account.invoice.cancel" - _description = "Cancel the selected invoices" + _description = "Cancel the Selected Invoices" def invoice_cancel(self, cr, uid, ids, context=None): - wf_service = netsvc.LocalService('workflow') if context is None: context = {} - for id in context['active_ids']: - wf_service.trg_validate(uid, 'account.invoice', id, 'invoice_cancel', cr) + wf_service = netsvc.LocalService('workflow') + pool_obj = pooler.get_pool(cr.dbname) + data_inv = pool_obj.get('account.invoice').read(cr, uid, context['active_ids'], ['state'], context=context) + + for record in data_inv: + if record['state'] in ('cancel','paid'): + raise osv.except_osv(_('Warning'), _("Selected Invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state!")) + wf_service.trg_validate(uid, 'account.invoice', record['id'], 'invoice_cancel', cr) return {} account_invoice_cancel() diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml index 8748edbb688..d83c0c6f2dc 100644 --- a/addons/account/wizard/account_invoice_state_view.xml +++ b/addons/account/wizard/account_invoice_state_view.xml @@ -6,10 +6,10 @@ account.invoice.confirm form -
- + + -