Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
11338 Lượt xem

for example 

My Company default Currency USD 

But Vendor default Currency is GBR  

I want to know method/function in Odoo who get USD and convert into GBR Rate or GBR as input and give me USD conversion rate ....

for Example

i have two product get from two differenet vendor with different currency which is not match with my Company currency 

i'm creating Purchase order with create method in python file ....
i need method/function who convert my currency rate ....


any help/tips 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Try using this code to convert currency

amount_convert = company_currency.with_context(date=self.date).compute(amount, convert_currency)

By default odoo currency conversion during payments refer this link

To setup  multi currencies and conversion rate check this link

There is similar question check this

Ảnh đại diện
Huỷ bỏ
Tác giả

for sr_line in self.ssr_line:

convert_currency = self.vendor.property_purchase_currency_id.id or self.env.user.company_id.currency_id.id

amount_convert = company_currency.with_context(date=self.date).compute(sr_line.vendor_price, convert_currency)

company currency is current company currency_id and convert currency is currency_id to which you want to convert

Tác giả

i use

currency.with_context(dict(self._context or {}, date=fields.datetime.today())).rate

for my requirement can you pls update your answer i will acpt your answer

Sorry I don't get it . Did you need the exact answer for your requirement.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 23
2007
0
thg 8 16
4473
1
thg 10 24
2357
3
thg 4 24
1972
0
thg 9 22
749