Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/buying/doctype/purchase_order/purchase_order.py b/buying/doctype/purchase_order/purchase_order.py
index 8bdc2d6..3675177 100644
--- a/buying/doctype/purchase_order/purchase_order.py
+++ b/buying/doctype/purchase_order/purchase_order.py
@@ -196,7 +196,6 @@
bean.run_method("set_missing_values")
def update_item(obj, target, source_parent):
- target.conversion_factor = 1
target.qty = flt(obj.qty) - flt(obj.received_qty)
target.stock_qty = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.conversion_factor)
target.import_amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.import_rate)
@@ -237,7 +236,6 @@
bean.run_method("set_supplier_defaults")
def update_item(obj, target, source_parent):
- target.conversion_factor = 1
target.import_amount = flt(obj.import_amount) - flt(obj.billed_amt)
target.amount = target.import_amount * flt(source_parent.conversion_rate)
if flt(obj.purchase_rate):
diff --git a/docs/docs.dev.install.debian.md b/docs/docs.dev.install.debian.md
deleted file mode 100644
index f140f29..0000000
--- a/docs/docs.dev.install.debian.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-{
- "_label": "ERPNext Pre-requisites for Debian systems (Unbuntu)"
-}
----
-#### If not root user
-`sudo su`
-
-#### Installing Pre-Requisites
-
- cd ~
- apt-get install python python-setuptools python-mysqldb apache2 mysql-server libmysqlclient-dev git memcached -y
- easy_install pip
- pip install pytz python-dateutil jinja2 markdown2 termcolor python-memcached requests chardet dropbox google-api-python-client pygeoip
- a2enmod rewrite
- service apache2 start
- service mysql start
- memcached -d -l 127.0.0.1 -p 11211 -m 64 -u www-data
-
-> ```memcached -d -l 127.0.0.1 -p 11211 -m [64 or more mb of ram] -u apache ```
-
-#### Other useful programs
-
- apt-get install ntp vim screen htop -y
- service ntpd start
diff --git a/docs/docs.dev.install.md b/docs/docs.dev.install.md
index 4c8ea2f..03fc6bd 100644
--- a/docs/docs.dev.install.md
+++ b/docs/docs.dev.install.md
@@ -2,8 +2,7 @@
{
"_label": "How to Install ERPNext",
"_toc": [
- "docs.dev.install.red_hat",
- "docs.dev.install.debian"
+ "docs.dev.install.restore_from_backup"
]
}
---
@@ -15,8 +14,8 @@
Install ERPNext in one command!
1. Switch to root user using `sudo su`
-1. create a folder where you want to install erpnext
-1. go to the new folder
+1. Create a folder where you want to install erpnext
+1. Go to the new folder
1. `wget https://raw.github.com/webnotes/erpnext/master/install_erpnext.py`
1. `python install_erpnext.py`
@@ -24,133 +23,19 @@
> If you get stuck, post your questions at [ERPNext Developer Forum](https://groups.google.com/forum/#!forum/erpnext-developer-forum)
+> [Troubleshooting SELinux](http://www.crypt.gen.nz/selinux/disable_selinux.html)
+
--
+
> [Server Setup Tips](http://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers)
-> [MySQL configuration file - my.cnf](MySQL-configuration-file)
+> [MySQL configuration file - my.cnf](https://github.com/webnotes/erpnext/wiki/MySQL-configuration-file)
-> [Some Useful Aliases](Some-Useful-Aliases)
+> [Some Useful Aliases](https://github.com/webnotes/erpnext/wiki/Some-Useful-Aliases)
---
### Upgrade / run latest patches
1. Backup your database!
-1. go to Setup > Update This Application [under Update Manager]
-1. click on 'Get Latest Updates'
-
-> [Restoring from ERPNext backup](Restoring-From-ERPNext-Backup)
-
----
-### Step by step instructions
-
-1. You will need some linux background to be able to install this on your system.
-1. These are high-level instructions and by no means cover every installation issue.
-
-### Pre-requisites:
-
-* any unix based os
-* python 2.6+ (python 3+ not supported)
-* apache
-* mysql 5+
-* git
-* python libraries:
- * python MySQLdb
- * pytz
- * jinja2
- * markdown2
- * dateutil
- * termcolor
- * python-memcached
- * requests
- * chardet
- * pygeoip
- * dropbox
- * google-api-python-client
-* memcached
-
-## Fresh Installation
-
-### Steps: [using terminal]
-
-#### Get the Install Script
-
-Download the standard install script and install. This script will:
-
-- Create `app` and `lib` folders.
-- Clone the code repositories for `wnframework` and `erpnext` from GitHub. It is important to clone the repositories from GitHub rather than just downloading the code, because this will help you in upgrading the system.
-- Create the database.
-- Create a default `erpnext.conf` Apache configuration file for ERPnext.
-- Create the standard wnframework configuration file `conf.py`
-- Build the `public` folder from which the ERPNext client application will be served via Apache and CGI.
-
-**Instructions**
-
-1. ensure mysql service is running
-1. create a folder where you want to install erpnext
-1. go to the new folder
-1. `wget https://github.com/webnotes/erpnext/blob/master/install_erpnext.py`
-1. `python install_erpnext.py`
-
-#### Setup Apache
-
-1. check your apache/httpd user and group. Most often it is either `apache` or `_www`. This can be found in its conf file.
-1. run `chown -R apache:apache *` or `chown -R _www:_www *`. This will make the erpnext folder accessible to apache webserver.
-1. create erpnext.conf file in erpnext folder and paste a modified version of apache configuration file as shown in the example below. (You will need to change the values in square brackets)
- * For debian systems, `sudo ln -s [PATH TO ERPNEXT INSTALLATION]/erpnext.conf /etc/apache2/sites-enabled/erpnext.conf`
- * For redhat systems, `sudo ln -s [PATH TO ERPNEXT INSTALLATION]/erpnext.conf /etc/httpd/conf.d/erpnext.conf`
-1. restart apache service
-1. if firewall exists, run
-```
-iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
-service iptables save
-```
-
-### Setup Schueduler
-
-1. setup cron using `crontab -e` and enter the following and then save it:
-```
-*/3 * * * * cd [PATH TO ERPNEXT INSTALLATION] && python lib/wnf.py --run_scheduler >> /var/log/erpnext-sch.log 2>&1
-0 */6 * * * cd [PATH TO ERPNEXT INSTALLATION] && python lib/wnf.py --backup >> /var/log/erpnext-backup.log 2>&1
-```
-
-### Start
-
-1. go to erpnext folder and run `lib/wnf.py --domain localhost:8080`
-1. start your browser and go to http://localhost:8080
-1. login as user: Administrator and password: admin
-
-> If you are installing on your server for deployment, remember to change Administrator's password!
-
-### What to write in apache configuration file?
-
- Listen 8080
- NameVirtualHost *:8080
- <VirtualHost *:8080>
- ServerName localhost
- DocumentRoot [PATH TO ERPNEXT INSTALLATION]/public/
-
- AddHandler cgi-script .cgi .xml .py
- AddType application/vnd.ms-fontobject .eot
- AddType font/ttf .ttf
- AddType font/otf .otf
- AddType application/x-font-woff .woff
-
- <Directory [PATH TO ERPNEXT INSTALLATION]/public/>
- # directory specific options
- Options -Indexes +FollowSymLinks +ExecCGI
-
- # directory's index file
- DirectoryIndex web.py
-
- AllowOverride all
- Order Allow,Deny
- Allow from all
-
- # rewrite rule
- RewriteEngine on
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME} !-l
- RewriteRule ^([^/]+)$ /web.py?page=$1 [QSA,L]
- </Directory>
- </VirtualHost>
+1. Go to Setup > Update ERPNext
+1. Click on 'Update'
\ No newline at end of file
diff --git a/docs/docs.dev.install.red_hat.md b/docs/docs.dev.install.red_hat.md
deleted file mode 100644
index 17a6072..0000000
--- a/docs/docs.dev.install.red_hat.md
+++ /dev/null
@@ -1,59 +0,0 @@
----
-{
- "_label": "ERPNext Pre-requisites for Red Hat systems (CentOS, Fedora)"
-}
----
-#### If not root user
-`sudo su`
-
-#### Installing Pre-Requisites
-
- cd ~
- yum update python -y
- yum install python-setuptools MySQL-python httpd mysql mysql-server mysql-devel git memcached ntp vim -y
- easy_install pip
- pip install pytz python-dateutil jinja2 markdown2 termcolor python-memcached requests chardet dropbox google-api-python-client pygeoip
- service httpd start
- service mysqld start
- service ntpd start
- mysqladmin -u root password [NEW PASSWORD]
-
-#### memcached
-
-1. `vim /etc/sysconfig/memcached`
-1. change user to the apache user, change the cache size if desired (depending on available memory), save the file
-1. `service memcached start`
-
-#### set services to run when machine starts
-
- chkconfig --level 2345 mysql on
- chkconfig --level 2345 httpd on
- chkconfig --level 2345 memcached on
- chkconfig --level 2345 ntpd on
-
-#### Other useful programs
-
-wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
-rpm -i http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
-yum install htop screen -y
-
---
-
-#### CPanel Users
-
-If you are using CPanel, you are likely to face perl dependency issues when installing git. To install git in this case, follow this procedure:
-
-1. `vim /etc/yum.conf`, remove perl* from exclude list and save the file
-1. `yum install git -y`
-1. `vim /etc/yum.conf`, add perl* back to exclude list and save the file
-
-> source: [http://forums.cpanel.net/f5/upcp-errors-due-dependeny-problems-centos-6-3-not-upgraded-centos-6-4-a-332102.html](http://forums.cpanel.net/f5/upcp-errors-due-dependeny-problems-centos-6-3-not-upgraded-centos-6-4-a-332102.html)
-
-CPanel users should follow these steps to set the apache configuration for ERPNext:
-
-1. `vim /etc/httpd/conf/includes/post_virtualhost_2.conf`
-1. add the line `Include [PATH TO ERPNEXT CONF FILE]` (example: /var/www/erpnext.conf) and save the file
-1. `vim [PATH TO ERPNEXT CONF FILE]`, set the apache configuration for ERPNext and save it
-1. `service httpd restart`
-
-*The mysql root password may be found at* `/root/.my.cnf`
\ No newline at end of file
diff --git a/docs/docs.dev.install.restore_from_backup.md b/docs/docs.dev.install.restore_from_backup.md
new file mode 100644
index 0000000..e795bfa
--- /dev/null
+++ b/docs/docs.dev.install.restore_from_backup.md
@@ -0,0 +1,26 @@
+---
+{
+ "_label": "Restoring From ERPNext Backup"
+}
+---
+
+* Download backup files
+
+ cd /tmp
+ wget [DATABASE BACKUP FILE URL]
+ wget [FILES BACKUP FILE URL]
+
+* Suppose your backup files are downloaded at /tmp
+
+ gunzip [DATABASE BACKUP FILE.sql.gz]
+ tar xvf [FILES BACKUP.tar]
+
+* Go to your ERPNext installation folder
+* When restoring from database, the 'Administrator' user password gets reset to 'admin'. To set a better password when restoring, set admin_password variable in conf.py to the desired 'Administrator' user password.
+* Restore database using:
+
+ lib/wnf.py --install [DATABASE NAME] /tmp/[DATABASE BACKUP FILE.sql]
+
+* Copy extracted files
+
+ cp /tmp/[FILES BACKUP EXTRACTED FOLDER/---/public/files/*] [YOUR ERPNEXT INSTALLATION]/public/files/
\ No newline at end of file
diff --git a/patches/may_2013/p06_update_billed_amt_po_pr.py b/patches/may_2013/p06_update_billed_amt_po_pr.py
index 871a7de..3f66c03 100644
--- a/patches/may_2013/p06_update_billed_amt_po_pr.py
+++ b/patches/may_2013/p06_update_billed_amt_po_pr.py
@@ -6,6 +6,8 @@
import webnotes
webnotes.reload_doc("buying", "doctype", "purchase_order_item")
webnotes.reload_doc("stock", "doctype", "purchase_receipt_item")
+
for pi in webnotes.conn.sql("""select name from `tabPurchase Invoice` where docstatus = 1"""):
webnotes.get_obj("Purchase Invoice", pi[0],
- with_children=1).update_qty(change_modified=False)
\ No newline at end of file
+ with_children=1).update_qty(change_modified=False)
+ webnotes.conn.commit()
\ No newline at end of file
diff --git a/public/js/conf.js b/public/js/conf.js
index 625a513..993d2ab 100644
--- a/public/js/conf.js
+++ b/public/js/conf.js
@@ -3,10 +3,10 @@
wn.provide('erpnext');
-wn.modules_path = 'erpnext';
-
// add toolbar icon
$(document).bind('toolbar_setup', function() {
+ wn.app.name = "ERPNext";
+
var brand = ($("<div></div>").append(wn.boot.website_settings.brand_html).text() || 'erpnext');
$('.navbar-brand').html('<div style="display: inline-block;">\
<object type="image/svg+xml" data="app/images/splash.svg" class="toolbar-splash"></object>\
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.py b/stock/doctype/purchase_receipt/purchase_receipt.py
index 8416747..c78e759 100644
--- a/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -357,9 +357,6 @@
bean.run_method("set_missing_values")
bean.run_method("set_supplier_defaults")
- def update_item(obj, target, source_parent):
- target.conversion_factor = 1
-
doclist = get_mapped_doclist("Purchase Receipt", source_name, {
"Purchase Receipt": {
"doctype": "Purchase Invoice",
@@ -376,7 +373,6 @@
"prevdoc_docname": "purchase_order",
"purchase_rate": "rate"
},
- "postprocess": update_item
},
"Purchase Taxes and Charges": {
"doctype": "Purchase Taxes and Charges",