Rushabh Mehta | 8fa3e6c | 2013-01-24 13:09:39 +0530 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | |
Rushabh Mehta | 3966f1d | 2012-02-23 12:35:32 +0530 | [diff] [blame] | 3 | # ERPNext - web based ERP (http://erpnext.com) |
| 4 | # Copyright (C) 2012 Web Notes Technologies Pvt Ltd |
| 5 | # |
| 6 | # This program is free software: you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation, either version 3 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
Rushabh Mehta | 2eef40b | 2012-07-16 14:16:57 +0530 | [diff] [blame] | 19 | # default settings that can be made for a profile. |
Anand Doshi | 486f9df | 2012-07-19 13:40:31 +0530 | [diff] [blame] | 20 | from __future__ import unicode_literals |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 21 | |
Anand Doshi | 19df188 | 2013-02-17 00:26:59 +0530 | [diff] [blame] | 22 | import webnotes |
| 23 | |
Rushabh Mehta | 8fa3e6c | 2013-01-24 13:09:39 +0530 | [diff] [blame] | 24 | lang_names = { |
| 25 | "हिंदी": "hi", |
billyfordson | 9b35230 | 2013-02-27 17:36:23 +0100 | [diff] [blame] | 26 | "deutsch": "de", |
Rushabh Mehta | 317177a | 2013-01-24 18:18:39 +0530 | [diff] [blame] | 27 | "english": "en", |
Rushabh Mehta | 27254d9 | 2013-01-24 15:55:08 +0530 | [diff] [blame] | 28 | "español": "es", |
| 29 | "français": "fr", |
Rushabh Mehta | 317177a | 2013-01-24 18:18:39 +0530 | [diff] [blame] | 30 | "português": "pt", |
Rushabh Mehta | 9e02949 | 2013-02-25 11:05:27 +0530 | [diff] [blame] | 31 | "português brasileiro": "pt-BR", |
Rushabh Mehta | 8e3affb | 2013-01-25 11:58:18 +0530 | [diff] [blame] | 32 | "nederlands": "nl", |
Rushabh Mehta | cda5d42 | 2013-01-28 14:21:40 +0530 | [diff] [blame] | 33 | "српски":"sr", |
| 34 | "தமிழ்": "ta", |
Rushabh Mehta | 60135df | 2013-02-11 11:44:12 +0530 | [diff] [blame] | 35 | "Hrvatski": "hr", |
Rushabh Mehta | dcb1b65 | 2013-02-21 17:05:01 +0530 | [diff] [blame] | 36 | "ไทย": "th", |
Rushabh Mehta | 317177a | 2013-01-24 18:18:39 +0530 | [diff] [blame] | 37 | "العربية":"ar" |
Rushabh Mehta | 8fa3e6c | 2013-01-24 13:09:39 +0530 | [diff] [blame] | 38 | } |
| 39 | |
billyfordson | 9b35230 | 2013-02-27 17:36:23 +0100 | [diff] [blame] | 40 | lang_list = ["ar", "de", "en", "hi", "es", "fr", "pt-BR", "pt", "nl", "hr", "th"] |
Rushabh Mehta | 8fa3e6c | 2013-01-24 13:09:39 +0530 | [diff] [blame] | 41 | |
Rushabh Mehta | 2eef40b | 2012-07-16 14:16:57 +0530 | [diff] [blame] | 42 | product_name = "ERPNext" |
| 43 | profile_defaults = { |
| 44 | "Company": "company", |
| 45 | "Territory": "territory" |
| 46 | } |
Rushabh Mehta | 4b9827a | 2013-02-12 19:20:39 +0530 | [diff] [blame] | 47 | |
| 48 | application_home_page = "desktop" |
| 49 | |
Pratik Vyas | c1e6e4c | 2011-06-08 14:37:15 +0530 | [diff] [blame] | 50 | # add startup propertes |
Rushabh Mehta | e598487 | 2012-08-03 14:15:07 +0530 | [diff] [blame] | 51 | mail_footer = """<div style="padding: 7px; text-align: right; color: #888"><small>Sent via |
| 52 | <a style="color: #888" href="https://erpnext.com">ERPNext</a></div>""" |
| 53 | |
| 54 | def get_monthly_bulk_mail_limit(): |
| 55 | import webnotes |
| 56 | # if global settings, then 500 or unlimited |
| 57 | if webnotes.conn.get_value('Email Settings', None, 'outgoing_mail_server'): |
| 58 | return 999999 |
| 59 | else: |
Rushabh Mehta | 49dc5da | 2012-08-03 16:02:24 +0530 | [diff] [blame] | 60 | return 500 |
Anand Doshi | 13dc9f3 | 2013-02-13 23:42:48 +0530 | [diff] [blame] | 61 | |
| 62 | def get_url(): |
| 63 | from webnotes.utils import get_request_site_address |
| 64 | url = get_request_site_address() |
| 65 | if not url or "localhost" in url: |
| 66 | subdomain = webnotes.conn.get_value("Website Settings", "Website Settings", |
| 67 | "subdomain") |
| 68 | if subdomain: |
| 69 | if "http" not in subdomain: |
| 70 | url = "http://" + subdomain |
billyfordson | 9b35230 | 2013-02-27 17:36:23 +0100 | [diff] [blame] | 71 | return url |