Vauxoo / addons-vauxoo

All our modules related to developments that solves generic issues on Odoo, or that solve internal problems on Odoo Core, if something is here, maybe it is solving an issue in your company, try it and report what you see.
http://www.vauxoo.com
195 stars 288 forks source link

[8.0] partner_credit_limit: Bad assign of sale currency #1120

Closed ysantiago closed 4 years ago

ysantiago commented 8 years ago

In sale.py is the following code:

allowed_sale = self.env['res.partner'].with_context(
    {'new_amount': so.amount_total, 
     'new_currency': so.company_id.currency_id.id}).browse(
         so.partner_id.id).allowed_sale

Here is passing through context as new currency the company currency instead of passing the sale currency: 'new_currency': so.currency_id.id

This causes that the conversion between the company currency and the currency in which the sale is made does not execute correctly (because they are both the same).

ysantiago commented 8 years ago

@nhomar what do you think about?

nhomar commented 8 years ago

Can you add a test case where it is failing? AFAICR it is being used with no error in customer environment (Lodi) can you ask to @dsabrinarg for details and maybe a testing environment where she and you can test this toghether?

maybe we have a hidden error than the customer is not being able to see.

LAst time we touched this module a huge set of issued comes up because as it is is was completely approved. But again, please check functionally with Sabrina your use case and maybe a unittest that allow validate that will tell us if all is ok.

Regards.