← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 692891] Re: Can delete a pricelist still linked to a partner

 

Tested this fix release.

I followed exactly how I had replicated it before.

I then looked at the customer and it had no default price-list specified
(as now expected with this bug fix).

However, without modifying anything on the customer form (leaving the
default price-list as blank), I then went to create a new sales order
for the customer.

When entering the customer for a new sales order, the following error
occurs:

Environment Information : 
System : Linux-2.6.32-26-generic-i686-with-Ubuntu-10.04-lucid
OS Name : posix
Distributor ID:	Ubuntu
Description:	Ubuntu 10.04.1 LTS
Release:	10.04
Codename:	lucid
Operating System Release : 2.6.32-26-generic
Operating System Version : #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010
Operating System Architecture : 32bit
Operating System Locale : en_AU.UTF8
Python Version : 2.6.5
OpenERP-Client Version : 6.0.0-rc1-1
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/home/openerp/openerp/openerp-server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/openerp/openerp/openerp-server/bin/service/web_services.py", line 598, in dispatch
    res = fn(db, uid, *params)
  File "/home/openerp/openerp/openerp-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/openerp/openerp/openerp-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/openerp/openerp/openerp-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/openerp/openerp/addons/product/pricelist.py", line 112, in name_get
    name = pl.name + ' ('+ pl.currency_id.name + ')'
  File "/home/openerp/openerp/openerp-server/bin/osv/orm.py", line 287, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field name not found in browse_record(product.pricelist, 2)'

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

Title:
  Can delete a pricelist still linked to a partner

Status in OpenObject Addons Modules:
  Fix Released

Bug description:
  Can be replicated as follows:

Create a new database using demo data and install the CRM and Sales applications. 
With that you get two default price lists, one for sales and one for purchases. 
Create a new price list and an associated price list version. 
Go to an existing customer and associate the new price list with them. 
Then go and create an order for the same customer, which will default to the new price list. 
Save the order and then go and delete the price list linked to the customer and the order. 
The system will complain saying that a sales order is linked, therefore you cannot delete the price list. 
On the sales order, change the price list to the default one supplied by the system, and now go and delete the price list you created. 

The system will let you do it, even though it is still linked to a customer.

Now try and open the customer form to modify. The system does not allow you to.

This is the error:

[2010-12-21 16:21:35,288][rwg_test_picelist] ERROR:web-services:Uncaught exception
Traceback (most recent call last):
  File "/home/openerp/openerp/openerp-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/openerp/openerp/openerp-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/openerp/openerp/openerp-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/openerp/openerp/openerp-server/bin/osv/orm.py", line 3063, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/home/openerp/openerp/openerp-server/bin/osv/orm.py", line 3174, in _read_flat
    res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
  File "/home/openerp/openerp/openerp-server/bin/osv/fields.py", line 785, in get
    res = self._fnct(obj, cr, user, ids, name, self._arg, context)
  File "/home/openerp/openerp/openerp-server/bin/osv/fields.py", line 1058, in _fnct_read
    replaces[rep] = dict(obj.pool.get(rep).name_get(cr, uid, replaces[rep].keys(), context=context))
  File "/home/openerp/openerp/addons/product/pricelist.py", line 112, in name_get
    name = pl.name + ' ('+ pl.currency_id.name + ')'
  File "/home/openerp/openerp/openerp-server/bin/osv/orm.py", line 287, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field name not found in browse_record(product.pricelist, 3)'

I would have expected that maybe I would not be allowed to delete a price list linked to a customer, and if so, at least to have the ability to modify the customer to put them on another price list.

Using Linux platform, trunk version 6, addons revision 4033, server revision 3137.






.





References