[Openerp-community] change list price of products

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Openerp-community] change list price of products

hector jahzeel Luna bueso
Hi community !!

I need help. need to change the price of all my products when the exchange rate change.
In my case the currency of the company is HNL, because i need all my invoices in LPS("Lempiras of Honduras") but this pricesare based on dolar price.
Then when the dolar exchange rate change. the price of all my products should change.
I make a function but only update the prices when  click on my module, need to update them when  save the exchange rate.

Regards.
Hector Luna.
Grupo Innova.
Ready Partner.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp
Reply | Threaded
Open this post in threaded view
|

Re: [Openerp-community] change list price of products

Graeme Gellatly
Then all you need to do is call that action when you write exchange rate if it meets conditions in the simplest case.

Not necessarily the best way, but for you it should work.  More than a few hundred products then maybe not.

e.g

def write(cr, user, vals, context):
   res = super(<model., self).write(<args>)
   if <field> in vals:
       self.pool['product.[template|product]'].<action>(<args>, <kwargs>)
   return res

Pseudocode untested, use at your own peril

However, given that this sounds frequent and possibly automated you may also want to consider modules the historize price such as product_price_history(ical) I forget under OCA.


On Thu, Jul 3, 2014 at 11:38 AM, hector jahzeel Luna bueso <[hidden email]> wrote:
Hi community !!

I need help. need to change the price of all my products when the exchange rate change.
In my case the currency of the company is HNL, because i need all my invoices in LPS("Lempiras of Honduras") but this pricesare based on dolar price.
Then when the dolar exchange rate change. the price of all my products should change.
I make a function but only update the prices when  click on my module, need to update them when  save the exchange rate.

Regards.
Hector Luna.
Grupo Innova.
Ready Partner.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : [hidden email]
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp