Browse Source

commit inicial

Rodney Enciso Arias 8 years ago
commit
47caa0d9d2
9 changed files with 219 additions and 0 deletions
  1. 10 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 52 0
      __openerp__.py
  4. 13 0
      account_invoice.py
  5. BIN
      account_invoice.pyc
  6. 36 0
      account_invoice_view.xml
  7. 32 0
      i18n/account_clean_cancelled_invoice_number.pot
  8. 38 0
      i18n/en.po
  9. 38 0
      i18n/es.po

+ 10 - 0
__init__.py

@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+
+
+from . import account_invoice
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

BIN
__init__.pyc


+ 52 - 0
__openerp__.py

@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2015  ADHOC SA  (http://www.adhoc.com.ar)
+#    All Rights Reserved.
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+    'name': 'Clean Cancelled Invoice Number',
+    'version': '8.0.1.0.0',
+    'category': 'Accounting',
+    'sequence': 14,
+    'summary': 'Invoicing, Number, Cancelled',
+    'description': """
+Clean Cancelled Invoice Number
+========================
+Adds a button on invoice to allow clean number to cancelled invoices in order to:
+* Regenerate the invoice number with new sequence number
+* Delete the invoice
+    """,
+    'author':  'ADHOC SA',
+    'website': 'www.adhoc.com.ar',
+    'images': [
+    ],
+    'depends': [
+        'account_cancel'
+    ],
+    'data': [
+        'account_invoice_view.xml',
+    ],
+    'demo': [
+    ],
+    'test': [
+    ],
+    'installable': True,
+    'auto_install': False,
+    'application': False,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 13 - 0
account_invoice.py

@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+from openerp.osv import osv
+
+class invoice(osv.osv):
+    _inherit = 'account.invoice'
+
+    def clean_internal_number(self, cr, uid, ids, context=None):
+        # We also clean reference for compatibility with argentinian localization
+        self.write(cr, uid, ids, {'internal_number':False,'afip_document_number':False}, context=context)

BIN
account_invoice.pyc


+ 36 - 0
account_invoice_view.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <!-- Invoices -->
+
+        <record id="invoice_form" model="ir.ui.view">
+            <field name="name">account.invoice.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form"/>
+            <field name="arch" type="xml">
+                <form>
+                    <field name="internal_number" invisible="1"/>
+                </form>
+                <button name="invoice_cancel" position="after">
+                    <button name="clean_internal_number" string="Clean Internal Number"  attrs="{'invisible':['|',('state','!=','cancel'),('internal_number','=',False)]}" type="object" help="Cleaning the invoice internal number will allow you to delete this invoice or to get a new number if you re-validate it. If this invoice represents a voided invoice, then you should not clean it." groups="account.group_account_manager"/>
+                </button>                
+            </field>
+        </record>
+
+        <record id="invoice_supplier_form" model="ir.ui.view">
+            <field name="name">account.invoice.form</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_supplier_form"/>
+            <field name="arch" type="xml">
+                <form>
+                    <field name="internal_number" invisible="1"/>
+                </form>                
+                <button name="invoice_cancel" position="after">
+                    <button name="clean_internal_number" string="Clean Internal Number"  attrs="{'invisible':['|',('state','!=','cancel'),('internal_number','=',False)]}" type="object" help="Cleaning the invoice internal number will allow you to delete this invoice or to get a new number if you re-validate it. If this invoice represents a voided invoice, then you should not clean it." groups="account.group_account_manager"/>
+                </button>                
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 32 - 0
i18n/account_clean_cancelled_invoice_number.pot

@@ -0,0 +1,32 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#	* account_clean_cancelled_invoice_number
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 8.0alpha1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-06-03 20:14+0000\n"
+"PO-Revision-Date: 2014-06-03 20:14+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_clean_cancelled_invoice_number
+#: view:account.invoice:0
+msgid "Clean Internal Number"
+msgstr ""
+
+#. module: account_clean_cancelled_invoice_number
+#: view:account.invoice:0
+msgid "Cleaning the invoice internal number will allow you to delete this invoice or to get a new number if you re-validate it. If this invoice represents a voided invoice, then you should not clean it."
+msgstr ""
+
+#. module: account_clean_cancelled_invoice_number
+#: model:ir.model,name:account_clean_cancelled_invoice_number.model_account_invoice
+msgid "Invoice"
+msgstr ""
+

+ 38 - 0
i18n/en.po

@@ -0,0 +1,38 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_clean_cancelled_invoice_number
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: odoo-addons (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-09 23:57+0000\n"
+"PO-Revision-Date: 2015-09-01 18:07+0000\n"
+"Last-Translator: Juan Jose Scarafia <scarafia.juanjose@gmail.com>\n"
+"Language-Team: English (http://www.transifex.com/adhoc/ingadhoc-odoo-addons-8-0/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: account_clean_cancelled_invoice_number
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_form
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_supplier_form
+msgid "Clean Internal Number"
+msgstr "Clean Internal Number"
+
+#. module: account_clean_cancelled_invoice_number
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_form
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_supplier_form
+msgid ""
+"Cleaning the invoice internal number will allow you to delete this invoice "
+"or to get a new number if you re-validate it. If this invoice represents a "
+"voided invoice, then you should not clean it."
+msgstr "Cleaning the invoice internal number will allow you to delete this invoice or to get a new number if you re-validate it. If this invoice represents a voided invoice, then you should not clean it."
+
+#. module: account_clean_cancelled_invoice_number
+#: model:ir.model,name:account_clean_cancelled_invoice_number.model_account_invoice
+msgid "Invoice"
+msgstr "Invoice"

+ 38 - 0
i18n/es.po

@@ -0,0 +1,38 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_clean_cancelled_invoice_number
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: odoo-addons (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-09 23:57+0000\n"
+"PO-Revision-Date: 2015-09-01 18:07+0000\n"
+"Last-Translator: Juan Jose Scarafia <scarafia.juanjose@gmail.com>\n"
+"Language-Team: Spanish (http://www.transifex.com/adhoc/ingadhoc-odoo-addons-8-0/language/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: account_clean_cancelled_invoice_number
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_form
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_supplier_form
+msgid "Clean Internal Number"
+msgstr "Limpiar Número Interno"
+
+#. module: account_clean_cancelled_invoice_number
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_form
+#: view:account.invoice:account_clean_cancelled_invoice_number.invoice_supplier_form
+msgid ""
+"Cleaning the invoice internal number will allow you to delete this invoice "
+"or to get a new number if you re-validate it. If this invoice represents a "
+"voided invoice, then you should not clean it."
+msgstr "Limpiar el número interno de la factura le va a permitir borrar esta factura o obtener un nuevo número si la misma es re-validada. Si esta factura representa una factura anulada entonces no debería limpiarlo."
+
+#. module: account_clean_cancelled_invoice_number
+#: model:ir.model,name:account_clean_cancelled_invoice_number.model_account_invoice
+msgid "Invoice"
+msgstr "Factura"