diff --git a/addons/purchase_double_validation/__init__.py b/addons/purchase_double_validation/__init__.py deleted file mode 100644 index 29f360fdb00..00000000000 --- a/addons/purchase_double_validation/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -import purchase_double_validation_installer diff --git a/addons/purchase_double_validation/__openerp__.py b/addons/purchase_double_validation/__openerp__.py deleted file mode 100644 index 55555d73207..00000000000 --- a/addons/purchase_double_validation/__openerp__.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -{ - 'name' : 'Double Validation on Purchases', - 'version' : '1.1', - 'category': 'Purchase Management', - 'depends' : ['base','purchase'], - 'description': """ -Double-validation for purchases exceeding minimum amount. -========================================================= - -This module modifies the purchase workflow in order to validate purchases that -exceeds minimum amount set by configuration wizard. - """, - 'website': 'https://www.odoo.com/page/purchase', - 'data': [ - 'purchase_double_validation_workflow.xml', - 'purchase_double_validation_installer.xml', - 'purchase_double_validation_view.xml', - ], - 'test': [ - 'test/purchase_double_validation_demo.yml', - 'test/purchase_double_validation_test.yml' - ], - 'demo': [], - 'installable': True, - 'auto_install': False -} diff --git a/addons/purchase_double_validation/i18n/purchase_double_validation.pot b/addons/purchase_double_validation/i18n/purchase_double_validation.pot deleted file mode 100644 index 7c1489d175b..00000000000 --- a/addons/purchase_double_validation/i18n/purchase_double_validation.pot +++ /dev/null @@ -1,42 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * purchase_double_validation -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 9.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-25 09:00+0000\n" -"PO-Revision-Date: 2015-08-25 09: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: purchase_double_validation -#: model:ir.model.fields,help:purchase_double_validation.field_purchase_config_settings_limit_amount -msgid "Amount after which validation of purchase is required." -msgstr "" - -#. module: purchase_double_validation -#: model:ir.ui.view,arch_db:purchase_double_validation.purchase_order_search_inherit -msgid "Purchase orders which are not approved yet." -msgstr "" - -#. module: purchase_double_validation -#: model:ir.ui.view,arch_db:purchase_double_validation.purchase_order_search_inherit -msgid "To Approve" -msgstr "" - -#. module: purchase_double_validation -#: model:ir.model.fields,field_description:purchase_double_validation.field_purchase_config_settings_limit_amount -msgid "limit to require a second approval" -msgstr "" - -#. module: purchase_double_validation -#: model:ir.model,name:purchase_double_validation.model_purchase_config_settings -msgid "purchase.config.settings" -msgstr "" - diff --git a/addons/purchase_double_validation/purchase_double_validation_installer.py b/addons/purchase_double_validation/purchase_double_validation_installer.py deleted file mode 100644 index c2a1d2f026a..00000000000 --- a/addons/purchase_double_validation/purchase_double_validation_installer.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from openerp.osv import fields, osv - -class purchase_config_settings(osv.osv_memory): - _inherit = 'purchase.config.settings' - _columns = { - 'limit_amount': fields.integer('limit to require a second approval',required=True, - help="Amount after which validation of purchase is required."), - } - - _defaults = { - 'limit_amount': 5000, - } - - def get_default_limit_amount(self, cr, uid, fields, context=None): - ir_model_data = self.pool.get('ir.model.data') - transition = ir_model_data.get_object(cr, uid, 'purchase_double_validation', 'trans_confirmed_double_lt') - field, value = transition.condition.split('<', 1) - return {'limit_amount': int(value)} - - def set_limit_amount(self, cr, uid, ids, context=None): - ir_model_data = self.pool.get('ir.model.data') - config = self.browse(cr, uid, ids[0], context) - waiting = ir_model_data.get_object(cr, uid, 'purchase_double_validation', 'trans_confirmed_double_gt') - waiting.write({'condition': 'amount_total >= %s' % config.limit_amount}) - confirm = ir_model_data.get_object(cr, uid, 'purchase_double_validation', 'trans_confirmed_double_lt') - confirm.write({'condition': 'amount_total < %s' % config.limit_amount}) diff --git a/addons/purchase_double_validation/purchase_double_validation_installer.xml b/addons/purchase_double_validation/purchase_double_validation_installer.xml deleted file mode 100644 index 6a43000a7ff..00000000000 --- a/addons/purchase_double_validation/purchase_double_validation_installer.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Purchase Application - purchase.config.settings - - - - - - - - diff --git a/addons/purchase_double_validation/purchase_double_validation_view.xml b/addons/purchase_double_validation/purchase_double_validation_view.xml deleted file mode 100644 index 84d7331380a..00000000000 --- a/addons/purchase_double_validation/purchase_double_validation_view.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - purchase.order.list.select.inherit - purchase.order - - - - - - - - - diff --git a/addons/purchase_double_validation/purchase_double_validation_workflow.xml b/addons/purchase_double_validation/purchase_double_validation_workflow.xml deleted file mode 100644 index 673063ff049..00000000000 --- a/addons/purchase_double_validation/purchase_double_validation_workflow.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - WaitForApproval - dummy - - - - - CheckForApproval - OR - dummy - - - - - - - - - - - amount_untaxed >= 5000 - purchase_approve - - - - - - - amount_untaxed < 5000 - - - - - - - - - diff --git a/addons/purchase_double_validation/test/purchase_double_validation_demo.yml b/addons/purchase_double_validation/test/purchase_double_validation_demo.yml deleted file mode 100644 index 05171f9be69..00000000000 --- a/addons/purchase_double_validation/test/purchase_double_validation_demo.yml +++ /dev/null @@ -1,15 +0,0 @@ -- - !record {model: purchase.order, id: purchase_order_11}: - partner_id: base.res_partner_12 - order_line: - - product_id: product.product_product_6 - product_qty: 10 - price_unit: 400 -- - !record {model: purchase.order, id: purchase_order_12}: - partner_id: base.res_partner_1 - order_line: - - product_id: product.product_product_12 - product_qty: 10 - price_unit: 200 - diff --git a/addons/purchase_double_validation/test/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/purchase_double_validation_test.yml deleted file mode 100644 index fb18db6d990..00000000000 --- a/addons/purchase_double_validation/test/purchase_double_validation_test.yml +++ /dev/null @@ -1,36 +0,0 @@ -- - I set new limit amount from Configure Limit Amount for Purchase . -- - !record {model: purchase.config.settings, id: purchase_double_validation_installer_1}: - limit_amount: 3000 -- - !python {model: purchase.config.settings}: | - self.execute(cr, uid, [ref("purchase_double_validation_installer_1")]) -- - In order to test the flow, I confirmed the purchase order. -- - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_11} -- - I check that the order which was initially in the draft state has transmit to confirm state for double validation it should not an Approve state. -- - !assert {model: purchase.order, id: purchase_order_11, severity: error, string: Purchase Order should not be in Approved state.}: - - state != 'approved' -- - I Approved the purchase order. -- - !workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_11} -- - I check that the order which was initially in the confirmed state has transmit to approved state. -- - !assert {model: purchase.order, id: purchase_order_11, severity: error, string: Purchase Order should be in Approved state.}: - - state == 'approved' -- - I confirmed the purchase order of amount of less than Limit amount. -- - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_12} -- - I check that the order is in approved state. -- - !assert {model: purchase.order, id: purchase_order_12, severity: error, string: Purchase Order should be in Approved state.}: - - state == 'approved' -