[IMP] add category in sale order and copy category from opportunity to sale order when creating a quote from an opportunity

lp bug: https://launchpad.net/bugs/791151 fixed

bzr revid: jba@openerp.com-20110601102501-5ofq4jyb72u6lqo6
This commit is contained in:
Jacques-Etienne Baudoux 2011-06-01 12:25:01 +02:00
parent 26d85afab6
commit d8c9f67865
3 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,8 @@ class sale_order(osv.osv):
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
}
sale_order()

View File

@ -22,6 +22,7 @@
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="section_id" widget="selection" groups="base.group_extended"/>
<field name="categ_id" widget="selection" groups="base.group_extended"/>
</field>
</field>
</record>

View File

@ -91,6 +91,7 @@ class crm_make_sale(osv.osv_memory):
vals = {
'origin': _('Opportunity: %s') % str(case.id),
'section_id': case.section_id and case.section_id.id or False,
'categ_id': case.categ_id and case.categ_id.id or False,
'shop_id': make.shop_id.id,
'partner_id': partner.id,
'pricelist_id': pricelist,