← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

** Changed in: openobject-addons
   Importance: Undecided => Low

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

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 2 (openerp-dev-addons2)

-- 
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:
  Confirmed

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