[purchase-stock] Wrong Partner used when invoicing from picking coming from a puchase with sent_to_address

Bug #690700 reported by hbto [Vauxoo] http://www.vauxoo.com
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2

Bug Description

How to replicate:

Let's create a new purchase order.
Select a supplier,
Create new purchase lines.

In the tab regarding invoice/picking, select that you want to send the products to the clients directly instead of you, so you select a _customer_ partner address,

Select that you want _invoice_from_picking_,

Approve as many times as it is needed.

Go to incoming pickings,

Let's say that all the product received are the ones in your P.O. (no difference)
Approve the picking

Then select in the right side bar the action create invoice,
Select Purchase Invoice, and proceed,

The draft purchase invoice create is associated to the customer partner (wrong) not to the supplier partner,
the picking is already related to the P.O. so the partner that should be related to the newly created invoice could come from it.
an not from the partner_address field filled in the picking, as long as there is P.O. (or S.O regarding to sale orders & sale invoices)

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,
it has been fixed in branch lp:~openerp-dev/openobject-addons/ksa-addons2
Revision NO - 3902
Revision ID: <email address hidden>

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

Hello ksa,
what about when invoice from picking coming from a sale order
this was your change

872 partner = picking.purchase_id.partner_id

my suggestion:
partner = picking.purchase_id and picking.purchase_id.partner_id or picking.sale_id and picking.sale_id.partner_id

Thanks in advance

Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

stock/stock.py

741 partner = picking.address_id and picking.address_id.partner_id

should be changed too into

partner = picking.purchase_id and picking.purchase_id.partner_id or picking.sale_id and picking.sale_id.partner_id

Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,
it has been fixed in branch lp:~openerp-dev/openobject-addons/ksa-addons2
Revision NO - 3905
Thanks for Reporting.

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

Hello, Guys,

Where did this get fixed, I can't find it in this code though I can see it in ksa code,

https://code.launchpad.net/~openerp/openobject-addons/5.0,

Thanks in advance.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.