Purchase: Try to select destination address which has no partner on it

Bug #710516 reported by Mustufa Rangwala (Open ERP)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Fix Released
Low
Jay Vora (Serpent Consulting Services)
6.0
Fix Released
Low
Jay Vora (Serpent Consulting Services)
Trunk
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

Hello,

If i select Destination Address on Purchase order (Delivering and inovicing tab) which has no partner defined it gives error:
File "/home/mra/workspace/trunk-dev-addons3/purchase/purchase.py", line 260, in onchange_dest_address_id
    part_id = self.pool.get('res.partner.address').read(cr, uid, [adr_id], ['partner_id'])[0]['partner_id'][0]
TypeError: 'bool' object is unsubscriptable

Thanks,
mra

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
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 lp:~openerp-dev/openobject-addons/ksa-addons2/
Revision NO : 3942
Revision ID: <email address hidden>

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
summary: - [Trunk] purchase: Try to select partner address which has no partner on
- it
+ Purchase: Try to select partner address which has no partner on it
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote : Re: Purchase: Try to select partner address which has no partner on it

Hello Mustufa,

This is an excellent find, thanks a lot this real eye-opener.

@Kirti,@Rucha,
The bug is still reproducible when you create a new address from that M2O field.

http://bazaar.launchpad.net/~openerp-dev/openobject-addons/ksa-addons2/revision/3942 is not a complete solution.
Reason : Talking on functional aspect,we cannot really restrict the destination address to be the one other than Supplier's!

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

Fixes landed into : By revision
========================

Stable 5.0 : 2902 <email address hidden>
Stable 6.0 : 4400 <email address hidden>.

Thanks.

P.S. : The fix has replaced read() by browse(),because calling a read() with a many2one field causes an extra call to name_get() which can in turn cause to be time-consuming(Though in terms of milliseconds).

Kindly correct me if I missed anything.

summary: - Purchase: Try to select partner address which has no partner on it
+ Purchase: Try to select destination address which has no partner on it
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

Hello Jay,
You are right that the revision provided does not fix the problem,
the corrected revision is http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-dev-addons2/revision/3997
Reason: Talking on functional aspect, Its illogical to send purchased goods to a destination without any partner, however there may some probability to send the purchased goods to a destination without partner, but still it doesn't make sense.
think for the case when PO has Invoicing Control "From Picking", we won't be able to create Invoice from picking as partner is missing,
Correct me if I am wrong giving proper realtime case.
Changing read to browse is appreciated, Nice fix...
Thanks

Revision history for this message
Husen Daudi (husendaudi) wrote :

Hello Rucha,
In your case address without partner is useless but assume if Manual invoicing is defined then we don't need partner on picking. and that's why we have address field on stock picking and not partner field.

In real case scenario:

We got order from customer and they want us to directly supply good to their customers.
They will just provide address to deliver goods, in this case we have address without partner, they are not our customer but customer of customer. So we should give functionality to add delivery address without partner.

Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

I agree for this case, nice explanation :)
thanks

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

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

Thanks.

Revision history for this message
Nathan (nathan-bowden-kiwi) wrote :

I still using 5.0, and i am thanks for the fix.
anyway, https://bugs.launchpad.net/openobject-addons/+bug/710516/comments/4 is true here.my production doesnt need destination.
i have agreement of point on Rucha(openerp), having a address of partner is illogical. can you tell more?
where can i see the fixes?

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Nathan,

Your doubts will be sufficed when you go through all the comments here(#2,#3,#5).
You can see the fix over here : http://bazaar.launchpad.net/~openerp/openobject-addons/5.0/revision/2902 as mentioned already.

We can understand that your production system doesn't need this,but this doesn't make any move illogical until you have checked all possibilities to handle such a situation.OpenERP system tends to be generic and follows easy-to-use and easy-to-configure approach.

Thank you guys.

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.