Kaynağa Gözat

commit inicial

Rodney Enciso Arias 8 yıl önce
işleme
4a3395a0b7
22 değiştirilmiş dosya ile 563 ekleme ve 0 silme
  1. 57 0
      README.rst
  2. 5 0
      __init__.py
  3. BIN
      __init__.pyc
  4. 40 0
      __openerp__.py
  5. 35 0
      i18n/de.po
  6. 33 0
      i18n/es.po
  7. 34 0
      i18n/es_ES.po
  8. 34 0
      i18n/fi.po
  9. 34 0
      i18n/fr.po
  10. 34 0
      i18n/hr.po
  11. 35 0
      i18n/it.po
  12. 34 0
      i18n/nl.po
  13. 33 0
      i18n/sale_order_back2draft.pot
  14. 34 0
      i18n/sl.po
  15. 34 0
      i18n/tr.po
  16. 34 0
      i18n/zh_CN.po
  17. 5 0
      models/__init__.py
  18. BIN
      models/__init__.pyc
  19. 27 0
      models/sale_order.py
  20. BIN
      models/sale_order.pyc
  21. BIN
      static/description/icon.png
  22. 21 0
      views/sale_order_view.xml

+ 57 - 0
README.rst

@@ -0,0 +1,57 @@
+Get back sales orders to draft
+==============================
+
+Allows to get back to draft any cancelled sale order.
+
+Installation
+============
+
+Nothing special is needed to install this module.
+
+Configuration
+=============
+
+Nothing special is needed to configure this module.
+
+Usage
+=====
+
+When you cancel a sale order, you will see a new button call *Back to draft*,
+that resets the sale order to draft state.
+
+Known issues / Roadmap
+======================
+
+None known.
+
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
+`here <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_back2draft%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
+
+
+Credits
+=======
+
+Contributors
+------------
+* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
+* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
+
+
+Maintainer
+----------
+
+.. image:: http://odoo-community.org/logo.png
+   :alt: Odoo Community Association
+   :target: http://odoo-community.org
+
+This module is maintained by the OCA.
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
+
+To contribute to this module, please visit http://odoo-community.org.

+ 5 - 0
__init__.py

@@ -0,0 +1,5 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in root directory
+##############################################################################
+from . import models

BIN
__init__.pyc


+ 40 - 0
__openerp__.py

@@ -0,0 +1,40 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (c) 2014-2015 Serv. Tecnol. Av. (http://www.serviciosbaeza.com)
+#                       Pedro M. Baeza Romero <pedro.baeza@serviciosbaeza.com>
+#
+#    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": "Back to draft on sales orders",
+    "version": "8.0.1.0.0",
+    "category": "Sales Management",
+    "author": "Serv. Tecnol. Avanzados - Pedro M. Baeza",
+    "website": "http://www.serviciosbaeza.com",
+    "contributors": [
+        "Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
+        "Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
+    ],
+    "depends": [
+        "sale",
+    ],
+    "data": [
+        "views/sale_order_view.xml",
+    ],
+    "installable": True,
+}

+ 35 - 0
i18n/de.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+# Rudolf Schnapka <rs@techno-flex.de>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-10-08 20:48+0000\n"
+"PO-Revision-Date: 2015-10-09 13:46+0000\n"
+"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
+"Language-Team: German (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/de/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr "Zurück zu Entwurf"
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Verkaufsauftrag"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr "Sie können Aufträge nicht zurückstufen, wenn Sie nicht storniert sind. Auftrag: %s"

+ 33 - 0
i18n/es.po

@@ -0,0 +1,33 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+#	* sale_order_back2draft
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-02-04 14:00+0000\n"
+"PO-Revision-Date: 2015-02-04 14:00+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: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr "Volver a borrador"
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Pedido de venta"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr "No puede volver ningún pedido que no esté en estado cancelado. Pedido: %s"
+

+ 34 - 0
i18n/es_ES.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-10-04 13:41+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Spanish (Spain) (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/es_ES/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es_ES\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Pedido de venta"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 34 - 0
i18n/fi.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-09 12:27+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Finnish (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/fi/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fi\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Myyntitilaus"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 34 - 0
i18n/fr.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-09 12:27+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: French (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/fr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Bon de commande"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 34 - 0
i18n/hr.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-22 23:35+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Croatian (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/hr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: hr\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Prodajni nalog"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 35 - 0
i18n/it.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+# Paolo Valier, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-04-29 00:55+0000\n"
+"PO-Revision-Date: 2016-04-27 19:59+0000\n"
+"Last-Translator: Paolo Valier\n"
+"Language-Team: Italian (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/it/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: it\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr "Reimposta a bozza"
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Ordini vendita"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 34 - 0
i18n/nl.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-10-23 08:14+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Dutch (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/nl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: nl\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Verkooporder"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 33 - 0
i18n/sale_order_back2draft.pot

@@ -0,0 +1,33 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+#	* sale_order_back2draft
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-02-04 13:58+0000\n"
+"PO-Revision-Date: 2015-02-04 13:58+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: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""
+

+ 34 - 0
i18n/sl.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# 	* sale_order_back2draft
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-02-04 13:58+0000\n"
+"PO-Revision-Date: 2015-08-16 07:48+0200\n"
+"Last-Translator: Matjaz Mozetic <m.mozetic@matmoz.si>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"Language: sl\n"
+"X-Generator: Poedit 1.8.4\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr "Povrni v osnutek"
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Prodajni nalog"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr "Ne morete povrniti nobenega naloga, ki ni v stanju preklicano. Nalog: %s"

+ 34 - 0
i18n/tr.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-12-05 23:35+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Turkish (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/tr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: tr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "Sipariş Emri"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 34 - 0
i18n/zh_CN.po

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * sale_order_back2draft
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: sale-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-09-09 12:27+0000\n"
+"PO-Revision-Date: 2015-09-03 07:09+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-sale-workflow-8-0/language/zh_CN/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: zh_CN\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: sale_order_back2draft
+#: view:sale.order:sale_order_back2draft.view_order_form_draft
+msgid "Back to draft"
+msgstr ""
+
+#. module: sale_order_back2draft
+#: model:ir.model,name:sale_order_back2draft.model_sale_order
+msgid "Sales Order"
+msgstr "销售订单"
+
+#. module: sale_order_back2draft
+#: code:addons/sale_order_back2draft/models/sale_order.py:18
+#, python-format
+msgid "You can't back any order that it's not on cancel state. Order: %s"
+msgstr ""

+ 5 - 0
models/__init__.py

@@ -0,0 +1,5 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in root directory
+##############################################################################
+from . import sale_order

BIN
models/__init__.pyc


+ 27 - 0
models/sale_order.py

@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in root directory
+##############################################################################
+
+from openerp import models, api, exceptions, _
+
+
+class SaleOrder(models.Model):
+    _inherit = "sale.order"
+
+    @api.multi
+    def button_draft(self):
+        # go from canceled state to draft state
+        for order in self:
+            if order.state != 'cancel':
+                raise exceptions.Warning(
+                    _("You can't back any order that it's not on cancel "
+                      "state. Order: %s" % order.name))
+            order.order_line.write({'state': 'draft'})
+            order.procurement_group_id.sudo().unlink()
+            for line in order.order_line:
+                line.procurement_ids.sudo().unlink()
+            order.write({'state': 'draft'})
+            order.delete_workflow()
+            order.create_workflow()
+        return True

BIN
models/sale_order.pyc


BIN
static/description/icon.png


+ 21 - 0
views/sale_order_view.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+        <record id="view_order_form_draft" model="ir.ui.view">
+            <field name="name">sale.order.form.draft</field>
+            <field name="model">sale.order</field>
+            <field name="inherit_id" ref="sale.view_order_form"/>
+            <field name="arch" type="xml">
+                <field name="state" position="before">
+                    <button name="button_draft"
+                            states="cancel"
+                            string="Back to draft"
+                            type="object"
+                            groups="base.group_user"/>
+                </field>
+            </field>
+        </record>
+
+    </data>
+</openerp>