1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2014 TeMPO Consulting, MSF
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Affero General Public License as
9
# published by the Free Software Foundation, either version 3 of the
10
# License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Affero General Public License for more details.
17
# You should have received a copy of the GNU Affero General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
##############################################################################
22
from osv import fields
28
class sale_order(osv.osv):
30
Override the sale.order object to add some feature
31
of the Order Sourcing Tool
34
_inherit = 'sale.order'
37
'sourcing_trace_ok': fields.boolean(
38
string='Display sourcing logs',
40
'sourcing_trace': fields.text(
41
string='Sourcing logs',
47
def do_order_confirm_method(self, cr, uid, ids, context=None):
54
if isinstance(ids, (int, long)):
58
wf_service = netsvc.LocalService("workflow")
59
sol_obj = self.pool.get('sale.order.line')
61
sol_ids = sol_obj.search(cr, uid, [('order_id', 'in', ids)], context=context)
62
sol_obj.write(cr, uid, sol_ids, {'state': 'sourced'}, context=context)
65
wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
71
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: