diff --git a/addons/purchase_double_validation/__init__.py b/addons/purchase_double_validation/__init__.py new file mode 100644 index 00000000000..04c185f0e7a --- /dev/null +++ b/addons/purchase_double_validation/__init__.py @@ -0,0 +1,26 @@ +#!/usr/bin/python +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## +import wizard +import purchase_double_validation + + diff --git a/addons/purchase_double_validation/__terp__.py b/addons/purchase_double_validation/__terp__.py new file mode 100644 index 00000000000..442142980cb --- /dev/null +++ b/addons/purchase_double_validation/__terp__.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + "name" : "purchase_double_validation", + "version" : "1.1", + "category": "Generic Modules/ Purchases Double Validation ", + "depends" : ["base","purchase"], + "author" : "Tiny", + "description": """ + Subject,Date,Status + """, + 'author': 'Tiny', + 'website': 'http://www.openerp.com', + + 'init_xml': [], + 'update_xml': [ + 'purchase_double_validation_view.xml', + 'purchase_double_validation_workflow.xml', + 'wizard/purchase_double_validation_wizard_view.xml', ], + 'demo_xml': [], + 'installable': True, + 'active': False, + +} diff --git a/addons/purchase_double_validation/purchase_double_validation.py b/addons/purchase_double_validation/purchase_double_validation.py new file mode 100644 index 00000000000..919721ad415 --- /dev/null +++ b/addons/purchase_double_validation/purchase_double_validation.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## +import time +from osv import fields, osv + + +class purchase_double_validation(osv.osv): + _name = "purchase.double.validation" + _description = "purchase double validation" + + _columns = { + 'state': fields.selection([ + ('draft', 'Request for Quotation'), + ('wait', 'Waiting'), + ('confirmed', 'Waiting Supplier Ack'), + ('approved', 'Approved'), + ('validate', 'Validate'), + ('except_picking', 'Shipping Exception'), + ('except_invoice', 'Invoice Exception'), + ('done', 'Done'), + ('cancel', 'Cancelled') + ], 'State', readonly=True, select=True), + + } + + _defaults = { + 'state': lambda *args: 'draft', + } + + def action_validate(self, cr, uid, ids, context={}): + self.write(cr, uid, ids, {'state': 'validate'}) + return True + + def action_limit(self, cr, uid, ids, context=None): + amount_obj = self.pool.get('purchase.order').browse(cr, uid, uid, context) + amount = amount_obj.amount_total + +purchase_double_validation() + + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/purchase_double_validation/purchase_double_validation_view.xml b/addons/purchase_double_validation/purchase_double_validation_view.xml new file mode 100644 index 00000000000..fa37b8f3719 --- /dev/null +++ b/addons/purchase_double_validation/purchase_double_validation_view.xml @@ -0,0 +1,29 @@ + + + + + + purchase.order.form.inherit + purchase.order + + form + + + +