Piotr,

thanks for reporting, I applied a similar patch (I actually found the solution 
to a duplicate bug by Kyle Waid before remembering this bug and reading your 
patch, it does happen).
Anyway should be fixed. One could always find a better system where MTO/MTS 
could be overriden by some custom mapping from Magento order lines, but at the 
moment it just takes the setting of the product which should be good enough for 
most use cases.

** Changed in: magentoerpconnect
       Status: New => Fix Released

-- 
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:
  Fix Released

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

_______________________________________________
Mailing list: https://launchpad.net/~c2c-oerpscenario
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~c2c-oerpscenario
More help   : https://help.launchpad.net/ListHelp

Reply via email to