← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 601909] Re: make_to_order product policy not repsected in order import

 

** Changed in: magentoerpconnect
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/601909

Title:
  make_to_order product policy not repsected in order import

Status in Magento Open ERP Connector:
  New

Bug description:
  When importing orders order lines are always created with
  make_to_stock policy independently of the setting in the product.

  I modified some code in sale.py so that it retrieves the correct
  information.

  I am new to openerp and don't know well neither python nor coding
  standards in openerp so leave it to you to introduce into the branch
  if you think it's OK.

  sale.py line in def get_order_lines

                      if line_tax_vat > 0:
                          line_tax_ids = self.pool.get('account.tax').search(cr, uid, [('type_tax_use', '=', 'sale'), ('amount', '>='$
                          if line_tax_ids and len(line_tax_ids) > 0:
                              defaults_line['tax_id'] = [(6, 0, [line_tax_ids[0]])]
  # PB begin
                      line_to_add = self.oevals_from_extdata(cr, uid, external_referential_id, line_data, 'item_id', mapping_lines, defaults_line, context)
                      if  line_to_add['product_id']:
                           ol_product = self.pool.get('product.product').read(cr, uid, line_to_add['product_id'])
                           line_to_add['type'] = ol_product['procure_method']
                      lines_vals.append((0, 0, line_to_add))
  #PB end
                  res['order_line'] = lines_vals
          return res