[MERGE] from trunk
authorChristophe Matthieu <chm@openerp.com>
Fri, 24 May 2013 10:05:33 +0000 (12:05 +0200)
committerChristophe Matthieu <chm@openerp.com>
Fri, 24 May 2013 10:05:33 +0000 (12:05 +0200)
bzr revid: chm@openerp.com-20130522145042-3ril2zvogqs55ako
bzr revid: chm@openerp.com-20130524100533-fc0c7l47hb8j4xib

1  2 
addons/crm/crm_case_section_view.xml
addons/crm/crm_lead.py
addons/crm/crm_lead_view.xml
addons/sale_crm/sale_crm.py
addons/sale_crm/sale_crm_view.xml

Simple merge
Simple merge
Simple merge
@@@ -39,11 -31,12 +39,17 @@@ class sale_order(osv.osv)
              domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
      }
  
 +    def _make_invoice(self, cr, uid, order, lines, context=None):
 +        if order.section_id:
 +            context = dict(context or {}, default_section_id= order.section_id.id)
 +        return super(sale_order, self)._make_invoice(cr, uid, order, lines, context=context)
 +
+     def _prepare_invoice(self, cr, uid, order, lines, context=None):
+         invoice_vals = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context)
+         if order.section_id and order.section_id.id:
+             invoice_vals['section_id'] = order.section_id.id
+         return invoice_vals
  
  class crm_case_section(osv.osv):
      _inherit = 'crm.case.section'
Simple merge