← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 808567] Re: stock.py: Improvement in code when selecting account partner

 

Hello Jonathan,

I have checked this issue at my end and also checked your patch.

But I didn't faced any problem in our code it is working fine in all
scenario.

I didn't understand Where did you face the problem in our code and why
you need to change it?

So would you please provide the example where you have faced the problem
and also provide the more information on it.

Thanks and waiting for your reply!

** Changed in: openobject-addons
       Status: New => Incomplete

-- 
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/808567

Title:
  stock.py: Improvement in code when selecting account partner

Status in OpenERP Modules (addons):
  Incomplete

Bug description:
  The selection of the account partner in stock.py, whilst correct
  within the current OpenERP model, is not "strictly" correct as it
  assumes the delivery address partner is the account partner. We
  propose the following simple change which corrects this issue as we
  needed to make this change whilst implementing a franchise sub-partner
  payment model. Diff below:

  === modified file 'stock/stock.py'
  --- stock/stock.py	2011-06-01 21:07:58 +0000
  +++ stock/stock.py	2011-07-11 00:43:43 +0000
  @@ -979,6 +979,10 @@
                   continue
               payment_term_id = False
               partner =  picking.address_id and picking.address_id.partner_id
  +
  +            if picking.sale_id:
  +                partner = picking.sale_id.partner_id
  +
               if not partner:
                   raise osv.except_osv(_('Error, no partner !'),
                       _('Please put a partner on the picking list if you want to generate invoice.'))
  @@ -1009,12 +1013,13 @@
                   }
                   invoice_obj.write(cr, uid, [invoice_id], invoice_vals, context=context)
               else:
  +
                   invoice_vals = {
                       'name': picking.name,
                       'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
                       'type': inv_type,
                       'account_id': account_id,
  -                    'partner_id': address.partner_id.id,
  +                    'partner_id': partner.id,
                       'address_invoice_id': address_invoice_id,
                       'address_contact_id': address_contact_id,
                       'comment': comment,

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/808567/+subscriptions


References