Skip to content

Commit

Permalink
[ADD] sale_validity : Adds a validity date on the sales quotation def…
Browse files Browse the repository at this point in the history
…ining until when the quotation is valid
  • Loading branch information
jbaudoux authored and gurneyalex committed Nov 27, 2013
2 parents e0e69ef + 7b6247d commit 0083e4b
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sale_validity/__init__.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################

from . import model
39 changes: 39 additions & 0 deletions sale_validity/__openerp__.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################

{"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,
}
21 changes: 21 additions & 0 deletions sale_validity/model/__init__.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################

from . import sale_order
33 changes: 33 additions & 0 deletions sale_validity/model/sale_order.py
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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')}
18 changes: 18 additions & 0 deletions sale_validity/view/sale_order.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<openerp>
<data>

<record id="view_order_form_validity" model="ir.ui.view">
<field name="name">sale.order.form.validity</field>
<field name="model">sale.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="date_order" position="after">
<field name="date_validity"/>
</field>
</field>
</record>

</data>
</openerp>

0 comments on commit 0083e4b

Please sign in to comment.