02 March 2009

New module: product_price_update

I have rewritten the extra-addons/product_listprice_upgrade module, it can be downloaded with 'bzr branch lp:~gdukai/openobject-addons/product_price_update'.

It has several improvements over the original:
-Possible to update any price type not just the list price.
-Correctly uses recursion and checks to update a price only one time even if parent and child categories are selected.
-Rewritten using the new osv_memory objects (the old module used wizard.interface).
-Corrects a menu duplication.

If you don't know what it is for, read my previous post. This module could also be interesting to see how the old type wizard looks like reimplemented in osv_memory.

Better price control

The basic setup of OpenERP has a very simple pricelist setup: manually set the list prices of the products and use them for the sales orders. Many companies use a cost price + margin% = list price formula. To work like this, we could easly modify the default public pricelist (sales pricelist) to be based on the cost price and add some percentage to that.
But this is usually not enough, for two reasons:
  • The prices calculated by the sales pricelist can only be seen when creating new sales order lines. Nothing updates the list price field on the products.
  • The sales prices change with every purchase because it changes the cost price they are based on. Many companies don't want to change prices every hour or so.
The solution: use the product_listprice_upgrade module in extra-addons. We need the original public pricelist that is based on the list price. Plus we have to create a new one of the type 'internal' and set it up to be based on the cost price + margin formula. The wizard in the listprice_upgrade module under the Pricelist menu will update the list price for the products we choose. This has to be run every time we decide to have new list prices.

p.s. There's a better module than product_listprice_upgrade, read this post.