diff --git a/sale_validity/__init__.py b/sale_validity/__init__.py new file mode 100644 index 00000000000..3114393460f --- /dev/null +++ b/sale_validity/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2013 Camptocamp SA +# +# 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 . +# +############################################################################## + +from . import model diff --git a/sale_validity/__openerp__.py b/sale_validity/__openerp__.py new file mode 100644 index 00000000000..b1dd847a03e --- /dev/null +++ b/sale_validity/__openerp__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Jacques-Etienne Baudoux +# Copyright 2013 Camptocamp SA +# +# 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 . +# +############################################################################## + +{"name": "Sales Quotation Validity Date", + "version": "7.0.0", + "depends": ["sale"], + "author": "Camptocamp", + "category": "Sales", + "website": "http://www.camptocamp.com", + "description": """ +Sale order validity date +======================== + +Add a validity date on the sales quotation defining +until when the quotation is valid + +""", + 'data': ["view/sale_order.xml"], + 'installable': True, + 'active': False, + } diff --git a/sale_validity/model/__init__.py b/sale_validity/model/__init__.py new file mode 100644 index 00000000000..b96785e5cec --- /dev/null +++ b/sale_validity/model/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2013 Camptocamp SA +# +# 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 . +# +############################################################################## + +from . import sale_order diff --git a/sale_validity/model/sale_order.py b/sale_validity/model/sale_order.py new file mode 100644 index 00000000000..81904abf4e1 --- /dev/null +++ b/sale_validity/model/sale_order.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright 2013 Camptocamp SA +# +# 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 . +# +############################################################################## +from osv import fields, osv + + +class sale_order(osv.osv): + _inherit = "sale.order" + + _columns = {'date_validity': fields.date("Valid Until", + help="Define date until when quotation is valid", + readonly=True, + states={ + 'draft': [('readonly', False)], + 'sent': [('readonly', True)], + }, + track_visibility='onchange')} diff --git a/sale_validity/view/sale_order.xml b/sale_validity/view/sale_order.xml new file mode 100644 index 00000000000..5c91927439b --- /dev/null +++ b/sale_validity/view/sale_order.xml @@ -0,0 +1,18 @@ + + + + + + sale.order.form.validity + sale.order + form + + + + + + + + + +