2
2
from __future__ import unicode_literals
3
3
import frappe
4
4
5
- __version__ = '8.0.29'
5
+ __version__ = '8.0.30'
6
+
6
7
7
8
def get_default_company (user = None ):
8
9
'''Get default company for user'''
@@ -19,12 +20,14 @@ def get_default_company(user=None):
19
20
20
21
return default_company
21
22
23
+
22
24
def get_default_currency ():
23
25
'''Returns the currency of the default company'''
24
26
company = get_default_company ()
25
27
if company :
26
28
return frappe .db .get_value ('Company' , company , 'default_currency' )
27
29
30
+
28
31
def get_company_currency (company ):
29
32
'''Returns the default company currency'''
30
33
if not frappe .flags .company_currency :
@@ -33,11 +36,13 @@ def get_company_currency(company):
33
36
frappe .flags .company_currency [company ] = frappe .db .get_value ('Company' , company , 'default_currency' )
34
37
return frappe .flags .company_currency [company ]
35
38
39
+
36
40
def set_perpetual_inventory (enable = 1 ):
37
41
accounts_settings = frappe .get_doc ("Accounts Settings" )
38
42
accounts_settings .auto_accounting_for_stock = enable
39
43
accounts_settings .save ()
40
44
45
+
41
46
def encode_company_abbr (name , company ):
42
47
'''Returns name encoded with company abbreviation'''
43
48
company_abbr = frappe .db .get_value ("Company" , company , "abbr" )
@@ -46,4 +51,6 @@ def encode_company_abbr(name, company):
46
51
if parts [- 1 ].lower () != company_abbr .lower ():
47
52
parts .append (company_abbr )
48
53
49
- return " - " .join ([parts [0 ], company_abbr ])
54
+ return " - " .join (parts )
55
+
56
+
0 commit comments