[IMP] sale_crm : add new field for section in sale order model

bzr revid: hmo@tinyerp.com-20091230133222-bk5sj7tonfywy2t0
This commit is contained in:
Harry (Open ERP) 2009-12-30 19:02:22 +05:30
parent 625e67df3b
commit 4d24786957
4 changed files with 52 additions and 2 deletions

View File

@ -20,5 +20,6 @@
##############################################################################
import wizard
import sale_crm
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# 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 osv,fields
class sale_order(osv.osv):
_inherit = 'sale.order'
_columns = {
'section_id': fields.many2one('crm.case.section', 'Section'),
}
sale_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,12 +8,28 @@
<field name="type">form</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<field name="user_id" position="after">
<button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
<field name="user_id" position="replace">
<label string="Responsible: " align="1.0"/>
<group colspan="1" col="2">
<field name="user_id" select="2" nolabel="1" string="Responsible"/>
<button string="Convert to Quote" icon="terp-sale" name="%(sale_crm_wizard)d" type="action"/>
</group>
</field>
</field>
</record>
<record model="ir.ui.view" id="sale_view_inherit123">
<field name="name">sale.order.inherit</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">
<xpath expr="/form/notebook/page[@string='Other data']/field[@name='company_id']" position="after">
<field name="section_id"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -96,6 +96,7 @@ class make_sale(wizard.interface):
vals = {
'origin': 'CRM:%s' % str(case.id),
'section_id': case.section_id and case.section_id.id or False,
'picking_policy': data['form']['picking_policy'],
'shop_id': data['form']['shop_id'],
'partner_id': partner_id,