Default currency from sale shop or company

This commit is contained in:
resteve 2014-07-22 10:26:55 +02:00
parent 5bf74825c6
commit 80ad0eaae6
2 changed files with 10 additions and 1 deletions

View File

@ -86,9 +86,16 @@ class SaleCart(ModelSQL, ModelView):
@staticmethod
def default_currency():
Company = Pool().get('company.company')
shop = Transaction().context.get('shop')
company = Transaction().context.get('company')
if shop:
Shop = Pool().get('sale.shop')
shop = Shop(shop)
if hasattr(shop, 'esale_currency'):
return shop.esale_currency.id
if company:
Company = Pool().get('company.company')
return Company(company).currency.id
@fields.depends('product', 'unit', 'quantity', 'party', 'currency')

View File

@ -2,5 +2,7 @@
version=3.2.0
depends:
sale_data
extras_depend:
esale
xml:
sale_cart.xml