1
# -*- encoding: utf-8 -*-
2
#################################################################################
4
# product_is_a_gift for OpenERP #
5
# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com> #
6
# Copyright (C) 2011 Camptocamp SA. (author Guewen Baconnier)
8
# This program is free software: you can redistribute it and/or modify #
9
# it under the terms of the GNU Affero General Public License as #
10
# published by the Free Software Foundation, either version 3 of the #
11
# License, or (at your option) any later version. #
13
# This program is distributed in the hope that it will be useful, #
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
# GNU Affero General Public License for more details. #
18
# You should have received a copy of the GNU Affero General Public License #
19
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
21
#################################################################################
23
from osv import osv, fields
26
class sale_order(osv.osv):
28
_inherit = "sale.order"
31
'gift_message': fields.text('Gift Message'),
34
def _prepare_order_picking(self, cr, uid, order, *args, **kwargs):
35
values = super(sale_order, self)._prepare_order_picking(cr, uid, order, *args, **kwargs)
36
values.update({'gift_message' : order.gift_message})
42
class sale_order_line(osv.osv):
44
_inherit = "sale.order.line"
47
'gift_message': fields.text('Gift Message'),
48
'need_gift_wrap': fields.boolean('Add Gift Wrap'),
51
def _prepare_order_line_move(self, cr, uid, order, line, picking_id, date_planned, *args, **kwargs):
52
values = super(sale_order_line, self)._prepare_order_line_move(cr, uid, order, line, picking_id, date_planned, *args, **kwargs)
53
values.update({'gift_message': line.gift_message,
54
'need_gift_wrap': line.need_gift_wrap})